Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destructuring inline event parameters breaks IntelliSense #2155

Open
ignatiusmb opened this issue Sep 12, 2023 · 1 comment
Open

Destructuring inline event parameters breaks IntelliSense #2155

ignatiusmb opened this issue Sep 12, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@ignatiusmb
Copy link
Member

ignatiusmb commented Sep 12, 2023

Describe the bug

Having an inline event handler inside an element (doesn't have to be a special element) breaks <style> tag IntelliSense.

Reproduction

Copy and paste the snippet to an empty .svelte file and trigger the autocomplete box in the styles tag

<svelte:window
	on:mousemove={({}) => {
		// destructuring the parameter above breaks autocompletion
		// remove the empty brackets and the css autocompletion below works
	}}
/>

<div><slot /></div>

<style>
	div {
		/* trigger autocomplete here, gets JS variables instead of CSS */
	}
</style>

Expected behaviour

CSS autocompletion works without having to move destructuring inside the function body.

System Info

  • OS: Windows
  • IDE: VSCode

Which package is the issue about?

Svelte for VS Code extension

Additional Information, eg. Screenshots

No response

@ShadiestGoat
Copy link

Its not just for destructuring (though I can replicate that as well). In this snippet, it breaks with the same symptoms:

<svelte:window
    on:mousemove={() => {
        if (true) {return}
        if (2 >= 1) {}
    }}
/>

<style lang="scss">
    /* js suggestions here :// */
</style>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants