fork from svelte-vscode.
Provides rich intellisense for Svelte components in (neo)vim, utilising the svelte language server.
:CocInstall coc-svelte
You have to install syntax plugin to get syntax highlight and get right filetype, for example
leafOfTree/vim-svelte-plugin
If you added "files.associations": {"*.svelte": "html" }
to your CoC settings, remove it.
Do you want to use TypeScript/SCSS/Less/..? See the docs.
- Svelte
- Diagnostic messages for warnings and errors
- Support for svelte preprocessors that provide source maps
- Svelte specific formatting (via prettier-plugin-svelte)
- HTML
- Hover info
- Autocompletions
- Emmet
- Symbols in Outline panel
- CSS / SCSS / LESS
- TypeScript / JavaScript
- Diagnostics messages for syntax errors, semantic errors, and suggestions
- Hover info
- Formatting (via prettier)
- Symbols in Outline panel
- Autocompletions
- Go to definition
- Code Actions
Path to the node executable you would like to use to run the language server. This is useful when you depend on native modules such as node-sass as without this they will run in the context of vscode, meaning node version mismatch is likely.
You normally don't set this. Path to the language server executable. If you installed the "svelte-language-server" npm package, it's within there at "bin/server.js". Path can be either relative to your workspace root or absolute. Set this only if you want to use a custom version of the language server.
You normally don't set this. At which port to spawn the language server. Can be used for attaching to the process for debugging / profiling. If you experience crashes due to "port already in use", try setting the port. -1 = default port is used.
Enable the TypeScript plugin. Default: true
Enable diagnostic messages for TypeScript. Default: true
Enable hover info for TypeScript. Default: true
Enable document symbols for TypeScript. Default: true
Enable completions for TypeScript. Default: true
Enable find-references for TypeScript. Default: true
Enable go to definition for TypeScript. Default: true
Enable code actions for TypeScript. Default: true
Enable selection range for TypeScript. Default: true
Enable rename/move Svelte files functionality. Default: true
Enable signature help (parameter hints) for JS/TS. Default: true
Enable the CSS plugin. Default: true
Which css files should be checked for global variables (--global-var: value;
). These variables are added to the css completions. String of comma-separated file paths or globs relative to workspace root.
Enable diagnostic messages for CSS. Default: true
Enable hover info for CSS. Default: true
Enable auto completions for CSS. Default: true
Enable document colors for CSS. Default: true
Enable color picker for CSS. Default: true
Enable document symbols for CSS. Default: true
Enable selection range for CSS. Default: true
Enable the HTML plugin. Default: true
Enable hover info for HTML. Default: true
Enable auto completions for HTML. Default: true
Enable HTML tag auto closing. Default: true
Enable document symbols for HTML. Default: true
Enable the Svelte plugin. Default: true
Enable diagnostic messages for Svelte. Default: true
Svelte compiler warning codes to ignore or to treat as errors. Example: { 'css-unused-selector': 'ignore', 'unused-export-let': 'error'}
Enable formatting for Svelte (includes css & js). Default: true
Enable hover info for Svelte (for tags like #if/#each). Default: true
Enable autocompletion for Svelte (for tags like #if/#each). Default: true
Enable code actions for Svelte. Default: true
Enable selection range for Svelte. Default: true
- Run
yarn add -D svelte-language-server
to install svelte-language-server as a dev dependency - Run
yarn dlx @yarnpkg/pnpify --sdk vim
to generate or update the (neo)vim/Yarn integration SDKs. This also sets thesvelte.language-server.ls-path
setting for the workspace, pointing it to the workspace-installed language server. - Restart (neo)vim.
- Commit the changes to
.yarn/sdks