I'm having trouble with my Neovim setup for frontend work. It's running five language servers at once for a single Svelte file:
- cssls
- typescript-tools
- svelte LSP
- tailwindcss LSP
- emmet-language-server
This is making things really slow, especially Tailwind completions. The whole editing experience isn't as quick as I'd like.
My main issues are:
1. Slow Tailwind suggestions
2. Too many LSPs for one file
3. General lag when working with Svelte or React
I'm using NvChad as my base setup. How do you guys handle LSPs for frontend work? Should I turn some off? Which ones? Are there better ways to set up Neovim for Tailwind and Svelte?
What's your approach to this? Any tips would be great!
I’ve encountered similar issues in my frontend development setup. One effective approach I’ve found is to use a single, comprehensive language server like ‘volar’ for Vue projects or ‘astro-ls’ for Astro. These servers often handle multiple languages within a file, reducing the need for separate LSPs. For Svelte specifically, the official Svelte language server is quite capable on its own.
Regarding Tailwind, consider using static analysis tools or linters instead of a full LSP. This can significantly improve performance while still providing useful suggestions. Additionally, optimizing your Neovim configuration by lazy-loading plugins and fine-tuning LSP settings can make a noticeable difference in responsiveness.
have u tried lazy-loading ur lsps? that could help with performance. also, maybe consider using eslint for some checks instead of relying on lsps for everything. btw, whats ur hardware like? sometimes upgrading RAM can make a big difference. ever thought about using a language-specific config for svelte files?
hey man, i feel ya. lsp overload sucks. maybe try disabling tailwind lsp first? it’s usually the heaviest. or switch to a lighter alternative like coc.nvim for completion. personally, i just use typescript-language-server for js/ts/svelte. keeps things snappy. good luck!