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

Support the {@const} tag #268

Closed
TheOnlyTails opened this issue Jan 9, 2022 · 4 comments
Closed

Support the {@const} tag #268

TheOnlyTails opened this issue Jan 9, 2022 · 4 comments
Labels
Svelte core Missing core feature

Comments

@TheOnlyTails
Copy link

TheOnlyTails commented Jan 9, 2022

The {@const} tag, which allows declaration of constants inside markup, is soon to be merged into the main Svelte repo: sveltejs/svelte#6413

Some opportunities this can have:

  • TypeScript support
  • Auto-completion support in markup (including variables declared with {@const} in auto-completion)
  • Support for Navigate-to-declaration & Find Usages
    (you get the point, it should behave like any other variable declared with const)

https://svelte.dev/docs#template-syntax-const

The language tools PR has already been merged: sveltejs/language-tools#1319
The RFC describing the syntax: https://github.com/sveltejs/rfcs/blob/master/text/0007-markup-constants.md

Update: {@const} has now been officially released in Svelte 3.46.

@tomblachut tomblachut added the Svelte core Missing core feature label Jan 12, 2022
@risalfajar
Copy link

will this be supported soon?

@TheOnlyTails TheOnlyTails changed the title Support the upcoming {@const} tag Support the {@const} tag Jun 8, 2022
@cristianvogel
Copy link

cristianvogel commented Jul 4, 2022

The plugin really needs {@const} support to be complete.
https://svelte.dev/docs#template-syntax-const

@risalfajar
Copy link

@tomblachut is there any plan for this? It has been 9 months :(

@risalfajar
Copy link

Update: Issue tracking has been moved from GitHub to YouTrack

see https://youtrack.jetbrains.com/issue/WEB-55903/Svelte-const-tag-causes-syntax-errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Svelte core Missing core feature
Projects
None yet
Development

No branches or pull requests

4 participants