Skip to content

Commit 0e79e07

Browse files
committed
only autocomplete runes in svelte files
1 parent 4afc575 commit 0e79e07

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sites/svelte-5-preview/src/lib/autocomplete.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ export function autocomplete(context, selected, files) {
165165
};
166166
}
167167

168+
if (
169+
selected.type !== 'svelte' &&
170+
(selected.type !== 'js' || !selected.name.endsWith('.svelte'))
171+
) {
172+
return false;
173+
}
174+
168175
if (node.name === 'VariableName' || node.name === 'PropertyName' || node.name === '.') {
169176
// special case — `$inspect(...).with(...)` is the only rune that 'returns'
170177
// an 'object' with a 'method'

0 commit comments

Comments
 (0)