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

The LSP doesn't format when using Svelte 5 features #2426

Closed
realguse opened this issue Jul 1, 2024 · 3 comments
Closed

The LSP doesn't format when using Svelte 5 features #2426

realguse opened this issue Jul 1, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@realguse
Copy link

realguse commented Jul 1, 2024

Describe the bug

The built in LSP formatter doesn't format the code if it detects Svelte 5 features, like snippets or runes.

Reproduction

Write a .svelte file that is using one of the new features (like runes or snippets) and try to format the code.

Expected behaviour

The LSP should format the code.

System Info

  • OS: macOS
  • IDE: Neovim

Neovim with Conform and the Svelte LSP for fomatting.

Which package is the issue about?

svelte-language-server

Additional Information, eg. Screenshots

No response

@realguse realguse added the bug Something isn't working label Jul 1, 2024
@jasonlyu123
Copy link
Member

Duplicate of #2338. Svelte 5 currently require a workspace version of prettier-plugin-svelte and a prettier config file.

https://github.com/sveltejs/kit/blob/main/packages/create-svelte/shared/%2Bprettier/.prettierrc

@sebwib
Copy link

sebwib commented Oct 8, 2024

When I add the following to the workspace .prettierrc file, prettier stops working for .svelte files.

"plugins": ["prettier-plugin-svelte"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]

prettier-plugin-svelte is updated to the latest version.
I use typescript

@realguse
Copy link
Author

realguse commented Oct 8, 2024

When I add the following to the workspace .prettierrc file, prettier stops working for .svelte files.

"plugins": ["prettier-plugin-svelte"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]

prettier-plugin-svelte is updated to the latest version. I use typescript

sorry @sebwib, but i think you should open a new issue, this ones closed

@jasonlyu123 jasonlyu123 unpinned this issue Oct 23, 2024
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

3 participants