diff --git a/.changeset/cuddly-lemons-sniff.md b/.changeset/cuddly-lemons-sniff.md new file mode 100644 index 0000000..19922b3 --- /dev/null +++ b/.changeset/cuddly-lemons-sniff.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/mcp': patch +--- + +fix: add suggestion for snippets declared in script tag diff --git a/packages/mcp-server/src/mcp/handlers/tools/svelte-autofixer.test.ts b/packages/mcp-server/src/mcp/handlers/tools/svelte-autofixer.test.ts index c2a259f..4be50f6 100644 --- a/packages/mcp-server/src/mcp/handlers/tools/svelte-autofixer.test.ts +++ b/packages/mcp-server/src/mcp/handlers/tools/svelte-autofixer.test.ts @@ -53,6 +53,18 @@ describe('svelte-autofixer tool', () => { ); }); + it('should add suggestions for snippets declared in script tag', async () => { + const content = await autofixer_tool_call(``); + expect(content.issues.length).toBeGreaterThan(0); + expect(content.suggestions).toContain( + "The code can't be compiled because a Javascript parse error. The error suggests you have a `{#snippet ...}` block inside the `