Skip to content
Yegappan Lakshmanan edited this page Apr 29, 2023 · 37 revisions

Language Server Specific Configuration

Bash Language Server

Language: Bash shell scripts

Home Page: https://github.com/bash-lsp/bash-language-server

Sample code to add the bash language server to the LSP plugin:

" Bash
call LspAddServer([#{name: 'bashls',
                 \   filetype: 'sh',
                 \   path: '/usr/local/bin/bash-language-server',
                 \   args: ['start']
                 \ }])

Clangd

Language: C/C++

Home Page: https://clangd.llvm.org/

Sample code to add the clangd language server to the LSP plugin:

call LspAddServer([#{name: 'clangd',
                 \   filetype: ['c', 'cpp'],
                 \   path: '/usr/local/bin/clangd',
                 \   args: ['--background-index', '--clang-tidy']
                 \ }])

CSS Language Server

Language: CSS

Home Page: https://github.com/vscode-langservers/vscode-css-languageserver-bin

Sample code to add the CSS language server to the LSP plugin:

call LspAddServer([#{name: 'cssls',
                 \   filetype: 'css',
                 \   path: '/usr/local/node_modules/.bin/css-languageserver',
                 \   args: ['--stdio'],
                 \ }])

Note: The CSS language server supports code completion only if the snippetSupport option is enabled.

Deno

Language: Typescript/Javascript

Home Page: https://deno.land

Sample code to add the deno language server to the LSP plugin:

call LspAddServer([#{name: 'deno',
                 \   filetype: ['javascript', 'typescript'],
                 \   path: '/usr/local/bin/deno',
                 \   args: ['lsp'],
                 \   debug: v:true,
                 \   initializationOptions: #{
                 \        enable: v:true,
                 \        lint: v:true
                 \   }
                 \ }])

Eclipse JDT Language Server

Language: Java

Home Page: https://github.com/eclipse/eclipse.jdt.ls

Sample code to add the jdtls language server to the LSP plugin:

call LspAddServer([#{name: 'jdtls',
                 \   filetype: 'java',
                 \   path: '/usr/local/jdtls/bin/jdtls',
                 \   args: []
                 \ }])

Fortran Language Server

Language: Fortran

Home Page: https://github.com/hansec/fortran-language-server

Sample code to add the fortran language server to the LSP plugin:

call LspAddServer([#{name: 'fortls',
                 \   filetype: 'fortran',
                 \   path: '/usr/local/bin/fortls',
                 \   args: ['--use_signature_help', '--hover_signature']
                 \ }])

Gopls

Language: Go

Home Page: https://github.com/golang/tools/tree/master/gopls

Sample code to add the gopls language server to the LSP plugin:

call LspAddServer([#{name: 'gopls',
                 \   filetype: 'go',
                 \   path: '/usr/local/bin/gopls',
                 \   args: ['serve']
                 \ }])

HTML Language Server

Language: html

Home Page: https://github.com/vscode-langservers/vscode-html-languageserver-bin

Sample code to add the HTML language server to the LSP plugin:

call LspAddServer([#{name: 'htmlls',
                 \   filetype: 'html',
                 \   path: '/usr/local/node_modules/.bin/html-languageserver',
                 \   args: ['--stdio'],
                 \ }])

Note: The HTML language server supports code completion only if the snippetSupport option is enabled.

Lua Language Server

Language: Lua

Home Page: https://github.com/LuaLS/lua-language-server

Sample code to add the luals language server to the LSP plugin:

call LspAddServer([#{name: 'luals',
                 \   filetype: 'lua',
                 \   path: '/usr/local/luals/bin/lua-language-server',
                 \   args: [],
                 \   debug: v:true
                 \ }])

Perl Navigator

Language: Perl

Home Page: https://github.com/bscan/PerlNavigator

Sample code to add the Perl Navigator language server to the LSP plugin:

call LspAddServer([#{name: 'perlnavigator',
                 \   filetype: ['perl'],
                 \   path: '/usr/bin/node',
                 \   args: ['/usr/local/PerlNavigator/server/out/server.js', '--stdio']
                 \ }])

PHP Intelephense

Language: PHP

Home Page: https://github.com/bmewburn/vscode-intelephense

Sample code to add the intelephense language server to the LSP plugin:

call LspAddServer([#{name: 'intelephense',
                 \   filetype: ['php'],
                 \   path: '/usr/local/bin/intelephense',
                 \   args: ['--stdio']
                 \ }])

Pylsp

Language: Python

Home Page: https://github.com/python-lsp/python-lsp-server

Sample code to add the pylsp language server to the LSP plugin:

call LspAddServer([#{name: 'pylsp',
                 \   filetype: 'python',
                 \   path: '/usr/local/bin/pylsp',
                 \   args: []
                 \ }])

Pyright

Language: Python

Home Page: https://github.com/microsoft/pyright

Sample code to add the pyright language server to the LSP plugin:

call LspAddServer([#{name: 'pyright',
                 \   filetype: 'python',
                 \   path: '/usr/local/node_modules/.bin/pyright-langserver',
                 \   args: ['--stdio'],
                 \   workspaceConfig: #{
                 \     python: #{
                 \       pythonPath: '/usr/bin/python3.10'
                 \   }}
                 \ }])

Command to install the pyright language server on Linux:

   $ npm install -g pyright

Rust-analyzer

Language: Rust

Home Page: https://rust-analyzer.github.io/

Sample code to add the rust-analyzer language server to the LSP plugin:

call LspAddServer([#{name: 'rustanalyzer',
                 \   filetype: ['rust'],
                 \   path: '/usr/local/bin/rust-analyzer-x86_64-unknown-linux-gnu',
                 \   args: [],
                 \   syncInit: v:true
                 \ }])

Solargraph

Language: Ruby

Home Page: https://solargraph.org/

Sample code to add the Solargraph language server to the LSP plugin:

call LspAddServer([#{name: 'solargraph'
                 \   filetype: ['ruby'],
                 \   path: 'solargraph',
                 \   args: ['stdio']
                 \ }])

Typescript Language Server

Language: Typescript/JavaScript

Home Page: https://github.com/typescript-language-server/typescript-language-server

Sample code to add the typescript language server to the LSP plugin:

call LspAddServer([#{name: 'tsserver'
                 \   filetype: ['javascript', 'typescript'],
                 \   path: '/usr/local/bin/typescript-language-server',
                 \   args: ['stdio']
                 \ }])

Vimscript

Language: Vimscript

Home Page: https://github.com/iamcco/vim-language-server

Sample code to add the Vimscript language server to the LSP plugin:

call LspAddServer([#{name: 'vimls',
                 \   filetype: 'vim',
                 \   path: '/usr/local/bin/vim-language-server',
                 \   args: ['--stdio']
                 \ }])

Volar Server

Language: Vue

Home Page: https://github.com/vuejs/language-tools

Sample code to add the Volar language server to the LSP plugin:

call LspAddServer([#{name: 'volar-server',
                 \   filetype: ['vue', 'typescript'],
                 \   path: '/usr/local/node_modules/.bin/volar-server',
                 \   args: ['--stdio'],
                 \   initializationOptions: #{
                 \       typescript: #{
                 \           tsdk: '/usr/local/node_modules/typescript/lib'
                 \       }
                 \   }
                 \ }])
Clone this wiki locally