Language Server Catalog
Search 50+ coc.nvim language server configuration examples by language and server name, with connection modes and setup fields.
Server catalog
Add a languageserver section to your coc-settings.json to register custom language servers.
Ada/SPARK
Using Ada Language Server. See the installation instructions on the GitHub homepage of this LSP.
Via coc-als, or:
| 1 | "languageserver": { |
| 2 | "Ada": { |
| 3 | "command": "path/to/ada_language_server", |
| 4 | "filetypes": ["ada"] |
| 5 | } |
| 6 | } |
Apache Camel
Use coc-camel
| 1 | :CocInstall coc-camel |
Arduino
Using Arduino Language Server. See the installation instructions in the README file of this LSP.
| 1 | "languageserver":{ |
| 2 | "arduino":{ |
| 3 | "command":"/path/to/arduino-language-server", |
| 4 | "rootPatterns":["*.ino"], |
| 5 | "filetypes":["arduino"], |
| 6 | "args":["-cli", "/path/to/arduino-cli", "-clangd", "/path/to/clangd", "-cli-config", "/path/to/arduino-cli.yaml", "-fqbn", "board:name"], |
| 7 | "disabledFeatures":["semanticTokens"] |
| 8 | } |
| 9 | } |
Tips:
- This LSP requires
clangdandarduino-clito work properly. Adjust the values to match the locations of the binaries on your machine. - To determine (or generate if there isn't one) the location of
arduino-cli.yaml, refer to this page.
Bash
Via coc-sh or:
Using mads-hartmann/bash-language-server:
| 1 | "languageserver": { |
| 2 | "bash": { |
| 3 | "command": "bash-language-server", |
| 4 | "args": ["start"], |
| 5 | "filetypes": ["sh"] |
| 6 | } |
| 7 | } |
Bitbake
| 1 | "languageserver": { |
| 2 | "bitbake": { |
| 3 | "command": "bitbake-language-server", |
| 4 | "filetypes": ["bitbake"] |
| 5 | }, |
| 6 | } |
Blueprint
Using blueprint-compiler
| 1 | "languageserver": { |
| 2 | "blueprint": { |
| 3 | "command": "blueprint-compiler", |
| 4 | "args": ["lsp"], |
| 5 | "filetypes": ["blueprint", "blp"] |
| 6 | }, |
| 7 | } |
C/C++/Objective-C
Using clangd with coc-clangd or:
| 1 | "languageserver": { |
| 2 | "clangd": { |
| 3 | "command": "clangd", |
| 4 | "rootPatterns": ["compile_flags.txt", "compile_commands.json"], |
| 5 | "filetypes": ["c", "cc", "cpp", "c++", "objc", "objcpp"] |
| 6 | } |
| 7 | } |
Like many tools, clangd relies on the presence of a JSON compilation database.
Using ccls
| 1 | "languageserver": { |
| 2 | "ccls": { |
| 3 | "command": "ccls", |
| 4 | "filetypes": ["c", "cc", "cpp", "c++", "objc", "objcpp"], |
| 5 | "rootPatterns": [".ccls", "compile_commands.json", ".git/", ".hg/"], |
| 6 | "initializationOptions": { |
| 7 | "cache": { |
| 8 | "directory": "/tmp/ccls" |
| 9 | } |
| 10 | } |
| 11 | } |
| 12 | } |
To make header completion work with clang < 8 on Mac OS X, use "initializationOptions" like:
| 1 | "initializationOptions": { |
| 2 | "cache": { |
| 3 | "directory": "/tmp/ccls" |
| 4 | }, |
| 5 | "clang": { |
| 6 | // make sure you have installed commandLineTools |
| 7 | "resourceDir": "/Library/Developer/CommandLineTools/usr/lib/clang/11.0.0", |
| 8 | "extraArgs": [ |
| 9 | "-isystem", |
| 10 | "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1", |
| 11 | "-I", |
| 12 | "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/" |
| 13 | ] |
| 14 | } |
| 15 | }, |
Using cquery
| 1 | "languageserver": { |
| 2 | "cquery": { |
| 3 | "command": "cquery", |
| 4 | "args": ["--log-file=/tmp/cq.log"], |
| 5 | "filetypes": ["c", "cc", "cpp", "c++"], |
| 6 | "rootPatterns": ["compile_flags.txt", "compile_commands.json", ".git/", ".hg/"], |
| 7 | "initializationOptions": { |
| 8 | "cacheDirectory": "/tmp/cquery" |
| 9 | } |
| 10 | } |
| 11 | } |
C#
Use coc-csharp
| 1 | :CocInstall @tcx4c70/coc-csharp |
CMake
Try coc-cmake (not implemented with LSP) or
Using cmake-language-server
| 1 | "languageserver": { |
| 2 | "cmake": { |
| 3 | "command": "cmake-language-server", |
| 4 | "filetypes": ["cmake"], |
| 5 | "rootPatterns": [ |
| 6 | "build/" |
| 7 | ], |
| 8 | "initializationOptions": { |
| 9 | "buildDirectory": "build" |
| 10 | } |
| 11 | } |
| 12 | } |
Common Lisp
Note: it is currently broken and cannot be installed. See coc-cl issue #7 (the issue is closed, but it was not fixed, and the server is still not installable).
Use coc-cl
| 1 | :CocInstall coc-cl |
Clojure
Use coc-clojure
| 1 | :CocInstall coc-clojure |
Crystal
Using crystalline. Follow the instructions to install it.
| 1 | "languageserver": { |
| 2 | "crystal": { |
| 3 | "command": "crystalline", |
| 4 | "args": [ |
| 5 | "--stdio" |
| 6 | ], |
| 7 | "filetypes": [ |
| 8 | "crystal" |
| 9 | ] |
| 10 | } |
| 11 | } |
Make sure you have crystalline available in your PATH.
CSS/Less/Sass
Using coc-css is recommended.
Dart
One option is to use coc-flutter, which leverages analysis_server from dart-sdk.
Another option is to configure analysis_server yourself. Use the analysis_server from dart-sdk:
| 1 | "languageserver": { |
| 2 | "dart": { |
| 3 | "command": "dart", |
| 4 | "args": [ |
| 5 | "dart", |
| 6 | "language-server", |
| 7 | "--lsp", |
| 8 | "--client-id", |
| 9 | "vim", |
| 10 | "--client-version", |
| 11 | "coc.nvim", |
| 12 | ], |
| 13 | "filetypes": ["dart"], |
| 14 | "trace.server": "verbose" |
| 15 | }, |
| 16 | } |
Or use natebosch/dart_language_server
| 1 | "languageserver": { |
| 2 | "dart": { |
| 3 | "command": "dart_language_server", // on Windows, use dart_language_server.bat |
| 4 | "args": [], |
| 5 | "filetypes": ["dart"], |
| 6 | "initializationOptions": {}, |
| 7 | "settings": { |
| 8 | "dart": { |
| 9 | "validation": {}, |
| 10 | "completion": {} |
| 11 | } |
| 12 | } |
| 13 | } |
| 14 | } |
D
Use coc-dlang
| 1 | :CocInstall coc-dlang |
Deno
Use coc-deno
| 1 | :CocInstall coc-deno |
Dhall
Using dhall-lsp-server. Follow the instructions to install it.
| 1 | "languageserver": { |
| 2 | "dhall": { |
| 3 | "command": "dhall-lsp-server", |
| 4 | "filetypes": [ |
| 5 | "dhall" |
| 6 | ] |
| 7 | } |
| 8 | } |
Dockerfile
Using rcjsuen/dockerfile-language-server-nodejs
| 1 | "languageserver": { |
| 2 | "dockerfile": { |
| 3 | "command": "docker-langserver", |
| 4 | "filetypes": ["dockerfile"], |
| 5 | "args": ["--stdio"] |
| 6 | } |
| 7 | } |
Docker Compose
Using microsoft/compose-language-service
First, set the filetype of docker-compose.yml and compose.yml to yaml.docker-compose in vimrc or init.vim. Also set g:coc_filetype_map to map yaml.docker-compose to dockercompose.
Set the .vimrc or init.vim:
| 1 | au FileType yaml if bufname("%") =~# "docker-compose.yml" | set ft=yaml.docker-compose | endif |
| 2 | au FileType yaml if bufname("%") =~# "compose.yml" | set ft=yaml.docker-compose | endif |
| 3 | |
| 4 | let g:coc_filetype_map = { |
| 5 | \ 'yaml.docker-compose': 'dockercompose', |
| 6 | \ } |
Installing a Language Server:
| 1 | npm i -g @microsoft/compose-language-service |
Set the coc-settings.json:
| 1 | { |
| 2 | "languageserver": { |
| 3 | "dockercompose": { |
| 4 | "command": "docker-compose-langserver", |
| 5 | "args": ["--stdio"], |
| 6 | "filetypes": ["dockercompose"], |
| 7 | "rootPatterns": [".git", ".env", "docker-compose.yml", "compose.yml"] |
| 8 | } |
| 9 | } |
| 10 | } |
Elixir
Using elixir-ls
If you want to use @spec suggestions, you have to enable code lens.
| 1 | "codeLens.enable": true, |
| 2 | "languageserver": { |
| 3 | "elixirLS": { |
| 4 | "command": "/absolute/path/to/elixir-ls/release/language_server.sh", |
| 5 | "filetypes": ["elixir", "eelixir"] |
| 6 | } |
| 7 | } |
Elvish
Using the builtin language server
| 1 | { |
| 2 | "languageserver": { |
| 3 | "elvish": { |
| 4 | "command": "elvish", |
| 5 | "args": ["-lsp"], |
| 6 | "filetypes": ["elvish"] |
| 7 | } |
| 8 | } |
| 9 | } |
Erlang
Using Erlang Language Platform (ELP)
Assuming elp is in the execution path.
| 1 | "languageserver": { |
| 2 | "elp": { |
| 3 | "command": "elp", |
| 4 | "args": ["server"], |
| 5 | "filetypes": ["erlang"] |
| 6 | } |
| 7 | } |
Using erlang_ls
Note: erlang_ls is archived and should not be used.
Assuming erlang_ls is in the execution path.
| 1 | "languageserver": { |
| 2 | "erlang": { |
| 3 | "command": "erlang_ls", |
| 4 | "filetypes": ["erlang"] |
| 5 | } |
| 6 | } |
Elm
Using elm-tooling/elm-language-server
| 1 | "languageserver": { |
| 2 | "elmLS": { |
| 3 | "command": "elm-language-server", |
| 4 | "filetypes": ["elm"], |
| 5 | "rootPatterns": ["elm.json"], |
| 6 | "initializationOptions": { |
| 7 | "elmPath": "elm", // optional |
| 8 | "elmFormatPath": "elm-format", // optional |
| 9 | "elmTestPath": "elm-test", // optional |
| 10 | "elmAnalyseTrigger": "change" // optional |
| 11 | } |
| 12 | } |
| 13 | } |
elm-language-server needs elm, elm-format, and elm-test.
- If a path like
elmPathis defined, it'll be used. - If a path is missing,
elm-language-serverwill try to load it from a local npm installation folder. Otherwise a global installation provided viaPATHis used. elmAnalyseTrigger:elm-analyse(linting) is executed on 'change', 'save', or 'never' (default: 'change').
Check out the GitHub page for more information.
Flow
Using flow-language-server (Note: project no longer maintained)
| 1 | // disable tsserver for JavaScript |
| 2 | "tsserver.enableJavascript": false, |
| 3 | "languageserver": { |
| 4 | "flow": { |
| 5 | "command": "flow-language-server", |
| 6 | "args": ["--stdio"], |
| 7 | "filetypes": ["javascript", "javascriptreact"], |
| 8 | "rootPatterns": [".flowconfig"] |
| 9 | }, |
| 10 | } |
Using flow lsp
| 1 | "languageserver": { |
| 2 | "flow": { |
| 3 | "command": "flow", |
| 4 | "args": ["lsp"], |
| 5 | "filetypes": ["javascript", "javascriptreact"], |
| 6 | "initializationOptions": {}, |
| 7 | "requireRootPattern": true, |
| 8 | "settings": {}, |
| 9 | "rootPatterns": [".flowconfig"] |
| 10 | } |
| 11 | }, |
Fortran
Using fortran-language-server
Make sure the fortls executable is available on your $PATH.
| 1 | "languageserver": { |
| 2 | "fortran": { |
| 3 | "command": "fortls", |
| 4 | "filetypes": ["fortran"], |
| 5 | "rootPatterns": [".fortls", ".git/"] |
| 6 | } |
| 7 | } |
FSharp
Install FsAutoComplete
dotnet tool install --global fsautocomplete
Associate F# file extensions with fsharp:
autocmd BufNewFile,BufRead *.fs,*.fsx,*.fsi set filetype=fsharp
| 1 | "languageserver": { |
| 2 | "fsharp": { |
| 3 | "command": "fsautocomplete", |
| 4 | "args": [], |
| 5 | "filetypes": ["fsharp"], |
| 6 | "trace.server": "verbose", |
| 7 | "initializationOptions": { |
| 8 | "AutomaticWorkspaceInit": true |
| 9 | }, |
| 10 | "settings": { |
| 11 | "FSharp.keywordsAutocomplete": true, |
| 12 | "FSharp.ExternalAutocomplete": false, |
| 13 | "FSharp.Linter": true, |
| 14 | "FSharp.UnionCaseStubGeneration": true, |
| 15 | "FSharp.UnionCaseStubGenerationBody": "failwith \"Not Implemented\"", |
| 16 | "FSharp.RecordStubGeneration": true, |
| 17 | "FSharp.RecordStubGenerationBody": "failwith \"Not Implemented\"", |
| 18 | "FSharp.InterfaceStubGeneration": true, |
| 19 | "FSharp.InterfaceStubGenerationObjectIdentifier": "this", |
| 20 | "FSharp.InterfaceStubGenerationMethodBody": "failwith \"Not Implemented\"", |
| 21 | "FSharp.UnusedOpensAnalyzer": true, |
| 22 | "FSharp.UnusedDeclarationsAnalyzer": true, |
| 23 | "FSharp.UseSdkScripts": true, |
| 24 | "FSharp.SimplifyNameAnalyzer": false, |
| 25 | "FSharp.ResolveNamespaces": true, |
| 26 | "FSharp.EnableReferenceCodeLens": true |
| 27 | } |
| 28 | } |
| 29 | } |
Gleam
Using the builtin language server
| 1 | { |
| 2 | "languageserver": { |
| 3 | "gleam": { |
| 4 | "command": "gleam", |
| 5 | "args": ["lsp"], |
| 6 | "filetypes": ["gleam"] |
| 7 | } |
| 8 | } |
| 9 | } |
Make sure the gleam binary is available in your system's PATH. If it’s not, replace "command": "gleam" with the full path to the binary:
| 1 | { |
| 2 | "languageserver": { |
| 3 | "gleam": { |
| 4 | "command": "full/path/to/gleam", |
| 5 | "args": ["lsp"], |
| 6 | "filetypes": ["gleam"] |
| 7 | } |
| 8 | } |
| 9 | } |
Note: If the gleam binary is not in your PATH, the language server will not work unless you provide the full path.
GLSL
Using glsl_analyzer
| 1 | "languageserver": { |
| 2 | "glsl": { |
| 3 | "command": "glsl_analyzer", |
| 4 | "filetypes": ["glsl", "vert", "tecs", "tese", "frag", "geom", "comp"] |
| 5 | } |
| 6 | } |
Go
Via coc-go or
Using gopls
| 1 | "languageserver": { |
| 2 | "gopls": { |
| 3 | "command": "gopls", |
| 4 | "args": ["serve"], |
| 5 | "rootPatterns": ["go.mod"], |
| 6 | "filetypes": ["go", "gomod", "gowork"], |
| 7 | "settings": { |
| 8 | "gopls": { |
| 9 | "semanticTokens": true, |
| 10 | "semanticTokenTypes": { |
| 11 | // Vim's syntax highlighting is more colorful |
| 12 | "string": false |
| 13 | }, |
| 14 | "hints": { |
| 15 | "assignVariableTypes": true, |
| 16 | "compositeLiteralFields": true, |
| 17 | "compositeLiteralTypes": true, |
| 18 | "constantValues": true, |
| 19 | "functionTypeParameters": true, |
| 20 | "ignoredError": true, |
| 21 | "parameterNames": true, |
| 22 | "rangeVariableTypes": true |
| 23 | } |
| 24 | } |
| 25 | } |
| 26 | } |
| 27 | } |
For settings.gopls, refer to Settings
For semanticTokenTypes, refer to Semantic Tokens
For hints, refer to Inlay hints
To start a debug server that will allow you to see profiles and memory usage, extend args to:
"args": ["serve", "--debug=localhost:6060"],
Godot
The Godot language server starts when you open Godot. By default, it opens a server on port 6005. To configure the server host and port, go to Editor > Editor Settings > Network > Language Server.
| 1 | "languageserver": { |
| 2 | "godot": { |
| 3 | "host": "127.0.0.1", |
| 4 | "filetypes": ["gd", "gdscript", "gdscript3"], |
| 5 | "port": 6005 |
| 6 | } |
| 7 | } |
GraphQL
Using graphql-language-service-cli
| 1 | "languageserver": { |
| 2 | "graphql": { |
| 3 | "command": "graphql-lsp", |
| 4 | "args": ["server", "-m", "stream"], |
| 5 | // customize filetypes to your needs |
| 6 | "filetypes": ["typescript", "typescriptreact", "graphql"] |
| 7 | } |
| 8 | } |
Groovy
Using Language server for Groovy. Check out the sources, build it, and place groovy-language-server-all.jar in any folder.
| 1 | "languageserver": { |
| 2 | "groovy": { |
| 3 | "command": "java", |
| 4 | "args" : ["-jar", "/path/to/groovy-language-server-all.jar"], |
| 5 | "filetypes": ["groovy"] |
| 6 | } |
| 7 | } |
Haskell
Using Haskell Language Server
| 1 | "languageserver": { |
| 2 | "haskell": { |
| 3 | "command": "haskell-language-server-wrapper", |
| 4 | "args": ["--lsp"], |
| 5 | "rootPatterns": ["*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml"], |
| 6 | "filetypes": ["haskell", "lhaskell"], |
| 7 | // Settings are optional, here are some example values |
| 8 | "settings": { |
| 9 | "haskell": { |
| 10 | "checkParents": "CheckOnSave", |
| 11 | "checkProject": true, |
| 12 | "maxCompletions": 40, |
| 13 | "formattingProvider": "ormolu", |
| 14 | "plugin": { |
| 15 | "stan": { "globalOn": true } |
| 16 | } |
| 17 | } |
| 18 | } |
| 19 | } |
| 20 | } |
- You may also opt to use
ghcupto easily install latestghc,cabalandhlsbinaries to yourPATH. - Check the HLS README for the global cabal configuration to enable documentation on hover.
- Run
haskell-language-server-wrapper generate-default-configto see an example of all configuration and default values.
With this you can avoid building anything from scratch and can start coding Haskell files right away.
Haxe
Install the coc-haxe plugin, then run :CocInstall coc-haxe.
Otherwise, you can use the language server that comes with VS Code or build it manually yourself; see vshaxe/haxe-language-server and then use the following JSON settings.
| 1 | { |
| 2 | "languageserver": { |
| 3 | "haxe": { |
| 4 | "command": "node", |
| 5 | "args": ["<path-to-server.js>"], |
| 6 | "filetypes": ["haxe"], |
| 7 | "trace.server": "verbose", |
| 8 | "initializationOptions": { |
| 9 | "displayArguments": ["build.hxml"] |
| 10 | }, |
| 11 | "settings": { |
| 12 | "haxe.executable": "haxe" |
| 13 | } |
| 14 | } |
| 15 | } |
| 16 | } |
Where <path-to-server.js> can be a server.js you built from source, or one downloaded as part of the Haxe VS Code extension (e.g. ~/.vscode/extensions/nadako.vshaxe-<version>/bin/server.js).
HTML
Using coc-html is recommended.
Java
Using coc-java is recommended.
JavaScript/TypeScript
Using coc-tsserver is recommended. <br/><br/> Or try typescript-go:
| 1 | npm install -g typescript |
| 1 | "languageserver": { |
| 2 | "tsgo": { |
| 3 | "command": "tsc", |
| 4 | "args": ["--lsp", "--stdio"], |
| 5 | "filetypes": ["typescript", "javascript", "typescriptreact", "javascriptreact"], |
| 6 | "settings": { |
| 7 | "typescript.inlayHints.variableTypes.enabled": true, |
| 8 | "javascript.inlayHints.variableTypes.enabled": true, |
| 9 | "typescript.inlayHints.parameterNames.enabled": "all", |
| 10 | "javascript.inlayHints.parameterNames.enabled": "all", |
| 11 | "typescript.inlayHints.parameterTypes.enabled": true, |
| 12 | "javascript.inlayHints.parameterTypes.enabled": true, |
| 13 | "typescript.inlayHints.functionLikeReturnTypes.enabled": true, |
| 14 | "javascript.inlayHints.functionLikeReturnTypes.enabled": true, |
| 15 | "typescript.inlayHints.propertyDeclarationTypes.enabled": true, |
| 16 | "javascript.inlayHints.propertyDeclarationTypes.enabled": true, |
| 17 | "typescript.inlayHints.enumMemberValues.enabled": true, |
| 18 | "javascript.inlayHints.enumMemberValues.enabled": true, |
| 19 | }, |
| 20 | } |
| 21 | } |
For the settings field, refer to vscode/extensions/typescript-language-features/package.json.
JSON
Using coc-json is recommended.
Julia
Using LanguageServer.jl
The LanguageServer, SymbolServer and StaticLint packages must be installed in Julia (1.x), i.e.
| 1 | julia> using Pkg |
| 2 | julia> Pkg.add("LanguageServer") |
| 3 | julia> Pkg.add("SymbolServer") |
| 4 | julia> Pkg.add("StaticLint") |
Install coc-julia, or register the server in coc-settings.json:
| 1 | "languageserver": { |
| 2 | "julia": { |
| 3 | "command": "/usr/bin/julia", |
| 4 | "args" : ["--startup-file=no", "--history-file=no", "-e", |
| 5 | "using LanguageServer;\n using Pkg;\n import StaticLint;\n import SymbolServer;\n env_path = dirname(Pkg.Types.Context().env.project_file);\n server = LanguageServer.LanguageServerInstance(stdin, stdout, env_path, \"\");\n server.runlinter = true;\n run(server);" ], |
| 6 | "filetypes": ["julia"] |
| 7 | } |
| 8 | } |
Check out JuliaEditorSupport/LanguageServer.jl for more information.
If you hit issue #836, install the language server from master to avoid the problem:
| 1 | julia> using Pkg |
| 2 | julia> Pkg.add(url="https://github.com/julia-vscode/LanguageServer.jl") |
| 3 | julia> Pkg.add("SymbolServer") |
| 4 | julia> Pkg.add("StaticLint") |
Kotlin
Using kotlin-language-server
- Download server.zip from the releases page.
- Unzip the file in a convenient directory, for example inside
~/lsp/kotlin/.
| 1 | "languageserver": { |
| 2 | "kotlin": { |
| 3 | "command": "~/lsp/kotlin/server/bin/kotlin-language-server", |
| 4 | "filetypes": ["kotlin"] |
| 5 | } |
| 6 | } |
LaTeX
Using astoff/digestif
Make sure the digestif executable is available on your $PATH, or use an absolute path as the command. Installation instructions can be found here.
| 1 | "languageserver": { |
| 2 | "digestif": { |
| 3 | "command": "digestif", |
| 4 | "filetypes": ["tex", "plaintex", "context"] |
| 5 | } |
| 6 | } |
For Texlab, use coc-texlab or:
| 1 | "languageserver": { |
| 2 | "latex": { |
| 3 | "command": "/PATH/TO/texlab", |
| 4 | "filetypes": ["tex", "bib", "plaintex", "context"] |
| 5 | } |
| 6 | } |
- You may need to add
let g:tex_flavor = "latex"to get the correct buffer filetype; check it with:echo &filetype. - Adjust the path to texlab accordingly, or simply use its command name from
PATH. - For bibTeX integration, use the
biblatexpackage; check the GIF at TexLab preview
Lua
Using Alloyed/lua-lsp
| 1 | "languageserver": { |
| 2 | "lua": { |
| 3 | "command": "lua-lsp", |
| 4 | "filetypes": ["lua"] |
| 5 | } |
| 6 | } |
Using sumneko/lua-language-server. It's a little difficult to use sumneko/lua-language-server directly in coc.nvim; it's recommended to use coc-sumneko-lua, which can download and set it up for Lua. If you want to set up sumneko/lua-language-server in coc-settings.json, follow these steps (tested on macOS; change the path if you're using Windows):
- Install
sumneko.luain VSCode. cd ~/.vscode/extensions/sumneko.lua-2.3.7chmod +x ./server/bin/macOS/lua-language-server. It's unclear why this is needed; in my VSCode extension the server is not executable.- Set it up in your
coc-settings.json:
| 1 | { |
| 2 | "languageserver": { |
| 3 | "lua": { |
| 4 | "command": "~/.vscode/extensions/sumneko.lua-2.3.7/server/bin/macOS/lua-language-server", |
| 5 | "args": ["-E", "~/.vscode/extensions/sumneko.lua-2.3.7/server/main.lua"], |
| 6 | "rootPatterns": [".git"], |
| 7 | "filetypes": ["lua"] |
| 8 | } |
| 9 | } |
| 10 | } |
Using EmmyLua-LanguageServer
Make sure your Java environment variables are set correctly, and change the path in the args field according to your installation.
| 1 | "languageserver": { |
| 2 | "lua": { |
| 3 | "command": "java", |
| 4 | "args": ["-cp", "/your/path/to/EmmyLua-LanguageServer/EmmyLua-LS/build/libs/EmmyLua-LS-all.jar", "com.tang.vscode.MainKt"], |
| 5 | "filetypes": ["lua"], |
| 6 | "rootPatterns": [".git/"] |
| 7 | } |
| 8 | } |
Markdown
Using coc-markdownlint, which has code action support to autofix errors.
| 1 | :CocInstall coc-markdownlint |
Meson
Using mesonlsp
| 1 | "languageserver": { |
| 2 | "meson": { |
| 3 | "command": "mesonlsp", |
| 4 | "rootPatterns": ["meson.build", "meson_options.txt"], |
| 5 | "args": ["--lsp"], |
| 6 | "filetypes": ["meson"] |
| 7 | } |
| 8 | } |
Nim
Using nimlsp. Follow the instructions in the README of the repository. (Make sure your Nimble bin directory is in your PATH.)
| 1 | "languageserver": { |
| 2 | "nim": { |
| 3 | "command": "nimlsp", |
| 4 | "filetypes": ["nim"] |
| 5 | } |
| 6 | } |
Nix
Using nixd
| 1 | "languageserver": { |
| 2 | "nixd": { |
| 3 | "command": "nixd", |
| 4 | "rootPatterns": [".nixd.json"], |
| 5 | "filetypes": ["nix"] |
| 6 | } |
| 7 | } |
Using rnix-lsp
| 1 | "languageserver": { |
| 2 | "nix": { |
| 3 | "command": "rnix-lsp", |
| 4 | "filetypes": ["nix"] |
| 5 | } |
| 6 | } |
OCaml and ReasonML
Using ocaml-language-server
| 1 | "languageserver": { |
| 2 | "ocaml": { |
| 3 | "command": "ocaml-language-server", |
| 4 | "args": ["--stdio"], |
| 5 | "filetypes": ["ocaml", "reason"] |
| 6 | } |
| 7 | } |
If you installed merlin with opam:
| 1 | "languageserver": { |
| 2 | "ocaml": { |
| 3 | "command": "opam", |
| 4 | "args": ["config", "exec", "--", "ocaml-language-server", "--stdio"], |
| 5 | "filetypes": ["ocaml", "reason"] |
| 6 | } |
| 7 | } |
Using ocaml-lsp and opam
| 1 | "languageserver": { |
| 2 | "ocaml-lsp": { |
| 3 | "command": "opam", |
| 4 | "args": ["config", "exec", "--", "ocamllsp"], |
| 5 | "filetypes": ["ocaml", "reason"] |
| 6 | } |
| 7 | } |
Using ocaml-lsp and dune
| 1 | "languageserver": { |
| 2 | "ocaml-lsp": { |
| 3 | "command": "dune", |
| 4 | "args": ["tools", "exec", "ocamllsp", "--"], |
| 5 | "filetypes": ["ocaml", "reason"] |
| 6 | } |
| 7 | } |
Using ocaml-lsp and esy
| 1 | "languageserver": { |
| 2 | "ocaml-lsp": { |
| 3 | "command": "esy", |
| 4 | "args": ["sh", "-c", "ocamllsp"], |
| 5 | "filetypes": ["ocaml", "reason"] |
| 6 | } |
| 7 | } |
Using reason-language-server
| 1 | "languageserver": { |
| 2 | "reason": { |
| 3 | "command": "reason-language-server", |
| 4 | "filetypes": ["reason"] |
| 5 | } |
| 6 | } |
Oxc
Using coc-oxc
Or:
Oxlint
| 1 | # For type-aware linting |
| 2 | npm install -g oxlint oxlint-tsgolint |
| 1 | "languageserver": { |
| 2 | "oxlint": { |
| 3 | "command": "oxlint", |
| 4 | "args": ["--lsp"], |
| 5 | "filetypes": ["typescript", "javascript", "vue", "typescriptreact", "javascriptreact"], |
| 6 | "settings": { |
| 7 | "oxc_language_server": { |
| 8 | "unusedDisableDirectives": "warn", |
| 9 | "typeAware": true, |
| 10 | "rulesCustomization": { |
| 11 | "unicorn/no-empty-file": { "severity": "off" } |
| 12 | } |
| 13 | } |
| 14 | } |
| 15 | } |
| 16 | } |
For the oxc_language_server field, refer to oxc_language_server#workspace-options
Oxfmt
Currently in beta.
| 1 | npm install -g oxfmt |
| 1 | "languageserver": { |
| 2 | "oxfmt": { |
| 3 | "command": "oxfmt", |
| 4 | "args": ["--lsp"], |
| 5 | "formatterPriority": 1000, |
| 6 | "filetypes": [ |
| 7 | "typescript", |
| 8 | "javascript", |
| 9 | "vue", |
| 10 | "typescriptreact", |
| 11 | "javascriptreact", |
| 12 | "json", |
| 13 | "jsonc" |
| 14 | ], |
| 15 | "settings": { |
| 16 | "oxc_language_server": {} |
| 17 | } |
| 18 | } |
| 19 | } |
For the oxc_language_server field, refer to oxc_language_server#workspace-options
Perl
Using coc-perl is recommended.
PHP
Try marlonfan/coc-phpls or one of the following methods:
Using:
Recommended (much faster than php-language-server)
| 1 | "languageserver": { |
| 2 | "intelephense": { |
| 3 | "command": "intelephense", |
| 4 | "args": ["--stdio"], |
| 5 | "filetypes": ["php"], |
| 6 | "initializationOptions": { |
| 7 | "licenceKey": "<YOUR_LICENSE_KEY>", |
| 8 | "storagePath": "/tmp/intelephense" |
| 9 | } |
| 10 | } |
| 11 | } |
Using felixfbecker/php-language-server
| 1 | "languageserver": { |
| 2 | "phplang": { |
| 3 | "command": "php", |
| 4 | "args": ["/path/to/vendor/felixfbecker/language-server/bin/php-language-server.php"], |
| 5 | "filetypes": ["php"] |
| 6 | } |
| 7 | } |
Note: make sure you can start the server with the given command and args.
Via coc-psalm or
Using vimeo/psalm (psalm-language-server)
| 1 | "languageserver": { |
| 2 | "psalmls": { |
| 3 | "command": "vendor/bin/psalm-language-server", |
| 4 | "filetypes": ["php"], |
| 5 | "rootPatterns": ["psalm.xml", "psalm.xml.dist"], |
| 6 | "requireRootPattern": true |
| 7 | } |
| 8 | } |
PureScript
Using purescript-language-server (Configuration)
| 1 | "languageserver": { |
| 2 | "purescript": { |
| 3 | "command": "purescript-language-server", |
| 4 | "args": ["--stdio"], |
| 5 | "filetypes": ["purescript"], |
| 6 | "rootPatterns": ["bower.json", "psc-package.json", "spago.dhall"] |
| 7 | } |
| 8 | } |
Python
Use one of the following:
- coc-pyright for Pyright
- coc-basedpyright for BasedPyright
- coc-pylsp for python-lsp-server
- coc-jedi for jedi-language-server
- coc-ruff for ruff-lsp
Or use pyrefly:
| 1 | "languageserver": { |
| 2 | "pyrefly": { |
| 3 | "command": "pyrefly", |
| 4 | "args": ["lsp"], |
| 5 | "filetypes": ["python"], |
| 6 | "rootPatterns": ["pyrefly.toml", "pyproject.toml", ".git"], |
| 7 | } |
| 8 | }, |
R
First, install the languageserver package in R:
| 1 | install.packages("languageserver") |
Use the coc-r-lsp extension.
If coc-r-lsp does not work properly, add the following languageserver object to your configuration file (per the instructions from REditorSupport/languageserver):
| 1 | "languageserver": { |
| 2 | "R": { |
| 3 | "enable": true, |
| 4 | "command": "/usr/bin/R", |
| 5 | "args": [ |
| 6 | "--slave", |
| 7 | "-e", |
| 8 | "languageserver::run()" |
| 9 | ], |
| 10 | "filetypes": [ |
| 11 | "r" |
| 12 | ] |
| 13 | } |
| 14 | } |
Robot Framework
- Install robotframework-lsp.
- Configure Robot filetype detection in your neovim configuration file with
autocmd BufNewFile,BufRead *.robot setlocal filetype=robot.
| 1 | "languageserver": { |
| 2 | "robotframework_ls": { |
| 3 | "command": "robotframework_ls", |
| 4 | "filetypes": ["robot"], |
| 5 | "settings": { |
| 6 | // here goes the LS configuration |
| 7 | } |
| 8 | } |
| 9 | } |
Racket
Using the racket-langserver
- Install racket-langserver with
raco pkg install racket-langserver. - Add the snippet below to your coc config:
| 1 | "languageserver": { |
| 2 | "racket": { |
| 3 | "command": "racket", |
| 4 | "args": [ |
| 5 | "-l", |
| 6 | "racket-langserver" |
| 7 | ], |
| 8 | "filetypes": [ |
| 9 | "scheme", "rkt" |
| 10 | ] |
| 11 | } |
| 12 | } |
Rome
| 1 | "languageserver": { |
| 2 | "rome-lsp": { |
| 3 | "command": "rome", |
| 4 | "args": ["lsp"], |
| 5 | "filetypes": [ |
| 6 | "javascript", |
| 7 | "javascriptreact", |
| 8 | "typescript", |
| 9 | "typescriptreact", |
| 10 | "json" |
| 11 | ], |
| 12 | "rootPatterns": [".config"], |
| 13 | "requireRootPattern": true |
| 14 | } |
| 15 | } |
Ruby
Using coc-solargraph
Make sure solargraph is in your $PATH (e.g. sudo gem install solargraph), or use solargraph.commandPath to configure solargraph's executable path.
Using RuboCop:
| 1 | "languageserver": { |
| 2 | "rubocop": { |
| 3 | "command": "rubocop", |
| 4 | "args": ["--lsp"], |
| 5 | "filetypes": ["ruby"] |
| 6 | } |
| 7 | } |
Using Sorbet:
| 1 | "languageserver": { |
| 2 | "sorbet": { |
| 3 | "command": "srb", |
| 4 | "args": ["tc", "--typed", "true", "--enable-all-experimental-lsp-features", "--lsp", "--disable-watchman"], |
| 5 | "filetypes": ["ruby"], |
| 6 | "rootPatterns": ["sorbet/config"], |
| 7 | "initializationOptions": {}, |
| 8 | "settings": {} |
| 9 | } |
| 10 | } |
Using Steep:
| 1 | "languageserver": { |
| 2 | "steep": { |
| 3 | "command": "steep", |
| 4 | "args" : ["langserver"], |
| 5 | "filetypes": ["ruby"] |
| 6 | } |
| 7 | } |
Using TypeProf:
| 1 | "languageserver": { |
| 2 | "typeprof": { |
| 3 | "command": "typeprof", |
| 4 | "args": ["--lsp", "--stdio"], |
| 5 | "filetypes": ["ruby"] |
| 6 | } |
| 7 | } |
Using Shopify/ruby-lsp:
| 1 | "languageserver": { |
| 2 | "ruby-lsp": { |
| 3 | "command": "ruby-lsp", |
| 4 | "initializationOptions": { |
| 5 | "enabledFeatures": { |
| 6 | "codeActions": true, |
| 7 | "codeLens": true, |
| 8 | "completion": true, |
| 9 | "definition": true, |
| 10 | "diagnostics": true, |
| 11 | "documentHighlights": true, |
| 12 | "documentLink": true, |
| 13 | "documentSymbols": true, |
| 14 | "foldingRanges": true, |
| 15 | "formatting": true, |
| 16 | "hover": true, |
| 17 | "inlayHint": true, |
| 18 | "onTypeFormatting": true, |
| 19 | "selectionRanges": true, |
| 20 | "semanticHighlighting": true, |
| 21 | "signatureHelp": true, |
| 22 | "typeHierarchy": true, |
| 23 | "workspaceSymbol": true |
| 24 | }, |
| 25 | "featuresConfiguration": { |
| 26 | "inlayHint": { |
| 27 | "implicitHashValue": true, |
| 28 | "implicitRescue": true |
| 29 | } |
| 30 | }, |
| 31 | "indexing": { |
| 32 | "excludedPatterns": ["path/to/excluded/file.rb"], |
| 33 | "includedPatterns": ["path/to/included/file.rb"], |
| 34 | "excludedGems": ["gem1", "gem2", "etc."], |
| 35 | "excludedMagicComments": ["compiled:true"] |
| 36 | }, |
| 37 | "formatter": "auto", |
| 38 | "linters": [], |
| 39 | "experimentalFeaturesEnabled": false |
| 40 | }, |
| 41 | "filetypes": ["ruby"], |
| 42 | } |
| 43 | } |
Rust
- install coc-rust-analyzer which uses
rust-analyzer - or install coc-rls which uses
rls - or try rust-analyzer without an extension:
| 1 | "languageserver": { |
| 2 | "rust": { |
| 3 | "command": "rust-analyzer", |
| 4 | "filetypes": ["rust"], |
| 5 | "rootPatterns": ["Cargo.toml"] |
| 6 | } |
| 7 | } |
It's necessary to run rustup component add rust-src and build rust-analyzer from source; follow the rust-analyzer User Manual.
For coc-rls, don't add the configuration above in coc-settings.json; just run rustup component add rls rust-analysis rust-src.
SQL
Using sql-language-server
| 1 | "languageserver": { |
| 2 | "sql": { |
| 3 | "module": "/path/to/node_modules/sql-language-server/dist/bin/cli.js", |
| 4 | "args": ["up", "--method", "node-ipc"], |
| 5 | "filetypes": ["sql", "mysql"] |
| 6 | } |
| 7 | } |
The stdio option is broken by its console.log.
Scala
Using scalameta/metals:
Install coc-metals, which automates the Metals installation and provides extra helpers.
If you'd like to use Metals without the coc-metals extension, make sure the generated metals-vim binary is available on your $PATH, and follow the instructions on the Metals website.
| 1 | "languageserver": { |
| 2 | "metals": { |
| 3 | "command": "metals-vim", |
| 4 | "rootPatterns": ["build.sbt"], |
| 5 | "filetypes": ["scala", "sbt"] |
| 6 | } |
| 7 | } |
Note that the Dotty Language Server is no longer recommended; use Metals for Dotty/Scala 3 instead.
Swift
sourcekit-lsp is shipped with the Swift toolchain. If you have a working Swift installation, you will already have this installed. It is also bundled with Xcode.
| 1 | "languageserver": { |
| 2 | "swift": { |
| 3 | "command": "sourcekit-lsp", |
| 4 | "filetypes": ["swift"], |
| 5 | "rootPatterns": ["Package.swift"] |
| 6 | } |
| 7 | } |
Shader Slang
Using slangd
| 1 | "languageserver": { |
| 2 | "shaderslang": { |
| 3 | "command": "slangd", |
| 4 | "filetypes": ["shaderslang"], |
| 5 | "rootPatterns": [".git/"] |
| 6 | } |
| 7 | } |
Solidity
- Install coc-solidity.
- Or install @nomicfoundation/coc-solidity.
- or try the LSP of the native binary
solcwithout an extension:
| 1 | "languageserver": { |
| 2 | "solidity": { |
| 3 | "command": "/path/to/solc", |
| 4 | "args": [ "--lsp" ], |
| 5 | "rootPatterns": [".git/"], |
| 6 | "filetypes": ["solidity"] |
| 7 | } |
| 8 | } |
- Or try the language server from the vscode-solidity plugin. Install it with
npm install -g @juanfranblanco/vscode-solidity-server, then configure coc:
| 1 | "languageserver": { |
| 2 | "solidity": { |
| 3 | "command": "vscode-solidity-server", |
| 4 | "args": [ "--stdio" ], |
| 5 | "rootPatterns": [".git/"], |
| 6 | "filetypes": ["solidity"] |
| 7 | } |
| 8 | } |
SystemVerilog
Using svlangserver.
For installation, check this section in the readme.
Example settings file:
| 1 | { |
| 2 | "languageserver": { |
| 3 | "svlangserver": { |
| 4 | "module": "/INSTALLATION/PATH/lib/svlangserver.js", |
| 5 | "filetypes": ["systemverilog"], |
| 6 | "settings": { |
| 7 | "systemverilog.includeIndexing": ["**/*.{sv,svh}"], |
| 8 | "systemverilog.excludeIndexing": ["test/**/*.sv*"], |
| 9 | "systemverilog.defines" : [], |
| 10 | "systemverilog.launchConfiguration": "/TOOL/PATH/verilator -sv -Wall --lint-only", |
| 11 | "systemverilog.formatCommand": "/TOOL/PATH/verible-verilog-format" |
| 12 | } |
| 13 | } |
| 14 | } |
| 15 | } |
Systemd
Using systemd-language-server.
Installation: pip install systemd-language-server
Settings file:
| 1 | { |
| 2 | "languageserver": { |
| 3 | "systemd-language-server": { |
| 4 | "command": "systemd-language-server", |
| 5 | "filetypes": ["systemd"] |
| 6 | } |
| 7 | } |
| 8 | } |
tailwindcss
Using tailwindcss-language-server.
| 1 | "languageserver": { |
| 2 | "tailwindcss": { |
| 3 | "command": "tailwindcss-language-server", |
| 4 | "filetypes": ["html", "jsx", "tsx"], |
| 5 | "rootPatterns": ["tailwind.config.*"] |
| 6 | } |
| 7 | } |
Terraform
Using Terraform-LSP. Build it and place it in any folder.
| 1 | "languageserver": { |
| 2 | "terraform": { |
| 3 | "command": "terraform-lsp", |
| 4 | "filetypes": ["terraform"], |
| 5 | "initializationOptions": {} |
| 6 | } |
| 7 | } |
Using terraform-ls.
| 1 | "languageserver": { |
| 2 | "terraform": { |
| 3 | "command": "terraform-ls", |
| 4 | "args": ["serve"], |
| 5 | "filetypes": ["terraform", "tf"], |
| 6 | "initializationOptions": {} |
| 7 | } |
| 8 | } |
Typst
Using typst-lsp.
| 1 | "languageserver": { |
| 2 | "typst": { |
| 3 | "command": "typst-lsp", |
| 4 | "filetypes": ["typst"] |
| 5 | } |
| 6 | } |
UnoCSS
Using unocss-language-server
| 1 | npm install -g @unocss/language-server |
| 1 | "languageserver": { |
| 2 | "unocss": { |
| 3 | "command": "unocss-language-server", |
| 4 | "args": ["--stdio"], |
| 5 | "filetypes": ["vue"], |
| 6 | "rootPatterns": ["uno.config.ts"], |
| 7 | "settings": { |
| 8 | "unocss.autocomplete.maxItems": 100 |
| 9 | } |
| 10 | }, |
| 11 | } |
For the filetypes field, refer to UnoCSS filetype definitions
For the settings field, refer to UnoCSS settings reference
V
Using vls. Run v ls --install to install it.
| 1 | "languageserver": { |
| 2 | "vlang": { |
| 3 | "command": "v", |
| 4 | "args": ["ls"], |
| 5 | "rootPatterns": ["v.mod", ".git"], |
| 6 | "filetypes": ["v", "vlang"], |
| 7 | } |
| 8 | } |
Vala
Using vala-language-server
| 1 | "languageserver": { |
| 2 | "vala": { |
| 3 | "command": "vala-language-server", |
| 4 | "filetypes": ["vala"], |
| 5 | } |
| 6 | } |
Vue
Using coc-vetur
| 1 | :CocInstall coc-vetur |
WebAssembly
Using WebAssembly Language Tools.
| 1 | "languageserver": { |
| 2 | "wasm-language-tools": { |
| 3 | "command": "wat_server", |
| 4 | "filetypes": ["wat"] |
| 5 | } |
| 6 | } |
YANG
Using yang-lsp
Make sure yang-language-server is available in your PATH; otherwise, specify the full path to the executable.
| 1 | "languageserver": { |
| 2 | "yls": { |
| 3 | "command": "yang-language-server", |
| 4 | "filetypes": ["yang"], |
| 5 | "rootPatterns": ["yang.settings", ".git/"], |
| 6 | } |
| 7 | } |
Zig
Using coc-zig
| 1 | :CocInstall coc-zig |
Using zls
Make sure zls is available in your PATH; otherwise, specify the full path to the zls executable.
| 1 | { |
| 2 | "languageserver": { |
| 3 | "zig": { |
| 4 | "command": "zls", |
| 5 | "filetypes": [ |
| 6 | "zig" |
| 7 | ] |
| 8 | } |
| 9 | } |
| 10 | } |
vim/erb/markdown
Using efm-langserver
The default location of efm-langserver's config.yaml is:
- UNIX:
$HOME/.config/efm-langserver/config.yaml - Windows:
%APPDATA%\efm-langserver\config.yaml
efm-langserver config:
| 1 | languages: |
| 2 | eruby: |
| 3 | lint-command: 'erb -x -T - | ruby -c' |
| 4 | lint-stdin: true |
| 5 | lint-offset: 1 |
| 6 | format-command: 'htmlbeautifier' |
| 7 | |
| 8 | vim: |
| 9 | lint-command: 'vint -' |
| 10 | lint-stdin: true |
| 11 | |
| 12 | markdown: |
| 13 | lint-command: 'markdownlint -s' |
| 14 | lint-stdin: true |
| 15 | lint-formats: |
| 16 | - '%f:%l %m' |
| 17 | - '%f:%l:%c %m' |
| 18 | - '%f: %l: %m' |
coc-settings.json:
| 1 | "languageserver": { |
| 2 | "efm": { |
| 3 | "command": "efm-langserver", |
| 4 | "args": [], |
| 5 | // custom config path |
| 6 | // "args": ["-c", "/path/to/your/config.yaml"], |
| 7 | "filetypes": ["vim", "eruby", "markdown"] |
| 8 | } |
| 9 | } |