Skip to content

Commit

Permalink
fix: detect <script module> tag (#2482)
Browse files Browse the repository at this point in the history
This was missing in #2473

Possibly related to sveltejs/svelte#13039
  • Loading branch information
dummdidumm authored Aug 30, 2024
1 parent d994971 commit 399ad6a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/language-server/src/lib/documents/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,12 @@ export function extractScriptTags(
return null;
}

const script = scripts.find((s) => s.attributes['context'] !== 'module');
const moduleScript = scripts.find((s) => s.attributes['context'] === 'module');
const script = scripts.find(
(s) => s.attributes['context'] !== 'module' && !('module' in s.attributes)
);
const moduleScript = scripts.find(
(s) => s.attributes['context'] === 'module' || 'module' in s.attributes
);
return { script, moduleScript };
}

Expand Down

0 comments on commit 399ad6a

Please sign in to comment.