You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed some strange behavior when using a component with custom events. If I have <Foo on:bar={e => alert("hey")} /> and I start deleting from the end of the event handler, the VS code window hangs as soon as the body of the event handler becomes empty <Foo on:bar={} />
To Reproduce
Foo.svelte:
<script lang="ts">
import { createEventDispatcher } from "svelte";
const dispatch = createEventDispatcher();
function func() {
dispatch("bar", {abc: 123})
}
</script>
This is weird. I can see a high CPU usage on the main process of vscode, not extension host or language server. From my understanding, the extension can't block the UI thread.
After some more digging, I found disabling svelte.plugin.typescript.semanticTokens.enable would prevent the problem. But I don't know why. It freezes before asking the language server to update semantic tokens.
…#811)
#808
In svelte2tsx transformation, component event handler code is moved, Thus the semantic token would have the wrong order with other attributes and a negative length($on). Filter out the negative one and then sort the token
Describe the bug
I noticed some strange behavior when using a component with custom events. If I have
<Foo on:bar={e => alert("hey")} />
and I start deleting from the end of the event handler, the VS code window hangs as soon as the body of the event handler becomes empty<Foo on:bar={} />
To Reproduce
Foo.svelte:
App.svelte:
Place the cursor at the end of the event handler right before the closing
}
. Backspace until the event handler body becomes{}
.Expected behavior
VSCode doesn't crash and I can continue editing the app component.
System (please complete the following information):
Additional context
Minimal project to reproduce the issue
SvelteExample.tar.gz
The text was updated successfully, but these errors were encountered: