diff --git a/autoload/SpaceVim/layers/lsp.vim b/autoload/SpaceVim/layers/lsp.vim index 6619169a3..1dd4bc0ea 100644 --- a/autoload/SpaceVim/layers/lsp.vim +++ b/autoload/SpaceVim/layers/lsp.vim @@ -62,8 +62,25 @@ endfunction function! SpaceVim#layers#lsp#plugins() abort let plugins = [] - - if s:use_nvim_lsp + if has('nvim-0.8.0') + call add(plugins, [g:_spacevim_root_dir . 'bundle/nvim-lspconfig-0.1.4', {'merged' : 0, 'loadconf' : 1}]) + if g:spacevim_autocomplete_method ==# 'deoplete' + call add(plugins, [g:_spacevim_root_dir . 'bundle/deoplete-lsp', {'merged' : 0}]) + elseif g:spacevim_autocomplete_method ==# 'nvim-cmp' + call add(plugins, [g:_spacevim_root_dir . 'bundle/cmp-nvim-lsp', { + \ 'merged' : 0, + \ }]) + endif + elseif has('nvim-0.7.0') + call add(plugins, [g:_spacevim_root_dir . 'bundle/nvim-lspconfig-0.1.3', {'merged' : 0, 'loadconf' : 1}]) + if g:spacevim_autocomplete_method ==# 'deoplete' + call add(plugins, [g:_spacevim_root_dir . 'bundle/deoplete-lsp', {'merged' : 0}]) + elseif g:spacevim_autocomplete_method ==# 'nvim-cmp' + call add(plugins, [g:_spacevim_root_dir . 'bundle/cmp-nvim-lsp', { + \ 'merged' : 0, + \ }]) + endif + elseif s:use_nvim_lsp call add(plugins, [g:_spacevim_root_dir . 'bundle/nvim-lspconfig', {'merged' : 0, 'loadconf' : 1}]) if g:spacevim_autocomplete_method ==# 'deoplete' call add(plugins, [g:_spacevim_root_dir . 'bundle/deoplete-lsp', {'merged' : 0}]) @@ -90,7 +107,7 @@ endfunction function! SpaceVim#layers#lsp#config() abort if s:use_nvim_lsp - " nvim-lspconfig is used, do not check enabled_fts + " nvim-lspconfig is used, do not check enabled_fts else for ft in s:enabled_fts call SpaceVim#lsp#reg_server(ft, s:lsp_servers[ft]) @@ -253,6 +270,7 @@ function! SpaceVim#layers#lsp#check_filetype(ft) abort return 1 else return index(s:enabled_fts, a:ft) != -1 + endif endfunction function! SpaceVim#layers#lsp#check_server(server) abort diff --git a/autoload/SpaceVim/plugins.vim b/autoload/SpaceVim/plugins.vim index 55d74772b..3c6279560 100644 --- a/autoload/SpaceVim/plugins.vim +++ b/autoload/SpaceVim/plugins.vim @@ -209,13 +209,26 @@ function! SpaceVim#plugins#defind_hooks(bundle) abort call SpaceVim#util#loadConfig('plugins/' . split(a:bundle['name'],'\.')[0] . '.vim') endf elseif g:spacevim_plugin_manager ==# 'dein' + " call SpaceVim#logger#debug('plugin name is ' . g:dein#name) call dein#config(g:dein#name, { - \ 'hook_source' : "call SpaceVim#util#loadConfig('plugins/" . split(g:dein#name,'\.')[0] . ".vim')" + \ 'hook_source' : "call SpaceVim#util#loadConfig('plugins/" . s:get_config_name(g:dein#name) . "')" \ }) endif endfunction +function! s:get_config_name(name) abort + if a:name =~# '\.vim$' + return a:name + elseif a:name =~# '\.nvim$' + return substitute(a:name, '\.nvim$', '.vim', 'g') + else + return a:name . '.vim' + endif + +endfunction + + function! SpaceVim#plugins#fetch() abort if g:spacevim_plugin_manager ==# 'neobundle' NeoBundleFetch g:_spacevim_root_dir . 'bundle/neobundle.vim' diff --git a/bundle/README.md b/bundle/README.md index fdc3ce1f2..947f32e00 100644 --- a/bundle/README.md +++ b/bundle/README.md @@ -8,6 +8,7 @@ In `bundle/` directory, there are two kinds of plugins: forked plugins without c - [`edit` layer](#edit-layer) - [No changed plugins](#no-changed-plugins) - [`core` layer](#core-layer) +- [`lsp` layer](#lsp-layer) - [`lang#ruby` layer](#langruby-layer) - [`lang#python` layer](#langpython-layer) - [`lang#liquid` layer](#langliquid-layer) @@ -45,7 +46,6 @@ These plugins are changed based on a specific version of origin plugin. - [defx.nvim](https://github.com/Shougo/defx.nvim/tree/df5e6ea6734dc002919ea41786668069fa0b497d) - [dein.vim](https://github.com/Shougo/dein.vim/tree/452b4a8b70be924d581c2724e5e218bfd2bcea14) - [indent-blankline.nvim](https://github.com/lukas-reineke/indent-blankline.nvim/tree/045d9582094b27f5ae04d8b635c6da8e97e53f1d) -- [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig/tree/dcb7ebb36f0d2aafcc640f520bb1fc8a9cc1f7c8) - [deoplete-lsp](https://github.com/deoplete-plugins/deoplete-lsp/tree/c466c955e85d995984a8135e16da71463712e5e5) - [nvim-cmp](https://github.com/hrsh7th/nvim-cmp/tree/3192a0c57837c1ec5bf298e4f3ec984c7d2d60c0) - [cmp-neosnippet](https://github.com/notomo/cmp-neosnippet/tree/2d14526af3f02dcea738b4cea520e6ce55c09979) @@ -64,6 +64,15 @@ These plugins are changed based on a specific version of origin plugin. - [nerdtree@fc85a6f07](https://github.com/preservim/nerdtree/tree/fc85a6f07c2cd694be93496ffad75be126240068) + +### `lsp` layer + +- [nvim-lspconfig-0.1.4](https://github.com/neovim/nvim-lspconfig/tree/dcb7ebb36f0d2aafcc640f520bb1fc8a9cc1f7c8) for neovim(`>=0.8.0`) +- [nvim-lspconfig-0.1.3](https://github.com/neovim/nvim-lspconfig/tree/dcb7ebb36f0d2aafcc640f520bb1fc8a9cc1f7c8) for neovim(`>=0.7.0`) +- [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig/tree/dcb7ebb36f0d2aafcc640f520bb1fc8a9cc1f7c8) for old neovim + + + #### `lang#ruby` layer - [vim-ruby@55335f261](https://github.com/vim-ruby/vim-ruby/tree/55335f2614f914b117f02995340886f409eddc02) diff --git a/bundle/nvim-lspconfig-0.1.3/.codespellignorewords b/bundle/nvim-lspconfig-0.1.3/.codespellignorewords new file mode 100644 index 000000000..266689282 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/.codespellignorewords @@ -0,0 +1,3 @@ +als +edn +esy diff --git a/bundle/nvim-lspconfig-0.1.3/.editorconfig b/bundle/nvim-lspconfig-0.1.3/.editorconfig new file mode 100644 index 000000000..489c20c0b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/.editorconfig @@ -0,0 +1,17 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +tab_width = 8 +end_of_line = lf +insert_final_newline = true +charset = utf-8 + +[*.lua] +indent_style = space +indent_size = 2 + +[{Makefile,**/Makefile,runtime/doc/*.txt}] +indent_style = tab +indent_size = 8 diff --git a/bundle/nvim-lspconfig-0.1.3/.github/ISSUE_TEMPLATE/bug_report.yml b/bundle/nvim-lspconfig-0.1.3/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000..0fe9c1f61 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,77 @@ +name: Bug report +description: Report a problem in nvim-lspconfig +labels: [bug] +body: + - type: markdown + attributes: + value: | + Before reporting: search existing issues and ensure you are running the latest nightly of neovim and the latest version of nvim-lspconfig. Note that this repository implements configuration and initialization of language servers. Implementation of the language server spec itself is located in the neovim core repository. + - type: textarea + attributes: + label: "Description" + description: "A short description of the problem you are reporting." + validations: + required: true + - type: textarea + attributes: + label: "Neovim version" + description: "Output of `nvim --version`" + placeholder: | + NVIM v0.6.0-dev+209-g0603eba6e + Build type: Release + LuaJIT 2.1.0-beta3 + validations: + required: true + - type: input + attributes: + label: "Nvim-lspconfig version" + description: "Commit hash" + placeholder: 1344a859864d4e6d23d3f3adf56d49e6386ec0d2 + - type: input + attributes: + label: "Operating system and version" + placeholder: "macOS 11.5" + validations: + required: true + - type: input + attributes: + label: "Affected language servers" + description: "If this issue is specific to one or more language servers, list them here. If not, write 'all'." + placeholder: "clangd" + validations: + required: true + - type: textarea + attributes: + label: "Steps to reproduce" + description: "Steps to reproduce using the minimal config provided below." + placeholder: | + 1. `nvim -nu minimal.lua` + 2. ... + validations: + required: true + - type: textarea + attributes: + label: "Actual behavior" + description: "Observed behavior." + validations: + required: true + - type: textarea + attributes: + label: "Expected behavior" + description: "A description of the behavior you expected." + - type: textarea + attributes: + label: "Minimal config" + render: Lua + description: "You can download a minimal_init.lua via `curl -fLO https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/test/minimal_init.lua`. Then edit it to include your language server and add necessary configuration and paste it here." + validations: + required: true + - type: input + attributes: + label: "LSP log" + description: "If not using the `minimal_init.lua`, add `vim.lsp.set_log_level('debug')` to your LSP setup, upload the log file at `$HOME/.cache/nvim/lsp.log` to https://gist.github.com, and paste the link here." + validations: + required: true + + + diff --git a/bundle/nvim-lspconfig-0.1.3/.github/ISSUE_TEMPLATE/config.yml b/bundle/nvim-lspconfig-0.1.3/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..a8893d75b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,6 @@ +blank_issues_enabled: false +contact_links: + - name: Question + url: https://neovim.discourse.group/c/language-server-protocol-lsp/7 + about: Usage questions and support requests are answered in the Neovim Discourse + diff --git a/bundle/nvim-lspconfig-0.1.3/.github/ISSUE_TEMPLATE/feature_request.yml b/bundle/nvim-lspconfig-0.1.3/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 000000000..31f66c72e --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,24 @@ +name: Feature request +description: Request a feature in nvim-lspconfig +labels: [enhancement] +body: + - type: markdown + attributes: + value: | + Before requesting a new feature, search existing issues. Implementation of the language server protocol itself is located in the neovim core repository, and general feature requests may be better suited for core. + - type: input + attributes: + label: "Language server" + description: "Is the feature specific to a language server? If so, which one(s)?" + placeholder: "clangd" + - type: textarea + attributes: + label: "Requested feature" + validations: + required: true + - type: input + attributes: + label: "Other clients which have this feature" + description: "Is the feature already implemented in another LSP client for (Neo)Vim? If so, which one(s)?" + placeholder: "vim-lsp" + diff --git a/bundle/nvim-lspconfig-0.1.3/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/bundle/nvim-lspconfig-0.1.3/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md new file mode 100644 index 000000000..6e450d78f --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -0,0 +1,11 @@ +--- +name: Pull Request +about: Submit a pull request +title: '' +--- + + diff --git a/bundle/nvim-lspconfig-0.1.3/.github/ci/run_sanitizer.sh b/bundle/nvim-lspconfig-0.1.3/.github/ci/run_sanitizer.sh new file mode 100644 index 000000000..4098d8a79 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/.github/ci/run_sanitizer.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -e + +REF_BRANCH="$1" +PR_BRANCH="$2" + +# checks for added lines that contain search pattern and prints them +SEARCH_PATTERN="(dirname|fn\.cwd)" + +if git diff --pickaxe-all -U0 -G "${SEARCH_PATTERN}" "${REF_BRANCH}" "${PR_BRANCH}" -- '*.lua' | grep -Ev '(configs|utils)\.lua$' | grep -E "^\+.*${SEARCH_PATTERN}" ; then + echo + echo 'String "dirname" found. There is a high risk that this might contradict the directive:' + echo '"Do not add vim.fn.cwd or util.path.dirname in root_dir".' + echo "see: https://github.com/neovim/nvim-lspconfig/blob/master/CONTRIBUTING.md#adding-a-server-to-lspconfig." + exit 1 +fi diff --git a/bundle/nvim-lspconfig-0.1.3/.github/workflows/close-config-changes.yml b/bundle/nvim-lspconfig-0.1.3/.github/workflows/close-config-changes.yml new file mode 100644 index 000000000..b45a755e6 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/.github/workflows/close-config-changes.yml @@ -0,0 +1,21 @@ +name: "Close changes to config" +on: [pull_request_target] +jobs: + close-changes: + runs-on: ubuntu-latest + permissions: + pull-requests: write + env: + PR_NUMBER: ${{ github.event.pull_request.number }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + - run: | + if ! git diff origin/$GITHUB_BASE_REF...$(git branch --show-current) --exit-code -- doc/server_configurations.md doc/server_configurations.txt; then + gh pr close $PR_NUMBER + gh pr comment $PR_NUMBER --body "This pull request has been automatically closed. Changes to server_configurations.md aren't allowed - edit the lua source file instead. Consult https://github.com/neovim/nvim-lspconfig/blob/master/CONTRIBUTING.md#generating-docs." + exit 1 + fi diff --git a/bundle/nvim-lspconfig-0.1.3/.github/workflows/codespell.yml b/bundle/nvim-lspconfig-0.1.3/.github/workflows/codespell.yml new file mode 100644 index 000000000..927a7d9e6 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/.github/workflows/codespell.yml @@ -0,0 +1,11 @@ +name: codespell +on: [pull_request] +jobs: + codespell: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install codespell + run: pip install codespell + - name: Use codespell + run: codespell --quiet-level=2 --check-hidden --skip=./doc/server_configurations.md,./doc/server_configurations.txt --ignore-words=.codespellignorewords diff --git a/bundle/nvim-lspconfig-0.1.3/.github/workflows/commit_lint.yml b/bundle/nvim-lspconfig-0.1.3/.github/workflows/commit_lint.yml new file mode 100644 index 000000000..002979302 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/.github/workflows/commit_lint.yml @@ -0,0 +1,12 @@ +on: [pull_request] +jobs: + lint-commits: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - run: npm install --save-dev @commitlint/{cli,config-conventional} + - run: | + echo "module.exports = { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js + - run: npx commitlint --from HEAD~1 --to HEAD --verbose diff --git a/bundle/nvim-lspconfig-0.1.3/.github/workflows/docgen.yml b/bundle/nvim-lspconfig-0.1.3/.github/workflows/docgen.yml new file mode 100644 index 000000000..a0fdeaa59 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/.github/workflows/docgen.yml @@ -0,0 +1,32 @@ +name: docgen + +on: + push: + branches: + - master + +jobs: + docgen: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v2 + - uses: rhysd/action-setup-vim@v1 + with: + neovim: true + version: nightly + - name: Run docgen + run: | + scripts/docgen.sh + - name: Commit changes + env: + COMMIT_MSG: | + docs: update server_configurations.md + skip-checks: true + run: | + git config user.name github-actions + git config user.email github-actions@github.com + git add doc/server_configurations.md doc/server_configurations.txt + # Only commit and push if we have changes + git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push) diff --git a/bundle/nvim-lspconfig-0.1.3/.github/workflows/feature-branch-check.yml b/bundle/nvim-lspconfig-0.1.3/.github/workflows/feature-branch-check.yml new file mode 100644 index 000000000..7e5b46013 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/.github/workflows/feature-branch-check.yml @@ -0,0 +1,28 @@ +name: Close Non-Feature Branches + +on: + pull_request_target: + branches: + - master + +jobs: + close-master-branch: + runs-on: ubuntu-latest + permissions: + pull-requests: write + env: + PR_NUMBER: ${{ github.event.pull_request.number }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + + - name: Close if master branch + if: ${{ github.head_ref == 'master' }} + run: | + gh pr close $PR_NUMBER + gh pr comment $PR_NUMBER --body "This pull request has been automatically closed. Please develop on a feature branch. Thank you." + exit 1 diff --git a/bundle/nvim-lspconfig-0.1.3/.github/workflows/lint.yml b/bundle/nvim-lspconfig-0.1.3/.github/workflows/lint.yml new file mode 100644 index 000000000..9ce80136c --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/.github/workflows/lint.yml @@ -0,0 +1,54 @@ +name: lint + +on: + pull_request: + branches: + - master + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Setup luacheck + run: | + sudo apt update + sudo apt install -y lua5.1 luarocks + sudo luarocks install luacheck + + - name: Setup selene + run: | + wget "https://github.com/Kampfkarren/selene/releases/download/$VERSION/selene-$VERSION-linux.zip" + echo "$SHA256_CHECKSUM selene-$VERSION-linux.zip" > "selene-$VERSION-linux.zip.checksum" + sha256sum --check "selene-$VERSION-linux.zip.checksum" + unzip "selene-$VERSION-linux.zip" + install -Dp selene "$HOME/.local/bin/selene" + + echo "::add-matcher::.github/workflows/problem_matchers/selene.json" + env: + VERSION: "0.15.0" + SHA256_CHECKSUM: "8ff9272170158fbd9c1af38206ecadc894dc456665dc9bd9f0d43a26e5e8f1af" + + - name: Add $HOME/.local/bin to $PATH + run: echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: Run luacheck + run: luacheck lua/* test/* + + - name: Run selene + run: selene --display-style=quiet . + + style-lint: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Lint with stylua + uses: JohnnyMorganz/stylua-action@1.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + # CLI arguments + args: --check . diff --git a/bundle/nvim-lspconfig-0.1.3/.github/workflows/problem_matchers/selene.json b/bundle/nvim-lspconfig-0.1.3/.github/workflows/problem_matchers/selene.json new file mode 100644 index 000000000..4bbf24f30 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/.github/workflows/problem_matchers/selene.json @@ -0,0 +1,30 @@ +{ + "problemMatcher": [ + { + "owner": "selene-error", + "severity": "error", + "pattern": [ + { + "regexp": "^([^:]+):(\\d+):(\\d+):\\serror(.*)$", + "file": 1, + "line": 2, + "column": 3, + "message": 4 + } + ] + }, + { + "owner": "selene-warning", + "severity": "warning", + "pattern": [ + { + "regexp": "^([^:]+):(\\d+):(\\d+):\\swarning(.*)$", + "file": 1, + "line": 2, + "column": 3, + "message": 4 + } + ] + } + ] +} diff --git a/bundle/nvim-lspconfig-0.1.3/.github/workflows/sanitizer.yml b/bundle/nvim-lspconfig-0.1.3/.github/workflows/sanitizer.yml new file mode 100644 index 000000000..afd7e92a1 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/.github/workflows/sanitizer.yml @@ -0,0 +1,15 @@ +name: "Dirname Checker" +on: [pull_request] +jobs: + disallowed-root-checker: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - run: | + if ! bash .github/ci/run_sanitizer.sh ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}; then + exit 1 + fi diff --git a/bundle/nvim-lspconfig-0.1.3/.github/workflows/test.yml b/bundle/nvim-lspconfig-0.1.3/.github/workflows/test.yml new file mode 100644 index 000000000..d3a214917 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/.github/workflows/test.yml @@ -0,0 +1,53 @@ +name: test + +on: + pull_request: + branches: + - master + +jobs: + ubuntu: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + - name: Setup build dependencies + run: | + sudo apt update && + sudo apt install -y ninja-build \ + gettext \ + libtool \ + libtool-bin \ + autoconf \ + automake \ + cmake \ + g++ \ + pkg-config \ + unzip \ + gperf \ + libluajit-5.1-dev \ + libunibilium-dev \ + libmsgpack-dev \ + libtermkey-dev \ + libvterm-dev \ + libjemalloc-dev \ + lua5.1 \ + lua-lpeg \ + lua-mpack \ + lua-bitop + - name: Run test with building Nvim + run: | + make test + macos: + runs-on: macos-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + - name: Setup build dependencies + run: | + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" && + brew install ninja libtool automake pkg-config gettext + - name: Run test with building Nvim + run: | + make test + diff --git a/bundle/nvim-lspconfig-0.1.3/.gitignore b/bundle/nvim-lspconfig-0.1.3/.gitignore new file mode 100644 index 000000000..a928eeda5 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/.gitignore @@ -0,0 +1,3 @@ +.luacheckcache +neovim +doc/tags diff --git a/bundle/nvim-lspconfig-0.1.3/.luacheckrc b/bundle/nvim-lspconfig-0.1.3/.luacheckrc new file mode 100644 index 000000000..a0e81d602 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/.luacheckrc @@ -0,0 +1,14 @@ +-- vim: ft=lua tw=80 + +-- Rerun tests only if their modification time changed. +cache = true + +ignore = { + "212", -- Unused argument, In the case of callback function, _arg_name is easier to understand than _, so this option is set to off. + "631", -- max_line_length, vscode pkg URL is too long +} + +-- Global objects defined by the C code +read_globals = { + "vim", +} diff --git a/bundle/nvim-lspconfig-0.1.3/.stylua.toml b/bundle/nvim-lspconfig-0.1.3/.stylua.toml new file mode 100644 index 000000000..e548311d1 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/.stylua.toml @@ -0,0 +1,6 @@ +column_width = 120 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferSingle" +no_call_parentheses = true diff --git a/bundle/nvim-lspconfig-0.1.3/CONFIG.md b/bundle/nvim-lspconfig-0.1.3/CONFIG.md new file mode 100644 index 000000000..6aac65565 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/CONFIG.md @@ -0,0 +1 @@ +Notice: CONFIG.md was moved to [doc/server_configurations.md](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md). This notice will be removed after the release of neovim 0.6. diff --git a/bundle/nvim-lspconfig-0.1.3/CONTRIBUTING.md b/bundle/nvim-lspconfig-0.1.3/CONTRIBUTING.md new file mode 100644 index 000000000..40f12cc52 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/CONTRIBUTING.md @@ -0,0 +1,106 @@ +## Requirements + +- [Neovim](https://neovim.io/) 0.6 or later +- Lint task requires [luacheck](https://github.com/luarocks/luacheck#installation) and [stylua](https://github.com/JohnnyMorganz/StyLua). If using nix, you can use `nix develop` to install these to a local nix shell. +- Documentation is generated by `scripts/docgen.lua`. + - Only works on linux and macOS + +## Scope of lspconfig + +The point of lspconfig is to provide the minimal configuration necessary for a server to act in compliance with the language server protocol. In general, if a server requires custom client-side commands or off-spec handlers, then the server configuration should be added *without* those in lspconfig and receive a dedicated plugin such as nvim-jdtls, nvim-metals, etc. + +## Pull requests (PRs) + +- To avoid duplicate work, create a draft pull request. +- Avoid cosmetic changes to unrelated files in the same commit. +- Use a [feature branch](https://www.atlassian.com/git/tutorials/comparing-workflows) instead of the master branch. +- Use a **rebase workflow** for small PRs. + - After addressing review comments, it's fine to rebase and force-push. + +## Adding a server to lspconfig + +The general form of adding a new language server is to start with a minimal skeleton. This includes populated the `config` table with a `default_config` and `docs` table. + +When choosing a server name, convert all dashes (`-`) to underscores (`_`) If the name of the server is a unique name (`pyright`, `clangd`) or a commonly used abbreviation (`zls`), prefer this as the server name. If the server instead follows the pattern x-language-server, prefer the convention `x_ls` (`jsonnet_ls`). + +`default_config` should include, at minimum the following: +* `cmd`: a list which includes the executable name as the first entry, with arguments constituting subsequent list elements (`--stdio` is common). +Note that Windows has a limitation when it comes to directly invoking a server that's installed by `npm` or `gem`, so it requires additional handling. + +```lua +local bin_name = 'typescript-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end +``` + +* `filetypes`: a list for filetypes a +* `root_dir`: a function (or function handle) which returns the root of the project used to determine if lspconfig should launch a new language server, or attach a previously launched server when you open a new buffer matching the filetype of the server. Note, lspconfig does not offer a dedicated single file mode (this is not codified in the spec). Do not add `vim.fn.cwd` or `util.path.dirname` in `root_dir`. A future version of lspconfig will provide emulation of a single file mode until this is formally codified in the specification. A good fallback is `util.find_git_ancestor`, see other configurations for examples. + +Additionally, the following options are often added: + +* `init_options`: a table sent during initialization, corresponding to initializationOptions sent in [initializeParams](https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#initializeParams) as part of the first request sent from client to server during startup. +* `settings`: a table sent during [`workspace/didChangeConfiguration`](https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#didChangeConfigurationParams) shortly after server initialization. This is an undocumented convention for most language servers. There is often some duplication with initOptions. + +A minimal example for adding a new language server is shown below for `pyright`, a python language server included in lspconfig: + +```lua +-- Only `configs` must be required, util is optional if you are using the root resolver functions, which is usually the case. +local configs = require 'lspconfig.configs' +local util = require 'lspconfig.util' + +-- Having server name defined here is the convention, this is often times also the first entry in the `cmd` table. +local server_name = 'pyright' + +configs[server_name] = { + default_config = { + -- This should be executable on the command line, arguments (such as `--stdio`) are additional entries in the list. + cmd = { 'pyright-langserver' }, + -- These are the filetypes that the server will either attach or start in response to opening. The user must have a filetype plugin matching the filetype, either via the built-in runtime files or installed via plugin. + filetypes = { 'python' }, + -- The root directory that lspconfig uses to determine if it should start a new language server, or attach the current buffer to a previously running language server. + root_dir = util.find_git_ancestor + end, + }, + docs = { + -- The description should include at minimum the link to the github project, and ideally the steps to install the language server. + description = [[ +https://github.com/microsoft/pyright + +`pyright`, a static type checker and language server for python + +`pyright` can be installed via `npm` +`npm install -g pyright` +]], + }, +} +``` + +## Commit style + +lspconfig, like neovim core, follows the [conventional commit style](https://www.conventionalcommits.org/en/v1.0.0-beta.2/) please submit your commits accordingly. Generally commits will be of the form: + +``` +feat: add lua-language-server support +fix(lua-language-server): update root directory pattern +docs: update README.md +``` + +with the commit body containing additional details. + +## Lint + +PRs are checked with [luacheck](https://github.com/mpeterv/luacheck), [StyLua](https://github.com/JohnnyMorganz/StyLua) and [selene](https://github.com/Kampfkarren/selene). Please run the linter locally before submitting a PR: + + make lint + +## Generating docs + +Github Actions automatically generates `server_configurations.md`. Only modify `scripts/README_template.md` or the `docs` table in the server config (the lua file). Do not modify `server_configurations.md` directly. + +To preview the generated `server_configurations.md` locally, run `scripts/docgen.lua` from +`nvim` (from the project root): + + nvim -R -Es +'set rtp+=$PWD' +'luafile scripts/docgen.lua' diff --git a/bundle/nvim-lspconfig-0.1.3/LICENSE.md b/bundle/nvim-lspconfig-0.1.3/LICENSE.md new file mode 100644 index 000000000..be03814a2 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/LICENSE.md @@ -0,0 +1,183 @@ +Copyright Neovim contributors. All rights reserved. + +nvim-lsp is licensed under the terms of the Apache 2.0 license. + +nvim-lsp's license follows: + +==== + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/bundle/nvim-lspconfig-0.1.3/Makefile b/bundle/nvim-lspconfig-0.1.3/Makefile new file mode 100644 index 000000000..15aa212cf --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/Makefile @@ -0,0 +1,12 @@ +test: + sh ./scripts/run_test.sh + +lint: + @printf "\nRunning luacheck\n" + luacheck lua/* test/* + @printf "\nRunning selene\n" + selene --display-style=quiet . + @printf "\nRunning stylua\n" + stylua --check . + +.PHONY: test lint diff --git a/bundle/nvim-lspconfig-0.1.3/README.md b/bundle/nvim-lspconfig-0.1.3/README.md new file mode 100644 index 000000000..00183e612 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/README.md @@ -0,0 +1,180 @@ +# lspconfig + +A [collection of common configurations](doc/server_configurations.md) for Neovim's built-in [language server client](https://neovim.io/doc/user/lsp.html). + +This plugin allows for declaratively configuring, launching, and initializing language servers you have installed on your system. +**Disclaimer: Language server configurations are provided on a best-effort basis and are community-maintained. See [contributions](#contributions).** + +`lspconfig` has extensive help documentation, see `:help lspconfig`. + +# LSP overview + +Neovim supports the Language Server Protocol (LSP), which means it acts as a client to language servers and includes a Lua framework `vim.lsp` for building enhanced LSP tools. LSP facilitates features like: + +- go-to-definition +- find-references +- hover +- completion +- rename +- format +- refactor + +Neovim provides an interface for all of these features, and the language server client is designed to be highly extensible to allow plugins to integrate language server features which are not yet present in Neovim core such as [**auto**-completion](https://github.com/neovim/nvim-lspconfig/wiki/Autocompletion) (as opposed to manual completion with omnifunc) and [snippet integration](https://github.com/neovim/nvim-lspconfig/wiki/Snippets). + +**These features are not implemented in this repo**, but in Neovim core. See `:help lsp` for more details. + +## Install + +* Requires [Neovim v0.6.1](https://github.com/neovim/neovim/releases/tag/v0.6.1) or [Nightly](https://github.com/neovim/neovim/releases/tag/nightly). Update Neovim and 'lspconfig' before reporting an issue. + +* Install 'lspconfig' like any other Vim plugin, e.g. with [packer.nvim](https://github.com/wbthomason/packer.nvim): + + ```lua + local use = require('packer').use + require('packer').startup(function() + use 'wbthomason/packer.nvim' -- Package manager + use 'neovim/nvim-lspconfig' -- Collection of configurations for the built-in LSP client + end) + ``` + +## Quickstart + +1. Install a language server, e.g. [pyright](doc/server_configurations.md#pyright) + + ```bash + npm i -g pyright + ``` + +2. Add the language server setup to your init.lua. + + ```lua + require'lspconfig'.pyright.setup{} + ``` + +3. Launch neovim, the language server will now be attached and providing diagnostics (see `:LspInfo`) + + ``` + nvim main.py + ``` + +4. See [Keybindings and completion](#Keybindings-and-completion) for mapping useful functions and enabling omnifunc completion + +For a full list of servers, see [server_configurations.md](doc/server_configurations.md) or `:help lspconfig-server-configurations`. This document contains installation instructions and additional, optional, customization suggestions for each language server. For some servers that are not on your system path (e.g., `jdtls`, `elixirls`), you will be required to manually add `cmd` as an entry in the table passed to `setup`. Most language servers can be installed in less than a minute. + +## Suggested configuration + +'lspconfig' does not map keybindings or enable completion by default. The following example configuration provides suggested keymaps for the most commonly used language server functions, and manually triggered completion with omnifunc (\\). + +Note: **you must pass the defined `on_attach` as an argument to every `setup {}` call** and **the keybindings in `on_attach` only take effect on buffers with an active language server**. + +```lua +-- Mappings. +-- See `:help vim.diagnostic.*` for documentation on any of the below functions +local opts = { noremap=true, silent=true } +vim.api.nvim_set_keymap('n', 'e', 'lua vim.diagnostic.open_float()', opts) +vim.api.nvim_set_keymap('n', '[d', 'lua vim.diagnostic.goto_prev()', opts) +vim.api.nvim_set_keymap('n', ']d', 'lua vim.diagnostic.goto_next()', opts) +vim.api.nvim_set_keymap('n', 'q', 'lua vim.diagnostic.setloclist()', opts) + +-- Use an on_attach function to only map the following keys +-- after the language server attaches to the current buffer +local on_attach = function(client, bufnr) + -- Enable completion triggered by + vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + + -- Mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', 'lua vim.lsp.buf.declaration()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', 'lua vim.lsp.buf.definition()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', 'lua vim.lsp.buf.hover()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', 'lua vim.lsp.buf.implementation()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', '', 'lua vim.lsp.buf.signature_help()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'D', 'lua vim.lsp.buf.type_definition()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'rn', 'lua vim.lsp.buf.rename()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'ca', 'lua vim.lsp.buf.code_action()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', 'lua vim.lsp.buf.references()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'f', 'lua vim.lsp.buf.formatting()', opts) +end + +-- Use a loop to conveniently call 'setup' on multiple servers and +-- map buffer local keybindings when the language server attaches +local servers = { 'pyright', 'rust_analyzer', 'tsserver' } +for _, lsp in pairs(servers) do + require('lspconfig')[lsp].setup { + on_attach = on_attach, + flags = { + -- This will be the default in neovim 0.7+ + debounce_text_changes = 150, + } + } +end +``` + +Manual, triggered completion is provided by neovim's built-in omnifunc. For **auto**completion, a general purpose [autocompletion plugin](https://github.com/neovim/nvim-lspconfig/wiki/Autocompletion) is required. + +## Debugging + +If you have an issue with 'lspconfig', the first step is to reproduce with a [minimal configuration](https://github.com/neovim/nvim-lspconfig/blob/master/test/minimal_init.lua). + +The most common reasons a language server does not start or attach are: + +1. The language server is not installed. 'lspconfig' does not install language servers for you. You should be able to run the `cmd` defined in each server's lua module from the command line and see that the language server starts. If the `cmd` is an executable name instead of an absolute path to the executable, ensure it is on your path. + +2. Missing filetype plugins. Certain languages are not detecting by vim/neovim because they have not yet been added to the filetype detection system. Ensure `:set ft?` shows the filetype and not an empty value. + +3. Not triggering root detection. **Some** language servers will only start if it is opened in a directory, or child directory, containing a file which signals the *root* of the project. Most of the time, this is a `.git` folder, but each server defines the root config in the lua file. See [server_configurations.md](doc/server_configurations.md) or the source for the list of root directories. + +4. You must pass `on_attach` and `capabilities` for **each** `setup {}` if you want these to take effect. + +5. **Do not call `setup {}` twice for the same server**. The second call to `setup {}` will overwrite the first. + +Before reporting a bug, check your logs and the output of `:LspInfo`. Add the following to your init.vim to enable logging: + +```lua +vim.lsp.set_log_level("debug") +``` + +Attempt to run the language server, and open the log with: + +``` +:lua vim.cmd('e'..vim.lsp.get_log_path()) +``` +Most of the time, the reason for failure is present in the logs. + +## Built-in commands + +* `:LspInfo` shows the status of active and configured language servers. + +The following support tab-completion for all arguments: + +* `:LspStart ` Start the requested server name. Will only successfully start if the command detects a root directory matching the current config. Pass `autostart = false` to your `.setup{}` call for a language server if you would like to launch clients solely with this command. Defaults to all servers matching current buffer filetype. +* `:LspStop ` Defaults to stopping all buffer clients. +* `:LspRestart ` Defaults to restarting all buffer clients. + +## The wiki + +Please see the [wiki](https://github.com/neovim/nvim-lspconfig/wiki) for additional topics, including: + +* [Snippets support](https://github.com/neovim/nvim-lspconfig/wiki/Snippets) +* [Project local settings](https://github.com/neovim/nvim-lspconfig/wiki/Project-local-settings) +* [Recommended plugins for enhanced language server features](https://github.com/neovim/nvim-lspconfig/wiki/Language-specific-plugins) + +## Contributions + +If you are missing a language server on the list in [server_configurations.md](doc/server_configurations.md), contributing +a new configuration for it would be appreciated. You can follow these steps: + +1. Read [CONTRIBUTING.md](CONTRIBUTING.md). + +2. Create a new file at `lua/lspconfig/server_configurations/SERVER_NAME.lua`. + + - Copy an [existing config](https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/) + to get started. Most configs are simple. For an extensive example see + [texlab.lua](https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/texlab.lua). + +3. Ask questions on our [Discourse](https://neovim.discourse.group/c/7-category/7) or in the [Neovim Gitter](https://gitter.im/neovim/neovim). + +You can also help out by testing [PRs with the `needs-testing`](https://github.com/neovim/nvim-lspconfig/issues?q=is%3Apr+is%3Aopen+label%3Aneeds-testing) label) that affect language servers you use regularly. diff --git a/bundle/nvim-lspconfig-0.1.3/doc/lspconfig.txt b/bundle/nvim-lspconfig-0.1.3/doc/lspconfig.txt new file mode 100644 index 000000000..d1d9103c5 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/doc/lspconfig.txt @@ -0,0 +1,636 @@ +*lspconfig.txt* For Nvim version 0.6.1+ Last change: 2021 Nov 7 +============================================================================== +TABLE OF CONTENTS *lspconfig-toc* + +1. Introduction (|lspconfig|) +2. LSP overview (|lspconfig-lsp|) +3. Quickstart (|lspconfig-quickstart|) +4. Setup {} (|lspconfig-setup|) +5. Global defaults (|lspconfig-global-defaults|) +6. Server configurations (|lspconfig-configurations|) + 6a. Adding servers (|lspconfig-adding-servers|) +7. Root directories (|lspconfig-root-detection|) + 7a. Advanced detection (|lspconfig-root-advanced|) + 7b. Single file support (|lspconfig-single-file-support|) +8. Commands (|lspconfig-commands|) +9. Keybindings (|lspconfig-keybindings|) +10. Completion (|lspconfig-completion|) +11. Debugging (|lspconfig-debugging|) +12. Logging (|lspconfig-logging|) +13. Scope (|lspconfig-scope|) + +============================================================================== +INTRODUCTION *lspconfig* + +`lspconfig` is a collection of community contributed configurations for the +built-in language server client in Neovim core. This plugin provides four +primary functionalities: + + - default launch commands, initialization options, and settings for each + server + - a root directory resolver which attempts to detect the root of your project + - an autocommand mapping that either launches a new language server or + attempts to attach a language server to each opened buffer if it falls + under a tracked project + - utility commands such as LspInfo, LspStart, LspStop, and LspRestart for + managing language server instances + +`lspconfig` is not required to use the built-in client, it is only one front-end +interface for when a language server specific plugin is not available. + +See |lspconfig-server-configurations| by typing `K` over it for the complete +list of language servers configurations. + +============================================================================== +LSP OVERVIEW *lspconfig-lsp* + +Nvim supports the Language Server Protocol (LSP) via the built-in language +server client. LSP facilitates many features, some of which include: + +- go-to-definition +- find-references +- hover +- completion +- rename +- format +- refactor + +These features are implemented in Neovim core, not `lspconfig`. See `:help lsp` +for more details. + +NOTE: Feature availability depends on the implementation details of the +server. A server may implement only a subset of these features. Always +consult the server documentation before filing a bug report on a missing +feature. + +============================================================================== +QUICKSTART *lspconfig-quickstart* + +- ensure the server is installed and executable from the command line + +- enable the server in your Neovim configuration (Lua example): +> + require'lspconfig'.clangd.setup{} +< +- create a new project, ensure that it contains a root marker which matches the + server requirements specified in |lspconfig-server-configurations|. + +- open a file within that project, such as `main.c`. + +- If you need more information about a server configuration, read the corresponding + entry in |lspconfig-server-configurations|. + +============================================================================== +THE SETUP METAMETHOD *lspconfig-setup* + +`lspconfig` consists of a collection of language server configurations. Each +configuration exposes a `setup {}` metamethod which makes it easy to directly +use the default configuration or selectively override the defaults. +`setup {}` is the primary interface by which users interact with `lspconfig`. + +Using the default configuration for a server is simple: +> + require'lspconfig'.clangd.setup{} +< +The available server names are listed in |lspconfig-server-configurations| and +match the server name in `config.SERVER_NAME` defined in each configuration's +source file. + +The purpose of `setup{}` is to wrap the call to Nvim's built-in +`vim.lsp.start_client()` with an autocommand that automatically launch a +language server. + +This autocommand calls `start_client()` or `vim.lsp.buf_attach_client()` +depending on whether the current file belongs to a project with a currently +running client. See |lspconfig-root-detection| for more details. + +The `setup{}` function takes a table which contains a superset of the keys +listed in `:help vim.lsp.start_client()` with the following unique entries: + +- {root_dir} + + `function(filename, bufnr)` + + Returns either a filepath (string) or nil. The language server will only + start if the function returns a filepath. + + If a root directory (string) is returned which is unique from any + previously returned root_dir, a new server will be spawned with that + root directory. See |lspconfig-root-detection| for more details + +- {name} + + `string` + + Defaults to the server's name (`clangd`, `pyright`, etc.). + +- {filetypes} + + `list[string] | nil` + + Set of filetypes for which to attempt to resolve {root_dir}. + + May be empty, or server may specify a default value. + +- {autostart} + + `bool` (default: true) + + Controls if the `FileType` autocommand that launches a language server is + created. If `false`, allows for deferring language servers until manually + launched with `:LspStart` (|lspconfig-commands|). + +- {single_file_support} + + `bool` (default: nil) + + Determines if a server is started without a matching root directory. + See |lspconfig-single-file-support|. + +- {on_new_config} + + `function(new_config, new_root_dir)` + + Function executed after a root directory is detected. This is used to + modify the server configuration (including `cmd` itself). Most commonly, + this is used to inject additional arguments into `cmd`. + + If overriding `on_new_config`, ensure that you read the + `on_new_config` defined in the source file of the default configuration + in `lspconfig`. The original `on_new_config` snippet for a given server + should likely be included in your new override. Some configurations + use `on_new_config` to dynamically set or modify `cmd`. + +Note: all entries passed to `setup {}` override the entry in the default +configuration. There is no composition. + +All `config` elements described in `:help vim.lsp.start_client()` can +additionally be overridden via the `setup {}` call. The most commonly +passed overrides to `setup {}` are: + +- {capabilities} `table ` + + a table which represents the neovim client capabilities. Useful for + broadcasting to the server additional functionality (snippets, off-protocol + features) provided by plugins. + +- {cmd} `list[string]` + + a list where each entry corresponds to the blankspace delimited part of + the command that launches the server. The first entry is the binary used + to run the language server. Additional entries are passed as arguments. + + The equivalent `cmd` for: +> + foo --bar baz +< + is: +> + {'foo', '--bar', 'baz} +< +- {handlers} `list[functions]` + + a list of handlers which override the function used to process a response + from a given language server. Applied only to the server referenced by + setup. See |lsp-handler|. + +- {init_options} `table ` + + a table passed during the initialization notification after launching + a language server. Equivalent to the `initializationOptions` field found + in `InitializeParams` in the LSP specification. + + See upstream server documentation for available initialization + options. + +- {on_attach} `function(client, bufnr)` + + Callback invoked by Nvim's built-in client when attaching a buffer to a + language server. Often used to set Nvim (buffer or global) options or to + override the Nvim client properties (`resolved_capabilities`) after a + language server attaches. Most commonly used for settings buffer + local keybindings. See |lspconfig-keybindings| for a usage example. + +- {settings} `table ` + + The `settings` table is sent in `on_init` via a + `workspace/didChangeConfiguration` notification from the Nvim client to + the language server. These settings allow a user to change optional runtime + settings of the language server. + + As an example, to set the following settings found in the pyright + documentation: + + `pyright.disableLanguageServices`: `boolean` + `pyright.disableOrganizeImports`: `boolean` + + Nested keys need to be translated into a nested table and passed to + the settings field in `setup {}` as follows: +> + require('lspconfig').pyright.setup{ + settings = { + pyright = { + disableLanguageServices = true, + disableOrganizeImports = true, + } + } + } +< +============================================================================== +OVERRIDING GLOBAL DEFAULTS *lspconfig-global-defaults* + +The global defaults for all servers can be overridden by extending the +`default_config` table. + +> + local lspconfig = require'lspconfig' + lspconfig.util.default_config = vim.tbl_extend( + "force", + lspconfig.util.default_config, + { + autostart = false, + handlers = { + ["window/logMessage"] = function(err, method, params, client_id) + if params and params.type <= vim.lsp.protocol.MessageType.Log then + vim.lsp.handlers["window/logMessage"](err, method, params, client_id) + end + end; + ["window/showMessage"] = function(err, method, params, client_id) + if params and params.type <= vim.lsp.protocol.MessageType.Warning.Error then + vim.lsp.handlers["window/showMessage"](err, method, params, client_id) + end + end; + } + } + ) +< +`setup {}` can additionally override these defaults in subsequent calls. + +============================================================================== +SERVER CONFIGURATIONS *lspconfig-configurations* + +See |lspconfig-server-configurations| by typing `K` over it for the complete +list of language servers configurations. + +While the `setup {}` function is the primary interface to `lspconfig`, for +servers for which there is not a configuration, it is necessary to define a +configuration directly. This can be useful if there is an outstanding PR that +is in review, or when developing a language server that is unavailable +publicly. This can be done through the `configs` module. + +The `configs` module is a singleton where configs are defined. The schema for +validating using `vim.validate` is: +> + configs.SERVER_NAME = { + default_config = {'t'}; + on_new_config = {'f', true}; + on_attach = {'f', true}; + commands = {'t', true}; + docs = {'t', true}; + } +< +where the structure of the docs table is as follows: +> + docs = { + description = {'s', true}; + default_config = {'t', true}; + } +< +`commands` is a map of `name:definition` key:value pairs, where `definition` +is a list whose first value is a function implementing the command, and the +rest are either array values which will be formed into flags for the command, +or special keys like `description`. Example: +> + commands = { + TexlabBuild = { + function() + buf_build(0) + end; + "-range"; + description = "Build the current buffer"; + }; + }; +< +The `configs.__newindex` metamethod consumes the config definition and returns +an object with a `setup()` method, to be invoked by users: +> + require'lspconfig'.SERVER_NAME.setup{} + +After you set `configs.SERVER_NAME` you can add arbitrary language-specific +functions to it if necessary. + +Example: + +> + configs.texlab.buf_build = buf_build +< +============================================================================== +ADDING NEW SERVERS *lspconfig-adding-servers* + +The three steps for adding and enabling a new server configuration are: + +- load the `lspconfig` module (note that this is a stylistic choice) +> + local lspconfig = require 'lspconfig' +< +- define the configuration + +> + local configs = require 'lspconfig.configs' + + -- Check if the config is already defined (useful when reloading this file) + if not configs.foo_lsp then + configs.foo_lsp = { + default_config = { + cmd = {'/home/neovim/lua-language-server/run.sh'}; + filetypes = {'lua'}; + root_dir = function(fname) + return lspconfig.util.find_git_ancestor(fname) + end; + settings = {}; + }; + } + end + +- call `setup()` to enable the FileType autocmd +> + lspconfig.foo_lsp.setup{} +< +============================================================================== +ROOT DETECTION *lspconfig-root-detection* + *lspconfig-root-dir* + +A project's `root_dir` is used by `lspconfig` to determine whether `lspconfig` +should start a new server, or attach a previous one, to the current file. + +`lspconfig` automatically launches language servers by defining a filetype +autocommand based on the `filetypes` specified in the default configuration of +each server, optionally overridable by the `filetypes` table passed to +`setup`. + +This autocommand triggers a search from the current file position in the +filesystem hierarchy up to the top level directory of your filesystem. The +`root_dir` entry of each configuration is a function that returns true if the +current directory in this traversal matches a given root pattern. + +The following utility functions are provided by `lspconfig`. Each function call +below returns a function that takes as its argument the current buffer path. + +- `util.root_pattern`: function which takes multiple arguments, each + corresponding to a different root pattern against which the contents of the + current directory are matched using |vim.fin.glob()| while traversing up the + filesystem. +> + root_dir = util.root_pattern('pyproject.toml', 'requirements.txt') +< +- `util.find_git_ancestor`: a function that locates the first parent directory + containing a `.git` directory. +> + root_dir = util.find_git_ancestor + +- `util.find_node_modules_ancestor`: a function that locates the first parent + directory containing a `node_modules` directory. +> + root_dir = util.find_node_modules_ancestor +< + +- `util.find_package_json_ancestor`: a function that locates the first parent + directory containing a `package.json`. +> + root_dir = util.find_json_ancestor +< +Note: On Windows, `lspconfig` always assumes forward slash normalized paths with +capitalized drive letters. + +============================================================================== +ADVANCED ROOT DIRECTORY DETECTION *lspconfig-root-advanced* + *lspconfig-root-composition* + +The `root_dir` key in `config` and `setup` can hold any function of the form +> + function custom_root_dir(filename, bufnr) + returns nil | string +> +This allows for rich composition of root directory patterns which is necessary +for some project structures. Example (for Kotlin): +> + local root_files = { + 'settings.gradle', -- Gradle (multi-project) + 'settings.gradle.kts', -- Gradle (multi-project) + 'build.xml', -- Ant + 'pom.xml', -- Maven + } + + local fallback_root_files = { + 'build.gradle', -- Gradle + 'build.gradle.kts', -- Gradle + } + root_dir = function(fname) + local primary = util.root_pattern(unpack(root_files))(fname) + local fallback = util.root_pattern(unpack(fallback_root_files))(fname) + return primary or fallback + end +< +Browsing the source of the default configurations is recommended. + +============================================================================== +SINGLE FILE SUPPORT *lspconfig-single-file-support* + +Language servers require each project to have a `root` in order to provide +features that require cross-file indexing. + +Some servers support not passing a root directory as a proxy for single file +mode under which cross-file features may be degraded. + +`lspconfig` offers limited support for an implicit single-file mode by: + +- first trying to resolve the root directory pattern +- then, if `single_file_support` is enabled for a given language server + configuration, starting the server without sending `rootDirectory` or + `workspaceFolders` during initialization. +- attaching subsequent files in the parent directory to the same server + instance, depending on filetype. + +Cross-file features (navigation, hover) may or may not work depending on the +language server. For a full feature-set, consider moving your files to a +directory with a project structure `lspconfig` can infer. + +Note that in the event that the LSP specification is extended to support a +standard for single-file mode, lspconfig will adopt that standard. + +============================================================================== +COMMANDS *lspconfig-commands* + +- `:LspInfo` shows the status of active and configured language servers. Note + that client id refers to the Nvim RPC instance connected to a given + language server. + +The following commands support tab-completion for all arguments. All commands +that require a client id can either leverage tab-completion or the info +contained in `:LspInfo`: + +- `:LspStart ` launches the requested (configured) client, but only + if it successfully resolves a root directory. Note: Defaults to all + configured servers matching the current buffer filetype. +- `:LspStop ` stops the server with the given client id. Defaults to + stopping all servers active on the current buffer. +- `:LspRestart ` restarts the client with the given client id, and + will attempt to reattach to all previously attached buffers. + +============================================================================== +EXAMPLE KEYBINDINGS *lspconfig-keybindings* + +`lspconfig`, and the core client, do not map any keybindings by default. The +following is an example Lua block which demonstrates how to leverage +`on-attach` to selectively apply keybindings after a language servers has +attached to a given buffer. +> +> + -- Mappings. + -- See `:help vim.diagnostic.*` for documentation on any of the below functions + local opts = { noremap=true, silent=true } + vim.api.nvim_set_keymap('n', 'e', 'lua vim.diagnostic.open_float()', opts) + vim.api.nvim_set_keymap('n', '[d', 'lua vim.diagnostic.goto_prev()', opts) + vim.api.nvim_set_keymap('n', ']d', 'lua vim.diagnostic.goto_next()', opts) + vim.api.nvim_set_keymap('n', 'q', 'lua vim.diagnostic.setloclist()', opts) + + -- Use an on_attach function to only map the following keys + -- after the language server attaches to the current buffer + local on_attach = function(client, bufnr) + -- Enable completion triggered by + vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + + -- Mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', 'lua vim.lsp.buf.declaration()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', 'lua vim.lsp.buf.definition()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', 'lua vim.lsp.buf.hover()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', 'lua vim.lsp.buf.implementation()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', '', 'lua vim.lsp.buf.signature_help()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'D', 'lua vim.lsp.buf.type_definition()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'rn', 'lua vim.lsp.buf.rename()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'ca', 'lua vim.lsp.buf.code_action()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', 'lua vim.lsp.buf.references()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'f', 'lua vim.lsp.buf.formatting()', opts) + end + + -- Use a loop to conveniently call 'setup' on multiple servers and + -- map buffer local keybindings when the language server attaches + local servers = { 'pyright', 'rust_analyzer', 'tsserver' } + for _, lsp in pairs(servers) do + require('lspconfig')[lsp].setup { + on_attach = on_attach, + flags = { + -- This will be the default in neovim 0.7+ + debounce_text_changes = 150, + } + } + end +< +Note: these keymappings are meant for illustration and override some +infrequently used default mappings. + +============================================================================== +COMPLETION SUPPORT *lspconfig-completion* + +Manually triggered completion can be provided by Nvim's built-in omnifunc. +See `:help omnifunc` for more details. + +For autocompletion, Nvim does not offer built-in functionality at this time. +Consult the `lspconfig` wiki, which provides configuration examples for using a +completion plugin with the built-in client + +============================================================================== +DEBUGGING *lspconfig-debugging* + +While using language servers should be easy, debugging issues can be +challenging. First, it is important to identify the source of the issue, which +is typically (in rough order): + +- the language server itself +- a plugin +- overrides in a user configuration +- the built-in client in Nvim core +- `lspconfig` + +The first step in debugging is to test with a minimal configuration (such as +`../test/minimal_init.lua`). Historically, many users problems are due to +plugins or misconfiguration. + +Should that fail, identifying which component is the culprit is challenging. +The following are the only categories of bugs that pertain to `lspconfig`. + +- The root directory inferred for your project is wrong, or it should be + detected but is not due to a bug in the `lspconfig` path utilities. +- The server is launching, but you believe that the default settings, + initialization options, or command arguments are suboptimal and should be + replaced based on your understanding of the server documentation. + +All bugs Nvim's built-in client should be reported to the Nvim core issue +tracker. All bugs pertaining to plugins should be reported to the respective +plugin. All missing features in a language server should be reported to the +upstream language server issue tracker. + +For debugging `lspconfig` issues, the most common hurdles users face are: + + - The language server is not installed or is otherwise not executable. + `lspconfig` does not install language servers for you. Ensure the `cmd` + defined in `server_configurations.md` is executable from the command + line. If the absolute path to the binary is not supplied in `cmd`, ensure + it is on your PATH. + - No root detected. `lspconfig` is built around the concept of projects. See + |lspconfig-root-detection| for more details. Most of the time, + initializing a git repo will suffice. + - Misconfiguration. Often users will override `cmd`, `on_init`, or + `handlers`. Ensure that you debug by using a stock configuration to ensure + your customizations are not introducing issues. + +|LspInfo| provides an overview of your active and configured language servers +which can be useful for debugging. + +Note that it will not report any configuration changes applied in +`on_new_config`. + +============================================================================== +LOGGING *lspconfig-logging* + +When debugging language servers, it is helpful to enable additional logging in +the built-in client, specifically considering the RPC logs. Example: +> + vim.lsp.set_log_level 'trace' + if vim.fn.has 'nvim-0.5.1' == 1 then + require('vim.lsp.log').set_format_func(vim.inspect) + end +< +Attempt to run the language server, and open the log with: + +> + :lua vim.cmd('e'..vim.lsp.get_log_path()) +< +Note that `ERROR` messages containing `stderr` only indicate that the log was +sent to `stderr`. Many servers counter-intuitively send harmless messages +via stderr. + +============================================================================== +SCOPE *lspconfig-scope* + +`lspconfig` is a community effort to create default configurations that fit +within the scope of an official plugin for Nvim. All features that are not +strictly providing default configurations for language servers will be removed +from `lspconfig` in time. The power of the Neovim LSP ecosystem is in the +composability and flexibility of integrating multiple plugins which maximizes +user choice and freedom. + +`lspconfig` also opts to adhere strictly to the LSP specification, with some +small allowances when small modifications to a server configuration are +necessary to enable features critical to its usability. For more featureful +options, the `lspconfig` wiki lists community created plugins that build upon +the built-in client to provide functionality tailored to specific language +servers. + +============================================================================== + +vim:tw=78:ts=8:ft=help:norl: diff --git a/bundle/nvim-lspconfig-0.1.3/doc/server_configurations.md b/bundle/nvim-lspconfig-0.1.3/doc/server_configurations.md new file mode 100644 index 000000000..426c422ff --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/doc/server_configurations.md @@ -0,0 +1,6554 @@ +# Configurations + + +The following LSP configs are included. This documentation is autogenerated from the lua files. Follow a link to find documentation for +that config. This file is accessible in neovim via `:help lspconfig-server-configurations` + +- [als](#als) +- [angularls](#angularls) +- [ansiblels](#ansiblels) +- [arduino_language_server](#arduino_language_server) +- [asm_lsp](#asm_lsp) +- [awk_ls](#awk_ls) +- [bashls](#bashls) +- [beancount](#beancount) +- [bicep](#bicep) +- [bsl_ls](#bsl_ls) +- [ccls](#ccls) +- [clangd](#clangd) +- [clarity_lsp](#clarity_lsp) +- [clojure_lsp](#clojure_lsp) +- [cmake](#cmake) +- [codeqlls](#codeqlls) +- [crystalline](#crystalline) +- [csharp_ls](#csharp_ls) +- [cssls](#cssls) +- [cssmodules_ls](#cssmodules_ls) +- [cucumber_language_server](#cucumber_language_server) +- [dartls](#dartls) +- [denols](#denols) +- [dhall_lsp_server](#dhall_lsp_server) +- [diagnosticls](#diagnosticls) +- [dockerls](#dockerls) +- [dotls](#dotls) +- [efm](#efm) +- [elixirls](#elixirls) +- [elmls](#elmls) +- [ember](#ember) +- [emmet_ls](#emmet_ls) +- [erlangls](#erlangls) +- [esbonio](#esbonio) +- [eslint](#eslint) +- [flow](#flow) +- [flux_lsp](#flux_lsp) +- [foam_ls](#foam_ls) +- [fortls](#fortls) +- [fsautocomplete](#fsautocomplete) +- [fstar](#fstar) +- [gdscript](#gdscript) +- [ghcide](#ghcide) +- [golangci_lint_ls](#golangci_lint_ls) +- [gopls](#gopls) +- [gradle_ls](#gradle_ls) +- [grammarly](#grammarly) +- [graphql](#graphql) +- [groovyls](#groovyls) +- [haxe_language_server](#haxe_language_server) +- [hdl_checker](#hdl_checker) +- [hhvm](#hhvm) +- [hie](#hie) +- [hls](#hls) +- [hoon_ls](#hoon_ls) +- [html](#html) +- [idris2_lsp](#idris2_lsp) +- [intelephense](#intelephense) +- [java_language_server](#java_language_server) +- [jdtls](#jdtls) +- [jedi_language_server](#jedi_language_server) +- [jsonls](#jsonls) +- [jsonnet_ls](#jsonnet_ls) +- [julials](#julials) +- [kotlin_language_server](#kotlin_language_server) +- [lean3ls](#lean3ls) +- [leanls](#leanls) +- [lelwel_ls](#lelwel_ls) +- [lemminx](#lemminx) +- [ltex](#ltex) +- [metals](#metals) +- [mint](#mint) +- [mm0_ls](#mm0_ls) +- [nickel_ls](#nickel_ls) +- [nimls](#nimls) +- [ocamlls](#ocamlls) +- [ocamllsp](#ocamllsp) +- [ols](#ols) +- [omnisharp](#omnisharp) +- [opencl_ls](#opencl_ls) +- [openscad_ls](#openscad_ls) +- [pasls](#pasls) +- [perlls](#perlls) +- [perlnavigator](#perlnavigator) +- [perlpls](#perlpls) +- [phpactor](#phpactor) +- [please](#please) +- [powershell_es](#powershell_es) +- [prismals](#prismals) +- [prosemd_lsp](#prosemd_lsp) +- [psalm](#psalm) +- [puppet](#puppet) +- [purescriptls](#purescriptls) +- [pylsp](#pylsp) +- [pyre](#pyre) +- [pyright](#pyright) +- [quick_lint_js](#quick_lint_js) +- [r_language_server](#r_language_server) +- [racket_langserver](#racket_langserver) +- [reason_ls](#reason_ls) +- [remark_ls](#remark_ls) +- [rescriptls](#rescriptls) +- [rls](#rls) +- [rnix](#rnix) +- [robotframework_ls](#robotframework_ls) +- [rome](#rome) +- [rust_analyzer](#rust_analyzer) +- [salt_ls](#salt_ls) +- [scry](#scry) +- [serve_d](#serve_d) +- [sixtyfps](#sixtyfps) +- [slint_lsp](#slint_lsp) +- [solang](#solang) +- [solargraph](#solargraph) +- [solc](#solc) +- [solidity_ls](#solidity_ls) +- [sorbet](#sorbet) +- [sourcekit](#sourcekit) +- [sourcery](#sourcery) +- [spectral](#spectral) +- [sqlls](#sqlls) +- [sqls](#sqls) +- [stylelint_lsp](#stylelint_lsp) +- [sumneko_lua](#sumneko_lua) +- [svelte](#svelte) +- [svls](#svls) +- [tailwindcss](#tailwindcss) +- [taplo](#taplo) +- [teal_ls](#teal_ls) +- [terraform_lsp](#terraform_lsp) +- [terraformls](#terraformls) +- [texlab](#texlab) +- [tflint](#tflint) +- [theme_check](#theme_check) +- [tsserver](#tsserver) +- [typeprof](#typeprof) +- [vala_ls](#vala_ls) +- [vdmj](#vdmj) +- [verible](#verible) +- [vimls](#vimls) +- [vls](#vls) +- [volar](#volar) +- [vuels](#vuels) +- [yamlls](#yamlls) +- [zeta_note](#zeta_note) +- [zk](#zk) +- [zls](#zls) + +## als + +https://github.com/AdaCore/ada_language_server + +Installation instructions can be found [here](https://github.com/AdaCore/ada_language_server#Install). + +Can be configured by passing a "settings" object to `als.setup{}`: + +```lua +require('lspconfig').als.setup{ + settings = { + ada = { + projectFile = "project.gpr"; + scenarioVariables = { ... }; + } + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.als.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ada_language_server" } + ``` + - `filetypes` : + ```lua + { "ada" } + ``` + - `root_dir` : + ```lua + util.root_pattern("Makefile", ".git", "*.gpr", "*.adc") + ``` + + +## angularls + +https://github.com/angular/vscode-ng-language-service + +`angular-language-server` can be installed via npm `npm install -g @angular/language-server`. + +Note, that if you override the default `cmd`, you must also update `on_new_config` to set `new_config.cmd` during startup. + +```lua +local project_library_path = "/path/to/project/lib" +local cmd = {"ngserver", "--stdio", "--tsProbeLocations", project_library_path , "--ngProbeLocations", project_library_path} + +require'lspconfig'.angularls.setup{ + cmd = cmd, + on_new_config = function(new_config,new_root_dir) + new_config.cmd = cmd + end, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.angularls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ngserver", "--stdio", "--tsProbeLocations", "", "--ngProbeLocations", "" } + ``` + - `filetypes` : + ```lua + { "typescript", "html", "typescriptreact", "typescript.tsx" } + ``` + - `root_dir` : + ```lua + root_pattern("angular.json", ".git") + ``` + + +## ansiblels + +https://github.com/ansible/ansible-language-server + +Language server for the ansible configuration management tool. + +`ansible-language-server` can be installed via `npm`: + +```sh +npm install -g @ansible/ansible-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ansiblels.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ansible-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml.ansible" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + ansible = { + ansible = { + path = "ansible" + }, + ansibleLint = { + enabled = true, + path = "ansible-lint" + }, + executionEnvironment = { + enabled = false + }, + python = { + interpreterPath = "python" + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## arduino_language_server + +https://github.com/arduino/arduino-language-server + +Language server for Arduino + +The `arduino-language-server` can be installed by running: + go get -u github.com/arduino/arduino-language-server + +The `arduino-cli` tools must also be installed. Follow these instructions for your distro: + https://arduino.github.io/arduino-cli/latest/installation/ + +After installing the `arduino-cli` tools, follow these instructions for generating +a configuration file: + https://arduino.github.io/arduino-cli/latest/getting-started/#create-a-configuration-file +and make sure you install any relevant platforms libraries: + https://arduino.github.io/arduino-cli/latest/getting-started/#install-the-core-for-your-board + +The language server also requires `clangd` be installed. It will look for `clangd` by default but +the binary path can be overridden if need be. + +After all dependencies are installed you'll need to override the lspconfig command for the +language server in your setup function with the necessary configurations: + +```lua +lspconfig.arduino_language_server.setup({ + cmd = { + -- Required + "arduino-language-server", + "-cli-config", "/path/to/arduino-cli.yaml", + -- Optional + "-cli", "/path/to/arduino-cli", + "-clangd", "/path/to/clangd" + } +}) +``` + +For further instruction about configuration options, run `arduino-language-server --help`. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.arduino_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "arduino-language-server" } + ``` + - `filetypes` : + ```lua + { "arduino" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## asm_lsp + +https://github.com/bergercookie/asm-lsp + +Language Server for GAS/GO Assembly + +`asm-lsp` can be installed via cargo: +cargo install asm-lsp + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.asm_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "asm-lsp" } + ``` + - `filetypes` : + ```lua + { "asm", "vmasm" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## awk_ls + +https://github.com/Beaglefoot/awk-language-server/ + +`awk-language-server` can be installed via `npm`: +```sh +npm install -g awk-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.awk_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "awk-language-server" } + ``` + - `filetypes` : + ```lua + { "awk" } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bashls + +https://github.com/mads-hartmann/bash-language-server + +`bash-language-server` can be installed via `npm`: +```sh +npm i -g bash-language-server +``` + +Language server for bash, written using tree sitter in typescript. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bashls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "bash-language-server", "start" } + ``` + - `cmd_env` : + ```lua + { + GLOB_PATTERN = "*@(.sh|.inc|.bash|.command)" + } + ``` + - `filetypes` : + ```lua + { "sh" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## beancount + +https://github.com/polarmutex/beancount-language-server#installation + +See https://github.com/polarmutex/beancount-language-server#configuration for configuration options + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.beancount.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "beancount-langserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "beancount" } + ``` + - `init_options` : + ```lua + { + journalFile = "", + pythonPath = "python3" + } + ``` + - `root_dir` : + ```lua + root_pattern("elm.json") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bicep + +https://github.com/azure/bicep +Bicep language server + +Bicep language server can be installed by downloading and extracting a release of bicep-langserver.zip from [Bicep GitHub releases](https://github.com/Azure/bicep/releases). + +Bicep language server requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +Neovim does not have built-in support for the bicep filetype which is required for lspconfig to automatically launch the language server. + +Filetype detection can be added via an autocmd: +```lua +vim.cmd [[ autocmd BufNewFile,BufRead *.bicep set filetype=bicep ]] +``` + +**By default, bicep language server does not have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. + +```lua +local bicep_lsp_bin = "/path/to/bicep-langserver/Bicep.LangServer.dll" +require'lspconfig'.bicep.setup{ + cmd = { "dotnet", bicep_lsp_bin }; + ... +} +``` + +To download the latest release and place in /usr/local/bin/bicep-langserver: +```bash +(cd $(mktemp -d) \ + && curl -fLO https://github.com/Azure/bicep/releases/latest/download/bicep-langserver.zip \ + && rm -rf /usr/local/bin/bicep-langserver \ + && unzip -d /usr/local/bin/bicep-langserver bicep-langserver.zip) +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bicep.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "bicep" } + ``` + - `init_options` : + ```lua + {} + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## bsl_ls + + https://github.com/1c-syntax/bsl-language-server + + Language Server Protocol implementation for 1C (BSL) - 1C:Enterprise 8 and OneScript languages. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bsl_ls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "bsl", "os" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## ccls + +https://github.com/MaskRay/ccls/wiki + +ccls relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) specified +as compile_commands.json or, for simpler projects, a .ccls. +For details on how to automatically generate one using CMake look [here](https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html). Alternatively, you can use [Bear](https://github.com/rizsotto/Bear). + +Customization options are passed to ccls at initialization time via init_options, a list of available options can be found [here](https://github.com/MaskRay/ccls/wiki/Customization#initialization-options). For example: + +```lua +local lspconfig = require'lspconfig' +lspconfig.ccls.setup { + init_options = { + compilationDatabaseDirectory = "build"; + index = { + threads = 0; + }; + clang = { + excludeArgs = { "-frounding-math"} ; + }; + } +} + +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ccls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ccls" } + ``` + - `filetypes` : + ```lua + { "c", "cpp", "objc", "objcpp" } + ``` + - `offset_encoding` : + ```lua + "utf-32" + ``` + - `root_dir` : + ```lua + root_pattern("compile_commands.json", ".ccls", ".git") + ``` + - `single_file_support` : + ```lua + false + ``` + + +## clangd + +https://clangd.llvm.org/installation.html + +**NOTE:** Clang >= 11 is recommended! See [this issue for more](https://github.com/neovim/nvim-lsp/issues/23). + +clangd relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) specified as compile_commands.json, see https://clangd.llvm.org/installation#compile_commandsjson + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.clangd.setup{} +``` +**Commands:** +- ClangdSwitchSourceHeader: Switch between source/header + +**Default values:** + - `capabilities` : + ```lua + default capabilities, with offsetEncoding utf-8 + ``` + - `cmd` : + ```lua + { "clangd" } + ``` + - `filetypes` : + ```lua + { "c", "cpp", "objc", "objcpp" } + ``` + - `root_dir` : + ```lua + root_pattern( + '.clangd', + '.clang-tidy', + '.clang-format', + 'compile_commands.json', + 'compile_flags.txt', + 'configure.ac', + '.git' + ) + + ``` + - `single_file_support` : + ```lua + true + ``` + + +## clarity_lsp + +`clarity-lsp` is a language server for the Clarity language. Clarity is a decidable smart contract language that optimizes for predictability and security. Smart contracts allow developers to encode essential business logic on a blockchain. + +To learn how to configure the clarity language server, see the [clarity-lsp documentation](https://github.com/hirosystems/clarity-lsp). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.clarity_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "clarity-lsp" } + ``` + - `filetypes` : + ```lua + { "clar", "clarity" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## clojure_lsp + +https://github.com/snoe/clojure-lsp + +Clojure Language Server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.clojure_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "clojure-lsp" } + ``` + - `filetypes` : + ```lua + { "clojure", "edn" } + ``` + - `root_dir` : + ```lua + root_pattern("project.clj", "deps.edn", "build.boot", "shadow-cljs.edn", ".git") + ``` + + +## cmake + +https://github.com/regen100/cmake-language-server + +CMake LSP Implementation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cmake.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cmake-language-server" } + ``` + - `filetypes` : + ```lua + { "cmake" } + ``` + - `init_options` : + ```lua + { + buildDirectory = "build" + } + ``` + - `root_dir` : + ```lua + root_pattern(".git", "compile_commands.json", "build") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## codeqlls + +Reference: +https://help.semmle.com/codeql/codeql-cli.html + +Binaries: +https://github.com/github/codeql-cli-binaries + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.codeqlls.setup{} +``` + + +**Default values:** + - `before_init` : + ```lua + see source file + ``` + - `cmd` : + ```lua + { "codeql", "execute", "language-server", "--check-errors", "ON_CHANGE", "-q" } + ``` + - `filetypes` : + ```lua + { "ql" } + ``` + - `log_level` : + ```lua + 2 + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + search_path = "list containing all search paths, eg: '~/codeql-home/codeql-repo'" + } + ``` + + +## crystalline + +https://github.com/elbywan/crystalline + +Crystal language server. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.crystalline.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "crystalline" } + ``` + - `filetypes` : + ```lua + { "crystal" } + ``` + - `root_dir` : + ```lua + root_pattern('shard.yml', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## csharp_ls + +https://github.com/razzmatazz/csharp-language-server + +Language Server for C#. + +csharp-ls requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +The preferred way to install csharp-ls is with `dotnet tool install --global csharp-ls`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.csharp_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "csharp-ls" } + ``` + - `filetypes` : + ```lua + { "cs" } + ``` + - `init_options` : + ```lua + { + AutomaticWorkspaceInit = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## cssls + + +https://github.com/hrsh7th/vscode-langservers-extracted + +`css-languageserver` can be installed via `npm`: + +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-css-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.cssls.setup { + capabilities = capabilities, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cssls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vscode-css-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "css", "scss", "less" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") or bufdir + ``` + - `settings` : + ```lua + { + css = { + validate = true + }, + less = { + validate = true + }, + scss = { + validate = true + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## cssmodules_ls + +https://github.com/antonk52/cssmodules-language-server + +Language server for autocompletion and go-to-definition functionality for CSS modules. + +You can install cssmodules-language-server via npm: +```sh +npm install -g cssmodules-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cssmodules_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cssmodules-language-server" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "typescript", "typescriptreact" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json") + ``` + + +## cucumber_language_server + +https://cucumber.io +https://github.com/cucumber/common +https://www.npmjs.com/package/@cucumber/language-server + +Language server for Cucumber. + +`cucumber-language-server` can be installed via `npm`: +```sh +npm install -g @cucumber/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cucumber_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cucumber-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "cucumber" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## dartls + +https://github.com/dart-lang/sdk/tree/master/pkg/analysis_server/tool/lsp_spec + +Language server for dart. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dartls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dart", "./snapshots/analysis_server.dart.snapshot", "--lsp" } + ``` + - `filetypes` : + ```lua + { "dart" } + ``` + - `init_options` : + ```lua + { + closingLabels = true, + flutterOutline = true, + onlyAnalyzeProjectsWithOpenFiles = true, + outline = true, + suggestFromUnimportedLibraries = true + } + ``` + - `root_dir` : + ```lua + root_pattern("pubspec.yaml") + ``` + - `settings` : + ```lua + { + dart = { + completeFunctionCalls = true, + showTodos = true + } + } + ``` + + +## denols + +https://github.com/denoland/deno + +Deno's built-in language server + +To approrpiately highlight codefences returned from denols, you will need to augment vim.g.markdown_fenced languages + in your init.lua. Example: + +```lua +vim.g.markdown_fenced_languages = { + "ts=typescript" +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.denols.setup{} +``` +**Commands:** +- DenolsCache: Cache a module and all of its dependencies. + +**Default values:** + - `cmd` : + ```lua + { "deno", "lsp" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" } + ``` + - `handlers` : + ```lua + { + ["textDocument/definition"] = , + ["textDocument/references"] = + } + ``` + - `init_options` : + ```lua + { + enable = true, + lint = false, + unstable = false + } + ``` + - `root_dir` : + ```lua + root_pattern("deno.json", "deno.jsonc", "tsconfig.json", ".git") + ``` + + +## dhall_lsp_server + +https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-lsp-server + +language server for dhall + +`dhall-lsp-server` can be installed via cabal: +```sh +cabal install dhall-lsp-server +``` +prebuilt binaries can be found [here](https://github.com/dhall-lang/dhall-haskell/releases). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dhall_lsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dhall-lsp-server" } + ``` + - `filetypes` : + ```lua + { "dhall" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## diagnosticls + +https://github.com/iamcco/diagnostic-languageserver + +Diagnostic language server integrate with linters. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.diagnosticls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "diagnostic-languageserver", "--stdio" } + ``` + - `filetypes` : + ```lua + Empty by default, override to add filetypes + ``` + - `root_dir` : + ```lua + Vim's starting directory + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dockerls + +https://github.com/rcjsuen/dockerfile-language-server-nodejs + +`docker-langserver` can be installed via `npm`: +```sh +npm install -g dockerfile-language-server-nodejs +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dockerls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "docker-langserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "dockerfile" } + ``` + - `root_dir` : + ```lua + root_pattern("Dockerfile") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dotls + +https://github.com/nikeee/dot-language-server + +`dot-language-server` can be installed via `npm`: +```sh +npm install -g dot-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dotls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dot-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "dot" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## efm + +https://github.com/mattn/efm-langserver + +General purpose Language Server that can use specified error message format generated from specified command. + +Requires at minimum EFM version [v0.0.38](https://github.com/mattn/efm-langserver/releases/tag/v0.0.38) to support +launching the language server on single files. If on an older version of EFM, disable single file support: + +```lua +require('lspconfig')['efm'].setup{ + settings = ..., -- You must populate this according to the EFM readme + filetypes = ..., -- Populate this according to the note below + single_file_support = false, -- This is the important line for supporting older version of EFM +} +``` + +Note: In order for neovim's built-in language server client to send the appropriate `languageId` to EFM, **you must +specify `filetypes` in your call to `setup{}`**. Otherwise `lspconfig` will launch EFM on the `BufEnter` instead +of the `FileType` autocommand, and the `filetype` variable used to populate the `languageId` will not yet be set. + +```lua +require('lspconfig')['efm'].setup{ + settings = ..., -- You must populate this according to the EFM readme + filetypes = { 'python','cpp','lua' } +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.efm.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "efm-langserver" } + ``` + - `root_dir` : + ```lua + util.root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## elixirls + +https://github.com/elixir-lsp/elixir-ls + +`elixir-ls` can be installed by following the instructions [here](https://github.com/elixir-lsp/elixir-ls#building-and-running). + +```bash +curl -fLO https://github.com/elixir-lsp/elixir-ls/releases/latest/download/elixir-ls.zip +unzip elixir-ls.zip -d /path/to/elixir-ls +# Unix +chmod +x /path/to/elixir-ls/language_server.sh +``` + +**By default, elixir-ls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of your unzipped elixir-ls. + +```lua +require'lspconfig'.elixirls.setup{ + -- Unix + cmd = { "/path/to/elixir-ls/language_server.sh" }; + -- Windows + cmd = { "/path/to/elixir-ls/language_server.bat" }; + ... +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.elixirls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "elixir", "eelixir" } + ``` + - `root_dir` : + ```lua + root_pattern("mix.exs", ".git") or vim.loop.os_homedir() + ``` + + +## elmls + +https://github.com/elm-tooling/elm-language-server#installation + +If you don't want to use Nvim to install it, then you can use: +```sh +npm install -g elm elm-test elm-format @elm-tooling/elm-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.elmls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "elm-language-server" } + ``` + - `filetypes` : + ```lua + { "elm" } + ``` + - `init_options` : + ```lua + { + elmAnalyseTrigger = "change" + } + ``` + - `root_dir` : + ```lua + root_pattern("elm.json") + ``` + + +## ember + +https://github.com/lifeart/ember-language-server + +`ember-language-server` can be installed via `npm`: + +```sh +npm install -g @lifeart/ember-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ember.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ember-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "handlebars", "typescript", "javascript" } + ``` + - `root_dir` : + ```lua + root_pattern("ember-cli-build.js", ".git") + ``` + + +## emmet_ls + +https://github.com/aca/emmet-ls + +Package can be installed via `npm`: +```sh +npm install -g emmet-ls +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.emmet_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "emmet-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "html", "css" } + ``` + - `root_dir` : + ```lua + git root + ``` + - `single_file_support` : + ```lua + true + ``` + + +## erlangls + +https://erlang-ls.github.io + +Language Server for Erlang. + +Clone [erlang_ls](https://github.com/erlang-ls/erlang_ls) +Compile the project with `make` and copy resulting binaries somewhere in your $PATH eg. `cp _build/*/bin/* ~/local/bin` + +Installation instruction can be found [here](https://github.com/erlang-ls/erlang_ls). + +Installation requirements: + - [Erlang OTP 21+](https://github.com/erlang/otp) + - [rebar3 3.9.1+](https://github.com/erlang/rebar3) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.erlangls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "erlang_ls" } + ``` + - `filetypes` : + ```lua + { "erlang" } + ``` + - `root_dir` : + ```lua + root_pattern('rebar.config', 'erlang.mk', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## esbonio + +https://github.com/swyddfa/esbonio + +Esbonio is a language server for [Sphinx](https://www.sphinx-doc.org/en/master/) documentation projects. +The language server can be installed via pip + +``` +pip install esbonio +``` + +Since Sphinx is highly extensible you will get best results if you install the language server in the same +Python environment as the one used to build your documentation. To ensure that the correct Python environment +is picked up, you can either launch `nvim` with the correct environment activated. + +``` +source env/bin/activate +nvim +``` + +Or you can modify the default `cmd` to include the full path to the Python interpreter. + +```lua +require'lspconfig'.esbonio.setup { + cmd = { '/path/to/virtualenv/bin/python', '-m', 'esbonio' } +} +``` + +Esbonio supports a number of config values passed as `init_options` on startup, for example. + +```lua +require'lspconfig'.esbonio.setup { + init_options = { + server = { + logLevel = "debug" + }, + sphinx = { + confDir = "/path/to/docs", + srcDir = "${confDir}/../docs-src" + } +} +``` + +A full list and explanation of the available options can be found [here](https://swyddfa.github.io/esbonio/docs/lsp/editors/index.html) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.esbonio.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "python3", "-m", "esbonio" } + ``` + - `filetypes` : + ```lua + { "rst" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## eslint + +https://github.com/hrsh7th/vscode-langservers-extracted + +vscode-eslint-language-server: A linting engine for JavaScript / Typescript + +`vscode-eslint-language-server` can be installed via `npm`: +```sh +npm i -g vscode-langservers-extracted +``` + +vscode-eslint-language-server provides an EslintFixAll command that can be used to format document on save +```vim +autocmd BufWritePre *.tsx,*.ts,*.jsx,*.js EslintFixAll +``` + +See [vscode-eslint](https://github.com/microsoft/vscode-eslint/blob/55871979d7af184bf09af491b6ea35ebd56822cf/server/src/eslintServer.ts#L216-L229) for configuration options. + +Additional messages you can handle: eslint/noConfig +Messages already handled in lspconfig: eslint/openDoc, eslint/confirmESLintExecution, eslint/probeFailed, eslint/noLibrary + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.eslint.setup{} +``` +**Commands:** +- EslintFixAll: Fix all eslint problems for this buffer + +**Default values:** + - `cmd` : + ```lua + { "vscode-eslint-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx", "vue" } + ``` + - `handlers` : + ```lua + { + ["eslint/confirmESLintExecution"] = , + ["eslint/noLibrary"] = , + ["eslint/openDoc"] = , + ["eslint/probeFailed"] = + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + codeAction = { + disableRuleComment = { + enable = true, + location = "separateLine" + }, + showDocumentation = { + enable = true + } + }, + codeActionOnSave = { + enable = false, + mode = "all" + }, + format = true, + nodePath = "", + onIgnoredFiles = "off", + packageManager = "npm", + quiet = false, + rulesCustomizations = {}, + run = "onType", + useESLintClass = false, + validate = "on", + workingDirectory = { + mode = "location" + } + } + ``` + + +## flow + +https://flow.org/ +https://github.com/facebook/flow + +See below for how to setup Flow itself. +https://flow.org/en/docs/install/ + +See below for lsp command options. + +```sh +npx flow lsp --help +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.flow.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "npx", "--no-install", "flow", "lsp" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx" } + ``` + - `root_dir` : + ```lua + root_pattern(".flowconfig") + ``` + + +## flux_lsp + +https://github.com/influxdata/flux-lsp +`flux-lsp` can be installed via `cargo`: +```sh +cargo install --git https://github.com/influxdata/flux-lsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.flux_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "flux-lsp" } + ``` + - `filetypes` : + ```lua + { "flux" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## foam_ls + +https://github.com/FoamScience/foam-language-server + +`foam-language-server` can be installed via `npm` +```sh +npm install -g foam-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.foam_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "foam-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "foam", "OpenFOAM" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## fortls + +https://github.com/hansec/fortran-language-server + +Fortran Language Server for the Language Server Protocol + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fortls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fortls" } + ``` + - `filetypes` : + ```lua + { "fortran" } + ``` + - `root_dir` : + ```lua + root_pattern(".fortls") + ``` + - `settings` : + ```lua + { + nthreads = 1 + } + ``` + + +## fsautocomplete + +https://github.com/fsharp/FsAutoComplete + +Language Server for F# provided by FsAutoComplete (FSAC). + +FsAutoComplete requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +The preferred way to install FsAutoComplete is with `dotnet tool install --global fsautocomplete`. + +Instructions to compile from source are found on the main [repository](https://github.com/fsharp/FsAutoComplete). + +You may also need to configure the filetype as Vim defaults to Forth for `*.fs` files: + +`autocmd BufNewFile,BufRead *.fs,*.fsx,*.fsi set filetype=fsharp` + +This is automatically done by plugins such as [PhilT/vim-fsharp](https://github.com/PhilT/vim-fsharp), [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp), and [adelarsq/neofsharp.vim](https://github.com/adelarsq/neofsharp.vim). + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fsautocomplete.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fsautocomplete", "--background-service-enabled" } + ``` + - `filetypes` : + ```lua + { "fsharp" } + ``` + - `init_options` : + ```lua + { + AutomaticWorkspaceInit = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## fstar + +https://github.com/FStarLang/FStar + +LSP support is included in FStar. Make sure `fstar.exe` is in your PATH. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fstar.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fstar.exe", "--lsp" } + ``` + - `filetypes` : + ```lua + { "fstar" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## gdscript + +https://github.com/godotengine/godot + +Language server for GDScript, used by Godot Engine. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gdscript.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nc", "localhost", "6008" } + ``` + - `filetypes` : + ```lua + { "gd", "gdscript", "gdscript3" } + ``` + - `root_dir` : + ```lua + util.root_pattern("project.godot", ".git") + ``` + + +## ghcide + +https://github.com/digital-asset/ghcide + +A library for building Haskell IDE tooling. +"ghcide" isn't for end users now. Use "haskell-language-server" instead of "ghcide". + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ghcide.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ghcide", "--lsp" } + ``` + - `filetypes` : + ```lua + { "haskell", "lhaskell" } + ``` + - `root_dir` : + ```lua + root_pattern("stack.yaml", "hie-bios", "BUILD.bazel", "cabal.config", "package.yaml") + ``` + + +## golangci_lint_ls + +Combination of both lint server and client + +https://github.com/nametake/golangci-lint-langserver +https://github.com/golangci/golangci-lint + + +Installation of binaries needed is done via + +``` +go install github.com/nametake/golangci-lint-langserver@latest +go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.42.1 +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.golangci_lint_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "golangci-lint-langserver" } + ``` + - `filetypes` : + ```lua + { "go", "gomod" } + ``` + - `init_options` : + ```lua + { + command = { "golangci-lint", "run", "--out-format", "json" } + } + ``` + - `root_dir` : + ```lua + root_pattern('go.work') or root_pattern('go.mod', '.golangci.yaml', '.git') + ``` + + +## gopls + +https://github.com/golang/tools/tree/master/gopls + +Google's lsp server for golang. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gopls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "gopls" } + ``` + - `filetypes` : + ```lua + { "go", "gomod", "gotmpl" } + ``` + - `root_dir` : + ```lua + root_pattern("go.mod", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## gradle_ls + +https://github.com/microsoft/vscode-gradle + +Microsoft's lsp server for gradle files + +If you're setting this up manually, build vscode-gradle using `./gradlew installDist` and point `cmd` to the `gradle-language-server` generated in the build directory + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gradle_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "gradle-language-server" } + ``` + - `filetypes` : + ```lua + { "groovy" } + ``` + - `root_dir` : + ```lua + root_pattern("settings.gradle") + ``` + + +## grammarly + +https://github.com/emacs-grammarly/unofficial-grammarly-language-server + +`unofficial-grammarly-language-server` can be installed via `npm`: + +```sh +npm i -g @emacs-grammarly/unofficial-grammarly-language-server +``` + +WARNING: Since this language server uses Grammarly's API, any document you open with it running is shared with them. Please evaluate their [privacy policy](https://www.grammarly.com/privacy-policy) before using this. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.grammarly.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "unofficial-grammarly-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `handlers` : + ```lua + { + ["$/updateDocumentState"] = + } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## graphql + +https://github.com/graphql/graphiql/tree/main/packages/graphql-language-service-cli + +`graphql-lsp` can be installed via `npm`: + +```sh +npm install -g graphql-language-service-cli +``` + +Note that you must also have [the graphql package](https://github.com/graphql/graphql-js) installed and create a [GraphQL config file](https://www.graphql-config.com/docs/user/user-introduction). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.graphql.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "graphql-lsp", "server", "-m", "stream" } + ``` + - `filetypes` : + ```lua + { "graphql", "typescriptreact", "javascriptreact" } + ``` + - `root_dir` : + ```lua + root_pattern('.git', '.graphqlrc*', '.graphql.config.*') + ``` + + +## groovyls + +https://github.com/prominic/groovy-language-server.git + +Requirements: + - Linux/macOS (for now) + - Java 11+ + +`groovyls` can be installed by following the instructions [here](https://github.com/prominic/groovy-language-server.git#build). + +If you have installed groovy language server, you can set the `cmd` custom path as follow: + +```lua +require'lspconfig'.groovyls.setup{ + -- Unix + cmd = { "java", "-jar", "path/to/groovyls/groovy-language-server-all.jar" }, + ... +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.groovyls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "java", "-jar", "groovy-language-server-all.jar" } + ``` + - `filetypes` : + ```lua + { "groovy" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## haxe_language_server + +https://github.com/vshaxe/haxe-language-server + +The Haxe language server can be built by running the following commands from +the project's root directory: + + npm install + npx lix run vshaxe-build -t language-server + +This will create `bin/server.js`. Note that the server requires Haxe 3.4.0 or +higher. + +After building the language server, set the `cmd` setting in your setup +function: + +```lua +lspconfig.haxe_language_server.setup({ + cmd = {"node", "path/to/bin/server.js"}, +}) +``` + +By default, an HXML compiler arguments file named `build.hxml` is expected in +your project's root directory. If your file is named something different, +specify it using the `init_options.displayArguments` setting. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.haxe_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "haxe-language-server" } + ``` + - `filetypes` : + ```lua + { "haxe" } + ``` + - `init_options` : + ```lua + { + displayArguments = { "build.hxml" } + } + ``` + - `root_dir` : + ```lua + root_pattern("*.hxml") + ``` + - `settings` : + ```lua + { + haxe = { + executable = "haxe" + } + } + ``` + + +## hdl_checker + +https://github.com/suoto/hdl_checker +Language server for hdl-checker. +Install using: `pip install hdl-checker --upgrade` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hdl_checker.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hdl_checker", "--lsp" } + ``` + - `filetypes` : + ```lua + { "vhdl", "verilog", "systemverilog" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## hhvm + +Language server for programs written in Hack +https://hhvm.com/ +https://github.com/facebook/hhvm +See below for how to setup HHVM & typechecker: +https://docs.hhvm.com/hhvm/getting-started/getting-started + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hhvm.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hh_client", "lsp" } + ``` + - `filetypes` : + ```lua + { "php", "hack" } + ``` + - `root_dir` : + ```lua + root_pattern(".hhconfig") + ``` + + +## hie + +https://github.com/haskell/haskell-ide-engine + +the following init_options are supported (see https://github.com/haskell/haskell-ide-engine#configuration): +```lua +init_options = { + languageServerHaskell = { + hlintOn = bool; + maxNumberOfProblems = number; + diagnosticsDebounceDuration = number; + liquidOn = bool (default false); + completionSnippetsOn = bool (default true); + formatOnImportOn = bool (default true); + formattingProvider = string (default "brittany", alternate "floskell"); + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hie.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hie-wrapper", "--lsp" } + ``` + - `filetypes` : + ```lua + { "haskell" } + ``` + - `root_dir` : + ```lua + root_pattern("stack.yaml", "package.yaml", ".git") + ``` + + +## hls + +https://github.com/haskell/haskell-language-server + +Haskell Language Server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "haskell-language-server-wrapper", "--lsp" } + ``` + - `filetypes` : + ```lua + { "haskell", "lhaskell" } + ``` + - `lspinfo` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml") + ``` + - `settings` : + ```lua + { + haskell = { + formattingProvider = "ormolu" + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## hoon_ls + +https://github.com/urbit/hoon-language-server + +A language server for Hoon. + +The language server can be installed via `npm install -g @hoon-language-server` + +Start a fake ~zod with `urbit -F zod`. +Start the language server at the Urbit Dojo prompt with: `|start %language-server` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hoon_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hoon-language-server" } + ``` + - `filetypes` : + ```lua + { "hoon" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## html + +https://github.com/hrsh7th/vscode-langservers-extracted + +`vscode-html-language-server` can be installed via `npm`: +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-html-language-server` only provides completions when snippet support is enabled. +To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +The code-formatting feature of the lsp can be controlled with the `provideFormatter` option. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.html.setup { + capabilities = capabilities, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.html.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vscode-html-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "html" } + ``` + - `init_options` : + ```lua + { + configurationSection = { "html", "css", "javascript" }, + embeddedLanguages = { + css = true, + javascript = true + }, + provideFormatter = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## idris2_lsp + +https://github.com/idris-community/idris2-lsp + +The Idris 2 language server. + +Plugins for the Idris 2 filetype include +[Idris2-Vim](https://github.com/edwinb/idris2-vim) (fewer features, stable) and +[Nvim-Idris2](https://github.com/ShinKage/nvim-idris2) (cutting-edge, +experimental). + +Idris2-Lsp requires a build of Idris 2 that includes the "Idris 2 API" package. +Package managers with known support for this build include the +[AUR](https://aur.archlinux.org/packages/idris2-api-git/) and +[Homebrew](https://formulae.brew.sh/formula/idris2#default). + +If your package manager does not support the Idris 2 API, you will need to build +Idris 2 from source. Refer to the +[the Idris 2 installation instructions](https://github.com/idris-lang/Idris2/blob/main/INSTALL.md) +for details. Steps 5 and 8 are listed as "optional" in that guide, but they are +necessary in order to make the Idris 2 API available. + +You need to install a version of Idris2-Lsp that is compatible with your +version of Idris 2. There should be a branch corresponding to every released +Idris 2 version after v0.4.0. Use the latest commit on that branch. For example, +if you have Idris v0.5.1, you should use the v0.5.1 branch of Idris2-Lsp. + +If your Idris 2 version is newer than the newest Idris2-Lsp branch, use the +latest commit on the `master` branch, and set a reminder to check the Idris2-Lsp +repo for the release of a compatible versioned branch. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.idris2_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "idris2-lsp" } + ``` + - `filetypes` : + ```lua + { "idris2" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## intelephense + +https://intelephense.com/ + +`intelephense` can be installed via `npm`: +```sh +npm install -g intelephense +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.intelephense.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "intelephense", "--stdio" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("composer.json", ".git") + ``` + + +## java_language_server + +https://github.com/georgewfraser/java-language-server + +Java language server + +Point `cmd` to `lang_server_linux.sh` or the equivalent script for macOS/Windows provided by java-language-server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.java_language_server.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "java" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## jdtls + +https://projects.eclipse.org/projects/eclipse.jdt.ls + +Language server for Java. + +IMPORTANT: If you want all the features jdtls has to offer, [nvim-jdtls](https://github.com/mfussenegger/nvim-jdtls) +is highly recommended. If all you need is diagnostics, completion, imports, gotos and formatting and some code actions +you can keep reading here. + +For manual installation you can download precompiled binaries from the +[official downloads site](http://download.eclipse.org/jdtls/snapshots/?d) + +Due to the nature of java, settings cannot be inferred. Please set the following +environmental variables to match your installation. If you need per-project configuration +[direnv](https://github.com/direnv/direnv) is highly recommended. + +```bash +# Mandatory: +# .bashrc +export JDTLS_HOME=/path/to/jdtls_root # Directory with the plugin and configs directories + +# Optional: +export JAVA_HOME=/path/to/java_home # In case you don't have java in path or want to use a version in particular +export WORKSPACE=/path/to/workspace # Defaults to $HOME/workspace +``` +```lua + -- init.lua + require'lspconfig'.jdtls.setup{} +``` + +For automatic installation you can use the following unofficial installers/launchers under your own risk: + - [jdtls-launcher](https://github.com/eruizc-dev/jdtls-launcher) (Includes lombok support by default) + ```lua + -- init.lua + require'lspconfig'.jdtls.setup{ cmd = { 'jdtls' } } + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jdtls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "/usr/lib/jvm/temurin-11-jdk-amd64/bin/java", "-Declipse.application=org.eclipse.jdt.ls.core.id1", "-Dosgi.bundles.defaultStartLevel=4", "-Declipse.product=org.eclipse.jdt.ls.core.product", "-Dlog.protocol=true", "-Dlog.level=ALL", "-Xms1g", "-Xmx2G", "--add-modules=ALL-SYSTEM", "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "-jar", "/plugins/org.eclipse.equinox.launcher_*.jar", "-configuration", "config_linux", "-data", "/home/runner/workspace" } + ``` + - `filetypes` : + ```lua + { "java" } + ``` + - `handlers` : + ```lua + { + ["language/status"] = , + ["textDocument/codeAction"] = , + ["textDocument/rename"] = , + ["workspace/applyEdit"] = + } + ``` + - `init_options` : + ```lua + { + jvm_args = {}, + workspace = "/home/runner/workspace" + } + ``` + - `root_dir` : + ```lua + { + -- Single-module projects + { + 'build.xml', -- Ant + 'pom.xml', -- Maven + 'settings.gradle', -- Gradle + 'settings.gradle.kts', -- Gradle + }, + -- Multi-module projects + { 'build.gradle', 'build.gradle.kts' }, + } or vim.fn.getcwd() + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jedi_language_server + +https://github.com/pappasam/jedi-language-server + +`jedi-language-server`, a language server for Python, built on top of jedi + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jedi_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "jedi-language-server" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + vim's starting directory + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jsonls + +https://github.com/hrsh7th/vscode-langservers-extracted + +vscode-json-language-server, a language server for JSON and JSON schema + +`vscode-json-language-server` can be installed via `npm`: +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-json-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.jsonls.setup { + capabilities = capabilities, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jsonls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vscode-json-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "json", "jsonc" } + ``` + - `init_options` : + ```lua + { + provideFormatter = true + } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jsonnet_ls + +https://github.com/grafana/jsonnet-language-server + +A Language Server Protocol (LSP) server for Jsonnet. + +The language server can be installed with `go`: +```sh +go install github.com/grafana/jsonnet-language-server@latest +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jsonnet_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "jsonnet-language-server" } + ``` + - `filetypes` : + ```lua + { "jsonnet", "libsonnet" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("jsonnetfile.json") + ``` + + +## julials + +https://github.com/julia-vscode/julia-vscode + +LanguageServer.jl can be installed with `julia` and `Pkg`: +```sh +julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.add("LanguageServer")' +``` +where `~/.julia/environments/nvim-lspconfig` is the location where +the default configuration expects LanguageServer.jl to be installed. + +To update an existing install, use the following command: +```sh +julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.update()' +``` + +Note: In order to have LanguageServer.jl pick up installed packages or dependencies in a +Julia project, you must make sure that the project is instantiated: +```sh +julia --project=/path/to/my/project -e 'using Pkg; Pkg.instantiate()' +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.julials.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "julia", "--startup-file=no", "--history-file=no", "-e", ' # Load LanguageServer.jl: attempt to load from ~/.julia/environments/nvim-lspconfig\n # with the regular load path as a fallback\n ls_install_path = joinpath(\n get(DEPOT_PATH, 1, joinpath(homedir(), ".julia")),\n "environments", "nvim-lspconfig"\n )\n pushfirst!(LOAD_PATH, ls_install_path)\n using LanguageServer\n popfirst!(LOAD_PATH)\n depot_path = get(ENV, "JULIA_DEPOT_PATH", "")\n project_path = let\n dirname(something(\n ## 1. Finds an explicitly set project (JULIA_PROJECT)\n Base.load_path_expand((\n p = get(ENV, "JULIA_PROJECT", nothing);\n p === nothing ? nothing : isempty(p) ? nothing : p\n )),\n ## 2. Look for a Project.toml file in the current working directory,\n ## or parent directories, with $HOME as an upper boundary\n Base.current_project(),\n ## 3. First entry in the load path\n get(Base.load_path(), 1, nothing),\n ## 4. Fallback to default global environment,\n ## this is more or less unreachable\n Base.load_path_expand("@v#.#"),\n ))\n end\n @info "Running language server" VERSION pwd() project_path depot_path\n server = LanguageServer.LanguageServerInstance(stdin, stdout, project_path, depot_path)\n server.runlinter = true\n run(server)\n ' } + ``` + - `filetypes` : + ```lua + { "julia" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## kotlin_language_server + + A kotlin language server which was developed for internal usage and + released afterwards. Maintaining is not done by the original author, + but by fwcd. + + It is built via gradle and developed on github. + Source and additional description: + https://github.com/fwcd/kotlin-language-server + + This server requires vim to be aware of the kotlin-filetype. + You could refer for this capability to: + https://github.com/udalov/kotlin-vim (recommended) + Note that there is no LICENSE specified yet. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.kotlin_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "kotlin-language-server" } + ``` + - `filetypes` : + ```lua + { "kotlin" } + ``` + - `root_dir` : + ```lua + root_pattern("settings.gradle") + ``` + + +## lean3ls + +https://github.com/leanprover/lean-client-js/tree/master/lean-language-server + +Lean installation instructions can be found +[here](https://leanprover-community.github.io/get_started.html#regular-install). + +Once Lean is installed, you can install the Lean 3 language server by running +```sh +npm install -g lean-language-server +``` + +Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim), +that plugin fully handles the setup of the Lean language server, +and you shouldn't set up `lean3ls` both with it and `lspconfig`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lean3ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lean-language-server", "--stdio", "--", "-M", "4096", "-T", "100000" } + ``` + - `filetypes` : + ```lua + { "lean3" } + ``` + - `offset_encoding` : + ```lua + "utf-32" + ``` + - `root_dir` : + ```lua + root_pattern("leanpkg.toml") or root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## leanls + +https://github.com/leanprover/lean4 + +Lean installation instructions can be found +[here](https://leanprover-community.github.io/get_started.html#regular-install). + +The Lean 4 language server is built-in with a Lean 4 install +(and can be manually run with, e.g., `lean --server`). + +Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim), +that plugin fully handles the setup of the Lean language server, +and you shouldn't set up `leanls` both with it and `lspconfig`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.leanls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lake", "serve", "--" } + ``` + - `filetypes` : + ```lua + { "lean" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `options` : + ```lua + { + no_lake_lsp_cmd = { "lean", "--server" } + } + ``` + - `root_dir` : + ```lua + root_pattern("lakefile.lean", "lean-toolchain", "leanpkg.toml", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## lelwel_ls + +https://github.com/0x2a-42/lelwel + +Language server for lelwel grammars. + +You can install `lelwel-ls` via cargo: +```sh +cargo install --features="lsp" lelwel +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lelwel_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lelwel-ls" } + ``` + - `filetypes` : + ```lua + { "llw" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## lemminx + +https://github.com/eclipse/lemminx + +The easiest way to install the server is to get a binary at https://download.jboss.org/jbosstools/vscode/stable/lemminx-binary/ and place it in your PATH. + +NOTE to macOS users: Binaries from unidentified developers are blocked by default. If you trust the downloaded binary from jboss.org, run it once, cancel the prompt, then remove the binary from Gatekeeper quarantine with `xattr -d com.apple.quarantine lemminx`. It should now run without being blocked. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lemminx.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lemminx" } + ``` + - `filetypes` : + ```lua + { "xml", "xsd", "xsl", "xslt", "svg" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ltex + +https://github.com/valentjn/ltex-ls + +LTeX Language Server: LSP language server for LanguageTool 🔍✔️ with support for LaTeX 🎓, Markdown 📝, and others + +To install, download the latest [release](https://github.com/valentjn/ltex-ls/releases) and ensure `ltex-ls` is on your path. + +To support org files or R sweave, users can define a custom filetype autocommand (or use a plugin which defines these filetypes): + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.org set filetype=org ]] +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ltex.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ltex-ls" } + ``` + - `filetypes` : + ```lua + { "bib", "gitcommit", "markdown", "org", "plaintex", "rst", "rnoweb", "tex" } + ``` + - `get_language_id` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## metals + +https://scalameta.org/metals/ + +Scala language server with rich IDE features. + +See full instructions in the Metals documentation: + +https://scalameta.org/metals/docs/editors/vim.html#using-an-alternative-lsp-client + +Note: that if you're using [nvim-metals](https://github.com/scalameta/nvim-metals), that plugin fully handles the setup and installation of Metals, and you shouldn't set up Metals both with it and `lspconfig`. + +To install Metals, make sure to have [coursier](https://get-coursier.io/docs/cli-installation) installed, and once you do you can install the latest Metals with `cs install metals`. You can also manually bootstrap Metals with the following command. + +```bash +cs bootstrap \ + --java-opt -Xss4m \ + --java-opt -Xms100m \ + org.scalameta:metals_2.12: \ + -r bintray:scalacenter/releases \ + -r sonatype:snapshots \ + -o /usr/local/bin/metals -f +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.metals.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "metals" } + ``` + - `filetypes` : + ```lua + { "scala" } + ``` + - `init_options` : + ```lua + { + compilerOptions = { + snippetAutoIndent = false + }, + isHttpEnabled = true, + statusBarProvider = "show-message" + } + ``` + - `message_level` : + ```lua + 4 + ``` + - `root_dir` : + ```lua + util.root_pattern("build.sbt", "build.sc", "build.gradle", "pom.xml") + ``` + + +## mint + +https://www.mint-lang.com + +Install Mint using the [instructions](https://www.mint-lang.com/install). +The language server is included since version 0.12.0. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mint.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mint", "ls" } + ``` + - `filetypes` : + ```lua + { "mint" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## mm0_ls + +https://github.com/digama0/mm0 + +Language Server for the metamath-zero theorem prover. + +Requires [mm0-rs](https://github.com/digama0/mm0/tree/master/mm0-rs) to be installed +and available on the `PATH`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mm0_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mm0-rs", "server" } + ``` + - `filetypes` : + ```lua + { "metamath-zero" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nickel_ls + +Nickel Language Server + +https://github.com/tweag/nickel + +`nls` can be installed with nix, or cargo, from the Nickel repository. +```sh +git clone https://github.com/tweag/nickel.git +``` + +Nix: +```sh +cd nickel +nix-env -f . -i +``` + +cargo: +```sh +cd nickel/lsp/nls +cargo install --path . +``` + +In order to have lspconfig detect Nickel filetypes (a prequisite for autostarting a server), +install the [Nickel vim plugin](https://github.com/nickel-lang/vim-nickel). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nickel_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nls" } + ``` + - `filetypes` : + ```lua + { "ncl", "nickel" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## nimls + +https://github.com/PMunch/nimlsp +`nimlsp` can be installed via the `nimble` package manager: +```sh +nimble install nimlsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nimls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nimlsp" } + ``` + - `filetypes` : + ```lua + { "nim" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ocamlls + +https://github.com/ocaml-lsp/ocaml-language-server + +`ocaml-language-server` can be installed via `npm` +```sh +npm install -g ocaml-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ocamlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ocaml-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "ocaml", "reason" } + ``` + - `root_dir` : + ```lua + root_pattern("*.opam", "esy.json", "package.json") + ``` + + +## ocamllsp + +https://github.com/ocaml/ocaml-lsp + +`ocaml-lsp` can be installed as described in [installation guide](https://github.com/ocaml/ocaml-lsp#installation). + +To install the lsp server in a particular opam switch: +```sh +opam pin add ocaml-lsp-server https://github.com/ocaml/ocaml-lsp.git +opam install ocaml-lsp-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ocamllsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ocamllsp" } + ``` + - `filetypes` : + ```lua + { "ocaml", "ocaml.menhir", "ocaml.interface", "ocaml.ocamllex", "reason" } + ``` + - `get_language_id` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("*.opam", "esy.json", "package.json", ".git") + ``` + + +## ols + + https://github.com/DanielGavin/ols + + `Odin Language Server`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ols.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ols" } + ``` + - `filetypes` : + ```lua + { "odin" } + ``` + - `root_dir` : + ```lua + util.root_pattern("ols.json", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## omnisharp + +https://github.com/omnisharp/omnisharp-roslyn +OmniSharp server based on Roslyn workspaces + +`omnisharp-roslyn` can be installed by downloading and extracting a release from [here](https://github.com/OmniSharp/omnisharp-roslyn/releases). +Omnisharp can also be built from source by following the instructions [here](https://github.com/omnisharp/omnisharp-roslyn#downloading-omnisharp). + +Omnisharp requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +**By default, omnisharp-roslyn doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. + +```lua +local pid = vim.fn.getpid() +-- On linux/darwin if using a release build, otherwise under scripts/OmniSharp(.Core)(.cmd) +local omnisharp_bin = "/path/to/omnisharp-repo/run" +-- on Windows +-- local omnisharp_bin = "/path/to/omnisharp/OmniSharp.exe" +require'lspconfig'.omnisharp.setup{ + cmd = { omnisharp_bin, "--languageserver" , "--hostPID", tostring(pid) }; + ... +} +``` + +Note, if you download the executable for darwin you will need to strip the quarantine label to run: +```bash +find /path/to/omnisharp-osx | xargs xattr -r -d com.apple.quarantine +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.omnisharp.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "cs", "vb" } + ``` + - `init_options` : + ```lua + {} + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern(".sln") or root_pattern(".csproj") + ``` + + +## opencl_ls + +https://github.com/Galarius/opencl-language-server + +Build instructions can be found [here](https://github.com/Galarius/opencl-language-server/blob/main/_dev/build.md). + +Prebuilt binaries are available for Linux, macOS and Windows [here](https://github.com/Galarius/opencl-language-server/releases). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.opencl_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "opencl-language-server" } + ``` + - `filetypes` : + ```lua + { "opencl" } + ``` + - `root_dir` : + ```lua + util.root_pattern(".git") + ``` + + +## openscad_ls + +https://github.com/dzhu/openscad-language-server + +A Language Server Protocol server for OpenSCAD + +You can build and install `openscad-language-server` binary with `cargo`: +```sh +cargo install openscad-language-server +``` + +Vim does not have built-in syntax for the `openscad` filetype currently. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.scad set filetype=openscad ]] +``` + +or by installing a filetype plugin such as https://github.com/sirtaj/vim-openscad + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.openscad_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "openscad-language-server" } + ``` + - `filetypes` : + ```lua + { "openscad" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## pasls + +https://github.com/genericptr/pascal-language-server + +An LSP server implementation for Pascal variants that are supported by Free Pascal, including Object Pascal. It uses CodeTools from Lazarus as backend. + +First set `cmd` to the Pascal lsp binary. + +Customization options are passed to pasls as environment variables for example in your `.bashrc`: +```bash +export FPCDIR='/usr/lib/fpc/src' # FPC source directory (This is the only required option for the server to work). +export PP='/usr/lib/fpc/3.2.2/ppcx64' # Path to the Free Pascal compiler executable. +export LAZARUSDIR='/usr/lib/lazarus' # Path to the Lazarus sources. +export FPCTARGET='' # Target operating system for cross compiling. +export FPCTARGETCPU='x86_64' # Target CPU for cross compiling. +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pasls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pasls" } + ``` + - `filetypes` : + ```lua + { "pascal" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## perlls + +https://github.com/richterger/Perl-LanguageServer/tree/master/clients/vscode/perl + +`Perl-LanguageServer`, a language server for Perl. + +To use the language server, ensure that you have Perl::LanguageServer installed and perl command is on your path. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.perlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "perl", "-MPerl::LanguageServer", "-e", "Perl::LanguageServer::run", "--", "--port 13603", "--nostdio 0", "--version 2.1.0" } + ``` + - `filetypes` : + ```lua + { "perl" } + ``` + - `root_dir` : + ```lua + vim's starting directory + ``` + - `settings` : + ```lua + { + perl = { + fileFilter = { ".pm", ".pl" }, + ignoreDirs = ".git", + perlCmd = "perl", + perlInc = " " + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## perlnavigator + +https://github.com/bscan/PerlNavigator + +A Perl language server + +**By default, perlnavigator doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. +You have to install the language server manually. + +Clone the PerlNavigator repo, install based on the [instructions](https://github.com/bscan/PerlNavigator#installation-for-other-editors), +and point `cmd` to `server.js` inside the `server/out` directory: + +```lua +cmd = {'node', '/server/out/server.js', '--stdio'} +``` + +At minimum, you will need `perl` in your path. If you want to use a non-standard `perl` you will need to set your configuration like so: +```lua +settings = { + perlnavigator = { + perlPath = '/some/odd/location/my-perl' + } +} +``` + +The `contributes.configuration.properties` section of `perlnavigator`'s `package.json` has all available configuration settings. All +settings have a reasonable default, but, at minimum, you may want to point `perlnavigator` at your `perltidy` and `perlcritic` configurations. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.perlnavigator.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + {} + ``` + - `filetypes` : + ```lua + { "perl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## perlpls + +https://github.com/FractalBoy/perl-language-server +https://metacpan.org/pod/PLS + +`PLS`, another language server for Perl. + +To use the language server, ensure that you have PLS installed and that it is in your path + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.perlpls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pls" } + ``` + - `filetypes` : + ```lua + { "perl" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `settings` : + ```lua + { + perl = { + perlcritic = { + enabled = false + }, + syntax = { + enabled = true + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## phpactor + +https://github.com/phpactor/phpactor + +Installation: https://phpactor.readthedocs.io/en/master/usage/standalone.html#global-installation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.phpactor.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "phpactor", "language-server" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("composer.json", ".git") + ``` + + +## please + +https://github.com/thought-machine/please + +High-performance extensible build system for reproducible multi-language builds. + +The `plz` binary will automatically install the LSP for you on first run + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.please.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "plz", "tool", "lps" } + ``` + - `filetypes` : + ```lua + { "bzl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## powershell_es + +https://github.com/PowerShell/PowerShellEditorServices + +Language server for PowerShell. + +To install, download and extract PowerShellEditorServices.zip +from the [releases](https://github.com/PowerShell/PowerShellEditorServices/releases). +To configure the language server, set the property `bundle_path` to the root +of the extracted PowerShellEditorServices.zip. + +The default configuration doesn't set `cmd` unless `bundle_path` is specified. + +```lua +require'lspconfig'.powershell_es.setup{ + bundle_path = 'c:/w/PowerShellEditorServices', +} +``` + +By default the languageserver is started in `pwsh` (PowerShell Core). This can be changed by specifying `shell`. + +```lua +require'lspconfig'.powershell_es.setup{ + bundle_path = 'c:/w/PowerShellEditorServices', + shell = 'powershell.exe', +} +``` + +Note that the execution policy needs to be set to `Unrestricted` for the languageserver run under PowerShell + +If necessary, specific `cmd` can be defined instead of `bundle_path`. +See [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices#stdio) +to learn more. + +```lua +require'lspconfig'.powershell_es.setup{ + cmd = {'pwsh', '-NoLogo', '-NoProfile', '-Command', "c:/PSES/Start-EditorServices.ps1 ..."} +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.powershell_es.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "ps1" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + git root or current directory + ``` + - `shell` : + ```lua + "pwsh" + ``` + - `single_file_support` : + ```lua + true + ``` + + +## prismals + +Language Server for the Prisma JavaScript and TypeScript ORM + +`@prisma/language-server` can be installed via npm +```sh +npm install -g @prisma/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.prismals.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "prisma-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "prisma" } + ``` + - `root_dir` : + ```lua + root_pattern(".git", "package.json") + ``` + - `settings` : + ```lua + { + prisma = { + prismaFmtBinPath = "" + } + } + ``` + + +## prosemd_lsp + +https://github.com/kitten/prosemd-lsp + +An experimental LSP for Markdown. + +Please see the manual installation instructions: https://github.com/kitten/prosemd-lsp#manual-installation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.prosemd_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "prosemd-lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + + ``` + - `single_file_support` : + ```lua + true + ``` + + +## psalm + +https://github.com/vimeo/psalm + +Can be installed with composer. +```sh +composer global require vimeo/psalm +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.psalm.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "psalm-language-server" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("psalm.xml", "psalm.xml.dist") + ``` + + +## puppet + +LSP server for Puppet. + +Installation: + +- Clone the editor-services repository: + https://github.com/puppetlabs/puppet-editor-services + +- Navigate into that directory and run: `bundle install` + +- Install the 'puppet-lint' gem: `gem install puppet-lint` + +- Add that repository to $PATH. + +- Ensure you can run `puppet-languageserver` from outside the editor-services directory. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.puppet.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "puppet-languageserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "puppet" } + ``` + - `root_dir` : + ```lua + root_pattern("manifests", ".puppet-lint.rc", "hiera.yaml", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## purescriptls + +https://github.com/nwolverson/purescript-language-server +`purescript-language-server` can be installed via `npm` +```sh +npm install -g purescript-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.purescriptls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "purescript-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "purescript" } + ``` + - `root_dir` : + ```lua + root_pattern("spago.dhall, 'psc-package.json', bower.json") + ``` + + +## pylsp + +https://github.com/python-lsp/python-lsp-server + +A Python 3.6+ implementation of the Language Server Protocol. + +The language server can be installed via `pipx install 'python-lsp-server[all]'`. +Further instructions can be found in the [project's README](https://github.com/python-lsp/python-lsp-server). + +Note: This is a community fork of `pyls`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pylsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pylsp" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## pyre + +https://pyre-check.org/ + +`pyre` a static type checker for Python 3. + +`pyre` offers an extremely limited featureset. It currently only supports diagnostics, +which are triggered on save. + +Do not report issues for missing features in `pyre` to `lspconfig`. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pyre.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pyre", "persistent" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## pyright + +https://github.com/microsoft/pyright + +`pyright`, a static type checker and language server for python + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pyright.setup{} +``` +**Commands:** +- PyrightOrganizeImports: Organize Imports + +**Default values:** + - `cmd` : + ```lua + { "pyright-langserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + python = { + analysis = { + autoSearchPaths = true, + diagnosticMode = "workspace", + useLibraryCodeForTypes = true + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## quick_lint_js + +https://quick-lint-js.com/ + +quick-lint-js finds bugs in JavaScript programs. + +See installation [instructions](https://quick-lint-js.com/install/) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.quick_lint_js.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "quick-lint-js", "--lsp-server" } + ``` + - `filetypes` : + ```lua + { "javascript" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## r_language_server + +[languageserver](https://github.com/REditorSupport/languageserver) is an +implementation of the Microsoft's Language Server Protocol for the R +language. + +It is released on CRAN and can be easily installed by + +```R +install.packages("languageserver") +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.r_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "R", "--slave", "-e", "languageserver::run()" } + ``` + - `filetypes` : + ```lua + { "r", "rmd" } + ``` + - `log_level` : + ```lua + 2 + ``` + - `root_dir` : + ```lua + root_pattern(".git") or os_homedir + ``` + + +## racket_langserver + +[https://github.com/jeapostrophe/racket-langserver](https://github.com/jeapostrophe/racket-langserver) + +The Racket language server. This project seeks to use +[DrRacket](https://github.com/racket/drracket)'s public API to provide +functionality that mimics DrRacket's code tools as closely as possible. + +Install via `raco`: `raco pkg install racket-langserver` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.racket_langserver.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "racket", "--lib", "racket-langserver" } + ``` + - `filetypes` : + ```lua + { "racket", "scheme" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## reason_ls + +Reason language server + +**By default, reason_ls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. +You have to install the language server manually. + +You can install reason language server from [reason-language-server](https://github.com/jaredly/reason-language-server) repository. + +```lua +cmd = {''} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.reason_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "reason-language-server" } + ``` + - `filetypes` : + ```lua + { "reason" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## remark_ls + +https://github.com/remarkjs/remark-language-server + +`remark-language-server` can be installed via `npm`: +```sh +npm install -g remark-language-server +``` + +`remark-language-server` uses the same +[configuration files](https://github.com/remarkjs/remark/tree/main/packages/remark-cli#example-config-files-json-yaml-js) +as `remark-cli`. + +This uses a plugin based system. Each plugin needs to be installed locally using `npm` or `yarn`. + +For example, given the following `.remarkrc.json`: + +```json +{ + "presets": [ + "remark-preset-lint-recommended" + ] +} +``` + +`remark-preset-lint-recommended` needs to be installed in the local project: + +```sh +npm install remark-preset-lint-recommended +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.remark_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "remark-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## rescriptls + +https://github.com/rescript-lang/rescript-vscode + +ReScript language server + +**By default, rescriptls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. +You have to install the language server manually. + +You can use the bundled language server inside the [vim-rescript](https://github.com/rescript-lang/vim-rescript) repo. + +Clone the vim-rescript repo and point `cmd` to `server.js` inside `server/out` directory: + +```lua +cmd = {'node', '/server/out/server.js', '--stdio'} + +``` + +If you have vim-rescript installed you can also use that installation. for example if you're using packer.nvim you can set cmd to something like this: + +```lua +cmd = { + 'node', + '/home/username/.local/share/nvim/site/pack/packer/start/vim-rescript/server/out/server.js', + '--stdio' +} +``` + +Another option is to use vscode extension [release](https://github.com/rescript-lang/rescript-vscode/releases). +Take a look at [here](https://github.com/rescript-lang/rescript-vscode#use-with-other-editors) for instructions. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rescriptls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + {} + ``` + - `filetypes` : + ```lua + { "rescript" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## rls + +https://github.com/rust-lang/rls + +rls, a language server for Rust + +See https://github.com/rust-lang/rls#setup to setup rls itself. +See https://github.com/rust-lang/rls#configuration for rls-specific settings. +All settings listed on the rls configuration section of the readme +must be set under settings.rust as follows: + +```lua +nvim_lsp.rls.setup { + settings = { + rust = { + unstable_features = true, + build_on_save = false, + all_features = true, + }, + }, +} +``` + +If you want to use rls for a particular build, eg nightly, set cmd as follows: + +```lua +cmd = {"rustup", "run", "nightly", "rls"} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rls" } + ``` + - `filetypes` : + ```lua + { "rust" } + ``` + - `root_dir` : + ```lua + root_pattern("Cargo.toml") + ``` + + +## rnix + +https://github.com/nix-community/rnix-lsp + +A language server for Nix providing basic completion and formatting via nixpkgs-fmt. + +To install manually, run `cargo install rnix-lsp`. If you are using nix, rnix-lsp is in nixpkgs. + +This server accepts configuration via the `settings` key. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rnix.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rnix-lsp" } + ``` + - `filetypes` : + ```lua + { "nix" } + ``` + - `init_options` : + ```lua + {} + ``` + - `root_dir` : + ```lua + vim's starting directory + ``` + - `settings` : + ```lua + {} + ``` + + +## robotframework_ls + +https://github.com/robocorp/robotframework-lsp + +Language Server Protocol implementation for Robot Framework. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.robotframework_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "robotframework_ls" } + ``` + - `filetypes` : + ```lua + { "robot" } + ``` + - `root_dir` : + ```lua + util.root_pattern('robotidy.toml', 'pyproject.toml')(fname) or util.find_git_ancestor(fname) + ``` + + +## rome + +https://rome.tools + +Language server for the Rome Frontend Toolchain. + +```sh +npm install [-g] rome +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rome.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rome", "lsp" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "json", "typescript", "typescript.tsx", "typescriptreact" } + ``` + - `root_dir` : + ```lua + root_pattern('package.json', 'node_modules', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## rust_analyzer + +https://github.com/rust-analyzer/rust-analyzer + +rust-analyzer (aka rls 2.0), a language server for Rust + +See [docs](https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/user#settings) for extra settings. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rust_analyzer.setup{} +``` +**Commands:** +- CargoReload: Reload current cargo workspace + +**Default values:** + - `cmd` : + ```lua + { "rust-analyzer" } + ``` + - `filetypes` : + ```lua + { "rust" } + ``` + - `root_dir` : + ```lua + root_pattern("Cargo.toml", "rust-project.json") + ``` + - `settings` : + ```lua + { + ["rust-analyzer"] = {} + } + ``` + + +## salt_ls + +Language server for Salt configuration files. +https://github.com/dcermak/salt-lsp + +The language server can be installed with `pip`: +```sh +pip install salt-lsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.salt_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "salt_lsp_server" } + ``` + - `filetypes` : + ```lua + { "sls" } + ``` + - `root_dir` : + ```lua + root_pattern('.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## scry + +https://github.com/crystal-lang-tools/scry + +Crystal language server. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.scry.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "scry" } + ``` + - `filetypes` : + ```lua + { "crystal" } + ``` + - `root_dir` : + ```lua + root_pattern('shard.yml', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## serve_d + + https://github.com/Pure-D/serve-d + + `Microsoft language server protocol implementation for D using workspace-d.` + Download a binary from https://github.com/Pure-D/serve-d/releases and put it in your $PATH. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.serve_d.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "serve-d" } + ``` + - `filetypes` : + ```lua + { "d" } + ``` + - `root_dir` : + ```lua + util.root_pattern("dub.json", "dub.sdl", ".git") + ``` + + +## sixtyfps + +https://github.com/sixtyfpsui/sixtyfps +`SixtyFPS`'s language server + +You can build and install `sixtyfps-lsp` binary with `cargo`: +```sh +cargo install sixtyfps-lsp +``` + +Vim does not have built-in syntax for the `sixtyfps` filetype currently. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.60 set filetype=sixtyfps ]] +``` + +or by installing a filetype plugin such as https://github.com/RustemB/sixtyfps-vim + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sixtyfps.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sixtyfps-lsp" } + ``` + - `filetypes` : + ```lua + { "sixtyfps" } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## slint_lsp + +https://github.com/slint-ui/slint +`Slint`'s language server + +You can build and install `slint-lsp` binary with `cargo`: +```sh +cargo install slint-lsp +``` + +Vim does not have built-in syntax for the `slint` filetype at this time. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.slint set filetype=slint ]] +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.slint_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "slint-lsp" } + ``` + - `filetypes` : + ```lua + { "slint" } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## solang + +A language server for Solidity + +See the [documentation](https://solang.readthedocs.io/en/latest/installing.html) for installation instructions. + +The language server only provides the following capabilities: +* Syntax highlighting +* Diagnostics +* Hover + +There is currently no support for completion, goto definition, references, or other functionality. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solang.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solang", "--language-server", "--target", "ewasm" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## solargraph + +https://solargraph.org/ + +solargraph, a language server for Ruby + +You can install solargraph via gem install. + +```sh +gem install --user-install solargraph +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solargraph.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solargraph", "stdio" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `init_options` : + ```lua + { + formatting = true + } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + - `settings` : + ```lua + { + solargraph = { + diagnostics = true + } + } + ``` + + +## solc + +https://docs.soliditylang.org/en/latest/installing-solidity.html + +solc is the native language server for the Solidity language. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solc.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solc", "--lsp" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## solidity_ls + +npm install -g solidity-language-server + +solidity-language-server is a language server for the solidity language ported from the vscode solidity extension + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solidity_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solidity-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + root_pattern(".git", "package.json") + ``` + + +## sorbet + +https://sorbet.org + +Sorbet is a fast, powerful type checker designed for Ruby. + +You can install Sorbet via gem install. You might also be interested in how to set +Sorbet up for new projects: https://sorbet.org/docs/adopting. + +```sh +gem install sorbet +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sorbet.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "srb", "tc", "--lsp" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + + +## sourcekit + +https://github.com/apple/sourcekit-lsp + +Language server for Swift and C/C++/Objective-C. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sourcekit.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sourcekit-lsp" } + ``` + - `filetypes` : + ```lua + { "swift", "c", "cpp", "objective-c", "objective-cpp" } + ``` + - `root_dir` : + ```lua + root_pattern("Package.swift", ".git") + ``` + + +## sourcery + +https://github.com/sourcery-ai/sourcery + +Refactor Python instantly using the power of AI. + +It requires the initializationOptions param to be populated as shown below and will respond with the list of ServerCapabilities that it supports. + +init_options = { + --- The Sourcery token for authenticating the user. + --- This is retrieved from the Sourcery website and must be + --- provided by each user. The extension must provide a + --- configuration option for the user to provide this value. + token = + + --- The extension's name and version as defined by the extension. + extension_version = 'vim.lsp' + + --- The editor's name and version as defined by the editor. + editor_version = 'vim' +} + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sourcery.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sourcery", "lsp" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `init_options` : + ```lua + { + editor_version = "vim", + extension_version = "vim.lsp" + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## spectral + +https://github.com/luizcorreia/spectral-language-server + `A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v2 & v3.` + +`spectral-language-server` can be installed via `npm`: +```sh +npm i -g spectral-language-server +``` +See [vscode-spectral](https://github.com/stoplightio/vscode-spectral#extension-settings) for configuration options. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.spectral.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "spectral-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml", "json", "yml" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + enable = true, + run = "onType", + validateLanguages = { "yaml", "json", "yml" } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## sqlls + +https://github.com/joe-re/sql-language-server + +This LSP can be installed via `npm`. Find further instructions on manual installation of the sql-language-server at [joe-re/sql-language-server](https://github.com/joe-re/sql-language-server). +
+ + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sqlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sql-language-server", "up", "--method", "stdio" } + ``` + - `filetypes` : + ```lua + { "sql", "mysql" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## sqls + +https://github.com/lighttiger2505/sqls + +```lua +require'lspconfig'.sqls.setup{ + cmd = {"path/to/command", "-config", "path/to/config.yml"}; + ... +} +``` +Sqls can be installed via `go get github.com/lighttiger2505/sqls`. Instructions for compiling Sqls from the source can be found at [lighttiger2505/sqls](https://github.com/lighttiger2505/sqls). + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sqls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sqls" } + ``` + - `filetypes` : + ```lua + { "sql", "mysql" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## stylelint_lsp + +https://github.com/bmatcuk/stylelint-lsp + +`stylelint-lsp` can be installed via `npm`: + +```sh +npm i -g stylelint-lsp +``` + +Can be configured by passing a `settings.stylelintplus` object to `stylelint_lsp.setup`: + +```lua +require'lspconfig'.stylelint_lsp.setup{ + settings = { + stylelintplus = { + -- see available options in stylelint-lsp documentation + } + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.stylelint_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "stylelint-lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "css", "less", "scss", "sugarss", "vue", "wxss", "javascript", "javascriptreact", "typescript", "typescriptreact" } + ``` + - `root_dir` : + ```lua + root_pattern('.stylelintrc', 'package.json') + ``` + - `settings` : + ```lua + {} + ``` + + +## sumneko_lua + +https://github.com/sumneko/lua-language-server + +Lua language server. + +`lua-language-server` can be installed by following the instructions [here](https://github.com/sumneko/lua-language-server/wiki/Build-and-Run). The default `cmd` assumes that the `lua-language-server` binary can be found in `$PATH`. + +```lua +local runtime_path = vim.split(package.path, ';') +table.insert(runtime_path, "lua/?.lua") +table.insert(runtime_path, "lua/?/init.lua") + +require'lspconfig'.sumneko_lua.setup { + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT', + -- Setup your lua path + path = runtime_path, + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = {'vim'}, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = vim.api.nvim_get_runtime_file("", true), + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + }, + }, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sumneko_lua.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lua-language-server" } + ``` + - `filetypes` : + ```lua + { "lua" } + ``` + - `log_level` : + ```lua + 2 + ``` + - `root_dir` : + ```lua + root_pattern(".luarc.json", ".luacheckrc", ".stylua.toml", "selene.toml", ".git") + ``` + - `settings` : + ```lua + { + Lua = { + telemetry = { + enable = false + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## svelte + +https://github.com/sveltejs/language-tools/tree/master/packages/language-server + +`svelte-language-server` can be installed via `npm`: +```sh +npm install -g svelte-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.svelte.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "svelteserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "svelte" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") + ``` + + +## svls + +https://github.com/dalance/svls + +Language server for verilog and SystemVerilog + +`svls` can be installed via `cargo`: + ```sh + cargo install svls + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.svls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "svls" } + ``` + - `filetypes` : + ```lua + { "verilog", "systemverilog" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## tailwindcss + +https://github.com/tailwindlabs/tailwindcss-intellisense + +Tailwind CSS Language Server can be installed via npm: +```sh +npm install -g @tailwindcss/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tailwindcss.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tailwindcss-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "aspnetcorerazor", "astro", "astro-markdown", "blade", "django-html", "htmldjango", "edge", "eelixir", "ejs", "erb", "eruby", "gohtml", "haml", "handlebars", "hbs", "html", "html-eex", "heex", "jade", "leaf", "liquid", "markdown", "mdx", "mustache", "njk", "nunjucks", "php", "razor", "slim", "twig", "css", "less", "postcss", "sass", "scss", "stylus", "sugarss", "javascript", "javascriptreact", "reason", "rescript", "typescript", "typescriptreact", "vue", "svelte" } + ``` + - `init_options` : + ```lua + { + userLanguages = { + eelixir = "html-eex", + eruby = "erb" + } + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern('tailwind.config.js', 'tailwind.config.ts', 'postcss.config.js', 'postcss.config.ts', 'package.json', 'node_modules', '.git') + ``` + - `settings` : + ```lua + { + tailwindCSS = { + classAttributes = { "class", "className", "classList", "ngClass" }, + lint = { + cssConflict = "warning", + invalidApply = "error", + invalidConfigPath = "error", + invalidScreen = "error", + invalidTailwindDirective = "error", + invalidVariant = "error", + recommendedVariantOrder = "warning" + }, + validate = true + } + } + ``` + + +## taplo + +https://taplo.tamasfe.dev/lsp/ + +Language server for Taplo, a TOML toolkit. + +`taplo-cli` can be installed via `cargo`: +```sh +cargo install --locked taplo-cli +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.taplo.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "taplo", "lsp", "stdio" } + ``` + - `filetypes` : + ```lua + { "toml" } + ``` + - `root_dir` : + ```lua + root_pattern("*.toml", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## teal_ls + +https://github.com/teal-language/teal-language-server + +Install with: +``` +luarocks install --dev teal-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.teal_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "teal-language-server" } + ``` + - `filetypes` : + ```lua + { "teal" } + ``` + - `root_dir` : + ```lua + root_pattern("tlconfig.lua", ".git") + ``` + + +## terraform_lsp + +https://github.com/juliosueiras/terraform-lsp + +Terraform language server +Download a released binary from +https://github.com/juliosueiras/terraform-lsp/releases. + +From https://github.com/hashicorp/terraform-ls#terraform-ls-vs-terraform-lsp: + +Both HashiCorp and the maintainer of terraform-lsp expressed interest in +collaborating on a language server and are working towards a _long-term_ +goal of a single stable and feature-complete implementation. + +For the time being both projects continue to exist, giving users the +choice: + +- `terraform-ls` providing + - overall stability (by relying only on public APIs) + - compatibility with any provider and any Terraform >=0.12.0 currently + less features + - due to project being younger and relying on public APIs which may + not offer the same functionality yet + +- `terraform-lsp` providing + - currently more features + - compatibility with a single particular Terraform (0.12.20 at time of writing) + - configs designed for other 0.12 versions may work, but interpretation may be inaccurate + - less stability (due to reliance on Terraform's own internal packages) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.terraform_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "terraform-lsp" } + ``` + - `filetypes` : + ```lua + { "terraform", "hcl" } + ``` + - `root_dir` : + ```lua + root_pattern(".terraform", ".git") + ``` + + +## terraformls + +https://github.com/hashicorp/terraform-ls + +Terraform language server +Download a released binary from https://github.com/hashicorp/terraform-ls/releases. + +From https://github.com/hashicorp/terraform-ls#terraform-ls-vs-terraform-lsp: + +Both HashiCorp and the maintainer of terraform-lsp expressed interest in +collaborating on a language server and are working towards a _long-term_ +goal of a single stable and feature-complete implementation. + +For the time being both projects continue to exist, giving users the +choice: + +- `terraform-ls` providing + - overall stability (by relying only on public APIs) + - compatibility with any provider and any Terraform >=0.12.0 currently + less features + - due to project being younger and relying on public APIs which may + not offer the same functionality yet + +- `terraform-lsp` providing + - currently more features + - compatibility with a single particular Terraform (0.12.20 at time of writing) + - configs designed for other 0.12 versions may work, but interpretation may be inaccurate + - less stability (due to reliance on Terraform's own internal packages) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.terraformls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "terraform-ls", "serve" } + ``` + - `filetypes` : + ```lua + { "terraform" } + ``` + - `root_dir` : + ```lua + root_pattern(".terraform", ".git") + ``` + + +## texlab + +https://github.com/latex-lsp/texlab + +A completion engine built from scratch for (La)TeX. + +See https://github.com/latex-lsp/texlab/blob/master/docs/options.md for configuration options. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.texlab.setup{} +``` +**Commands:** +- TexlabBuild: Build the current buffer +- TexlabForward: Forward search from current position + +**Default values:** + - `cmd` : + ```lua + { "texlab" } + ``` + - `filetypes` : + ```lua + { "tex", "bib" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + texlab = { + auxDirectory = ".", + bibtexFormatter = "texlab", + build = { + args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" }, + executable = "latexmk", + forwardSearchAfter = false, + onSave = false + }, + chktex = { + onEdit = false, + onOpenAndSave = false + }, + diagnosticsDelay = 300, + formatterLineLength = 80, + forwardSearch = { + args = {} + }, + latexFormatter = "latexindent", + latexindent = { + modifyLineBreaks = false + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## tflint + +https://github.com/terraform-linters/tflint + +A pluggable Terraform linter that can act as lsp server. +Installation instructions can be found in https://github.com/terraform-linters/tflint#installation. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tflint.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tflint", "--langserver" } + ``` + - `filetypes` : + ```lua + { "terraform" } + ``` + - `root_dir` : + ```lua + root_pattern(".terraform", ".git", ".tflint.hcl") + ``` + + +## theme_check + +https://github.com/Shopify/shopify-cli + +`theme-check-language-server` is bundled with `shopify-cli` or it can also be installed via + +https://github.com/Shopify/theme-check#installation + +**NOTE:** +If installed via Homebrew, `cmd` must be set to 'theme-check-liquid-server' + +```lua +require lspconfig.theme_check.setup { + cmd = { 'theme-check-liquid-server' } +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.theme_check.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "theme-check-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "liquid" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## tsserver + +https://github.com/theia-ide/typescript-language-server + +`typescript-language-server` depends on `typescript`. Both packages can be installed via `npm`: +```sh +npm install -g typescript typescript-language-server +``` + +To configure type language server, add a +[`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or +[`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to the root of your +project. + +Here's an example that disables type checking in JavaScript files. + +```json +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "checkJs": false + }, + "exclude": [ + "node_modules" + ] +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tsserver.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "typescript-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" } + ``` + - `init_options` : + ```lua + { + hostInfo = "neovim" + } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git") + ``` + + +## typeprof + +https://github.com/ruby/typeprof + +`typeprof` is the built-in analysis and LSP tool for Ruby 3.1+. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.typeprof.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "typeprof", "--lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "ruby", "eruby" } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + + +## vala_ls + +https://github.com/Prince781/vala-language-server + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vala_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vala-language-server" } + ``` + - `filetypes` : + ```lua + { "vala", "genie" } + ``` + - `root_dir` : + ```lua + root_pattern("meson.build", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## vdmj + +https://github.com/nickbattle/vdmj + +The VDMJ language server can be installed by cloning the VDMJ repository and +running `mvn clean install`. + +Various options are provided to configure the language server (see below). In +particular: +- `annotation_paths` is a list of folders and/or jar file paths for annotations +that should be used with the language server; +- any value of `debugger_port` less than zero will disable the debugger; note +that if a non-zero value is used, only one instance of the server can be active +at a time. + +More settings for VDMJ can be changed in a file called `vdmj.properties` under +`root_dir/.vscode`. For a description of the available settings, see +[Section 7 of the VDMJ User Guide](https://raw.githubusercontent.com/nickbattle/vdmj/master/vdmj/documentation/UserGuide.pdf). + +Note: proof obligations and combinatorial testing are not currently supported +by neovim. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vdmj.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + Generated from the options given + ``` + - `filetypes` : + ```lua + { "vdmsl", "vdmpp", "vdmrt" } + ``` + - `options` : + ```lua + { + annotation_paths = {}, + debugger_port = -1, + high_precision = false, + java = "$JAVA_HOME/bin/java", + java_opts = { "-Xmx3000m", "-Xss1m" }, + logfile = "path.join(vim.fn.stdpath 'cache', 'vdm-lsp.log')", + mavenrepo = "$HOME/.m2/repository/com/fujitsu", + version = "The latest version installed in `mavenrepo`" + } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor(fname) or find_vscode_ancestor(fname) + ``` + + +## verible + +https://github.com/chipsalliance/verible + +A linter and formatter for verilog and SystemVerilog files. + +Release binaries can be downloaded from [here](https://github.com/chipsalliance/verible/releases) +and placed in a directory on PATH. + +See https://github.com/chipsalliance/verible/tree/master/verilog/tools/ls/README.md for options. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.verible.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "verible-verilog-ls" } + ``` + - `filetypes` : + ```lua + { "systemverilog", "verilog" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## vimls + +https://github.com/iamcco/vim-language-server + +You can install vim-language-server via npm: +```sh +npm install -g vim-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vimls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vim-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "vim" } + ``` + - `init_options` : + ```lua + { + diagnostic = { + enable = true + }, + indexes = { + count = 3, + gap = 100, + projectRootPatterns = { "runtime", "nvim", ".git", "autoload", "plugin" }, + runtimepath = true + }, + iskeyword = "@,48-57,_,192-255,-#", + runtimepath = "", + suggest = { + fromRuntimepath = true, + fromVimruntime = true + }, + vimruntime = "" + } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## vls + +https://github.com/vlang/vls + +V language server. + +`v-language-server` can be installed by following the instructions [here](https://github.com/vlang/vls#installation). + +**By default, v-language-server doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of your unzipped and compiled v-language-server. + +```lua +-- set the path to the vls installation; +local vls_root_path = vim.fn.stdpath('cache')..'/lspconfig/vls' +local vls_binary = vls_root_path.."/cmd/vls/vls" + +require'lspconfig'.vls.setup { + cmd = {vls_binary}, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "vlang" } + ``` + - `root_dir` : + ```lua + root_pattern("v.mod", ".git") + ``` + + +## volar + +https://github.com/johnsoncodehk/volar/tree/master/packages/vue-language-server + +Volar language server for Vue + +Volar can be installed via npm: + +```sh +npm install -g @volar/vue-language-server +``` + +Volar by default supports Vue 3 projects. Vue 2 projects need [additional configuration](https://github.com/johnsoncodehk/volar/blob/master/extensions/vscode-vue-language-features/README.md?plain=1#L28-L63). + +**Take Over Mode** +Volar can serve as a language server for both Vue and TypeScript via [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471). + +To enable Take Over Mode, override the default filetypes in `setup{}` as follows: + +```lua +require'lspconfig'.volar.setup{ + filetypes = {'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue', 'json'} +} +``` + +**Overriding the default TypeScript Server used by Volar** +The default config looks for TS in the local node_modules. The alternatives are: + +- use a global TypeScript Server installation + +```lua +require'lspconfig'.volar.setup{ + init_options = { + typescript = { + serverPath = '/path/to/.npm/lib/node_modules/typescript/lib/tsserverlib.js' + } + } +} +``` + +- use a global TypeScript Server installation if a local server is not found + +```lua +local util = require 'lspconfig.util' + +local function get_typescript_server_path(root_dir) + local project_root = util.find_node_modules_ancestor(root_dir) + + local local_tsserverlib = project_root ~= nil and util.path.join(project_root, 'node_modules', 'typescript', 'lib', 'tsserverlibrary.js') + local global_tsserverlib = '/home/[yourusernamehere]/.npm/lib/node_modules/typescript/lib/tsserverlibrary.js' + + if local_tsserverlib and util.path.exists(local_tsserverlib) then + return local_tsserverlib + else + return global_tsserverlib + end +end + +require'lspconfig'.volar.setup{ + on_new_config = function(new_config, new_root_dir) + new_config.init_options.typescript.serverPath = get_typescript_server_path(new_root_dir) + end, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.volar.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vue-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "vue" } + ``` + - `init_options` : + ```lua + { + documentFeatures = { + documentColor = false, + documentFormatting = { + defaultPrintWidth = 100 + }, + documentSymbol = true, + foldingRange = true, + linkedEditingRange = true, + selectionRange = true + }, + languageFeatures = { + callHierarchy = true, + codeAction = true, + codeLens = true, + completion = { + defaultAttrNameCase = "kebabCase", + defaultTagNameCase = "both" + }, + definition = true, + diagnostics = true, + documentHighlight = true, + documentLink = true, + hover = true, + implementation = true, + references = true, + rename = true, + renameFileRefactoring = true, + schemaRequestService = true, + semanticTokens = false, + signatureHelp = true, + typeDefinition = true + }, + typescript = { + serverPath = "" + } + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## vuels + +https://github.com/vuejs/vetur/tree/master/server + +Vue language server(vls) +`vue-language-server` can be installed via `npm`: +```sh +npm install -g vls +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vuels.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vls" } + ``` + - `filetypes` : + ```lua + { "vue" } + ``` + - `init_options` : + ```lua + { + config = { + css = {}, + emmet = {}, + html = { + suggest = {} + }, + javascript = { + format = {} + }, + stylusSupremacy = {}, + typescript = { + format = {} + }, + vetur = { + completion = { + autoImport = false, + tagCasing = "kebab", + useScaffoldSnippets = false + }, + format = { + defaultFormatter = { + js = "none", + ts = "none" + }, + defaultFormatterOptions = {}, + scriptInitialIndent = false, + styleInitialIndent = false + }, + useWorkspaceDependencies = false, + validation = { + script = true, + style = true, + template = true + } + } + } + } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", "vue.config.js") + ``` + + +## yamlls + +https://github.com/redhat-developer/yaml-language-server + +`yaml-language-server` can be installed via `yarn`: +```sh +yarn global add yaml-language-server +``` + +To use a schema for validation, there are two options: + +1. Add a modeline to the file. A modeline is a comment of the form: + +``` +# yaml-language-server: $schema= +``` + +where the relative filepath is the path relative to the open yaml file, and the absolute filepath +is the filepath relative to the filesystem root ('/' on unix systems) + +2. Associated a schema url, relative , or absolute (to root of project, not to filesystem root) path to +the a glob pattern relative to the detected project root. Check `:LspInfo` to determine the resolved project +root. + +```lua +require('lspconfig').yamlls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + ... -- other settings. note this overrides the lspconfig defaults. + schemas = { + ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*" + ["../path/relative/to/file.yml"] = "/.github/workflows/*" + ["/path/from/root/of/project"] = "/.github/workflows/*" + }, + }, + } +} +``` + +Currently, kubernetes is special-cased in yammls, see the following upstream issues: +* [#211](https://github.com/redhat-developer/yaml-language-server/issues/211). +* [#307](https://github.com/redhat-developer/yaml-language-server/issues/307). + +To override a schema to use a specific k8s schema version (for example, to use 1.18): + +```lua +require('lspconfig').yamlls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + ... -- other settings. note this overrides the lspconfig defaults. + schemas = { + ["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.18.0-standalone-strict/all.json"] = "/*.k8s.yaml", + ... -- other schemas + }, + }, + } +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.yamlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "yaml-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml", "yaml.docker-compose" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `settings` : + ```lua + { + redhat = { + telemetry = { + enabled = false + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## zeta_note + +https://github.com/artempyanykh/zeta-note + +Markdown LSP server for easy note-taking with cross-references and diagnostics. + +Binaries can be downloaded from https://github.com/artempyanykh/zeta-note/releases + +**By default, zeta-note doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of your zeta-note binary. + +```lua +require'lspconfig'.zeta_note.setup{ + cmd = {'path/to/zeta-note'} +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.zeta_note.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + root_pattern(".zeta.toml") + ``` + + +## zk + +github.com/mickael-menu/zk + +A plain text note-taking assistant + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.zk.setup{} +``` +**Commands:** +- ZkIndex: Index +- ZkNew: ZkNew + +**Default values:** + - `cmd` : + ```lua + { "zk", "lsp" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + root_pattern(".zk") + ``` + + +## zls + +https://github.com/zigtools/zls + +Zig LSP implementation + Zig Language Server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.zls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "zls" } + ``` + - `filetypes` : + ```lua + { "zig", "zir" } + ``` + - `root_dir` : + ```lua + util.root_pattern("zls.json", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + + +vim:ft=markdown diff --git a/bundle/nvim-lspconfig-0.1.3/doc/server_configurations.txt b/bundle/nvim-lspconfig-0.1.3/doc/server_configurations.txt new file mode 100644 index 000000000..426c422ff --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/doc/server_configurations.txt @@ -0,0 +1,6554 @@ +# Configurations + + +The following LSP configs are included. This documentation is autogenerated from the lua files. Follow a link to find documentation for +that config. This file is accessible in neovim via `:help lspconfig-server-configurations` + +- [als](#als) +- [angularls](#angularls) +- [ansiblels](#ansiblels) +- [arduino_language_server](#arduino_language_server) +- [asm_lsp](#asm_lsp) +- [awk_ls](#awk_ls) +- [bashls](#bashls) +- [beancount](#beancount) +- [bicep](#bicep) +- [bsl_ls](#bsl_ls) +- [ccls](#ccls) +- [clangd](#clangd) +- [clarity_lsp](#clarity_lsp) +- [clojure_lsp](#clojure_lsp) +- [cmake](#cmake) +- [codeqlls](#codeqlls) +- [crystalline](#crystalline) +- [csharp_ls](#csharp_ls) +- [cssls](#cssls) +- [cssmodules_ls](#cssmodules_ls) +- [cucumber_language_server](#cucumber_language_server) +- [dartls](#dartls) +- [denols](#denols) +- [dhall_lsp_server](#dhall_lsp_server) +- [diagnosticls](#diagnosticls) +- [dockerls](#dockerls) +- [dotls](#dotls) +- [efm](#efm) +- [elixirls](#elixirls) +- [elmls](#elmls) +- [ember](#ember) +- [emmet_ls](#emmet_ls) +- [erlangls](#erlangls) +- [esbonio](#esbonio) +- [eslint](#eslint) +- [flow](#flow) +- [flux_lsp](#flux_lsp) +- [foam_ls](#foam_ls) +- [fortls](#fortls) +- [fsautocomplete](#fsautocomplete) +- [fstar](#fstar) +- [gdscript](#gdscript) +- [ghcide](#ghcide) +- [golangci_lint_ls](#golangci_lint_ls) +- [gopls](#gopls) +- [gradle_ls](#gradle_ls) +- [grammarly](#grammarly) +- [graphql](#graphql) +- [groovyls](#groovyls) +- [haxe_language_server](#haxe_language_server) +- [hdl_checker](#hdl_checker) +- [hhvm](#hhvm) +- [hie](#hie) +- [hls](#hls) +- [hoon_ls](#hoon_ls) +- [html](#html) +- [idris2_lsp](#idris2_lsp) +- [intelephense](#intelephense) +- [java_language_server](#java_language_server) +- [jdtls](#jdtls) +- [jedi_language_server](#jedi_language_server) +- [jsonls](#jsonls) +- [jsonnet_ls](#jsonnet_ls) +- [julials](#julials) +- [kotlin_language_server](#kotlin_language_server) +- [lean3ls](#lean3ls) +- [leanls](#leanls) +- [lelwel_ls](#lelwel_ls) +- [lemminx](#lemminx) +- [ltex](#ltex) +- [metals](#metals) +- [mint](#mint) +- [mm0_ls](#mm0_ls) +- [nickel_ls](#nickel_ls) +- [nimls](#nimls) +- [ocamlls](#ocamlls) +- [ocamllsp](#ocamllsp) +- [ols](#ols) +- [omnisharp](#omnisharp) +- [opencl_ls](#opencl_ls) +- [openscad_ls](#openscad_ls) +- [pasls](#pasls) +- [perlls](#perlls) +- [perlnavigator](#perlnavigator) +- [perlpls](#perlpls) +- [phpactor](#phpactor) +- [please](#please) +- [powershell_es](#powershell_es) +- [prismals](#prismals) +- [prosemd_lsp](#prosemd_lsp) +- [psalm](#psalm) +- [puppet](#puppet) +- [purescriptls](#purescriptls) +- [pylsp](#pylsp) +- [pyre](#pyre) +- [pyright](#pyright) +- [quick_lint_js](#quick_lint_js) +- [r_language_server](#r_language_server) +- [racket_langserver](#racket_langserver) +- [reason_ls](#reason_ls) +- [remark_ls](#remark_ls) +- [rescriptls](#rescriptls) +- [rls](#rls) +- [rnix](#rnix) +- [robotframework_ls](#robotframework_ls) +- [rome](#rome) +- [rust_analyzer](#rust_analyzer) +- [salt_ls](#salt_ls) +- [scry](#scry) +- [serve_d](#serve_d) +- [sixtyfps](#sixtyfps) +- [slint_lsp](#slint_lsp) +- [solang](#solang) +- [solargraph](#solargraph) +- [solc](#solc) +- [solidity_ls](#solidity_ls) +- [sorbet](#sorbet) +- [sourcekit](#sourcekit) +- [sourcery](#sourcery) +- [spectral](#spectral) +- [sqlls](#sqlls) +- [sqls](#sqls) +- [stylelint_lsp](#stylelint_lsp) +- [sumneko_lua](#sumneko_lua) +- [svelte](#svelte) +- [svls](#svls) +- [tailwindcss](#tailwindcss) +- [taplo](#taplo) +- [teal_ls](#teal_ls) +- [terraform_lsp](#terraform_lsp) +- [terraformls](#terraformls) +- [texlab](#texlab) +- [tflint](#tflint) +- [theme_check](#theme_check) +- [tsserver](#tsserver) +- [typeprof](#typeprof) +- [vala_ls](#vala_ls) +- [vdmj](#vdmj) +- [verible](#verible) +- [vimls](#vimls) +- [vls](#vls) +- [volar](#volar) +- [vuels](#vuels) +- [yamlls](#yamlls) +- [zeta_note](#zeta_note) +- [zk](#zk) +- [zls](#zls) + +## als + +https://github.com/AdaCore/ada_language_server + +Installation instructions can be found [here](https://github.com/AdaCore/ada_language_server#Install). + +Can be configured by passing a "settings" object to `als.setup{}`: + +```lua +require('lspconfig').als.setup{ + settings = { + ada = { + projectFile = "project.gpr"; + scenarioVariables = { ... }; + } + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.als.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ada_language_server" } + ``` + - `filetypes` : + ```lua + { "ada" } + ``` + - `root_dir` : + ```lua + util.root_pattern("Makefile", ".git", "*.gpr", "*.adc") + ``` + + +## angularls + +https://github.com/angular/vscode-ng-language-service + +`angular-language-server` can be installed via npm `npm install -g @angular/language-server`. + +Note, that if you override the default `cmd`, you must also update `on_new_config` to set `new_config.cmd` during startup. + +```lua +local project_library_path = "/path/to/project/lib" +local cmd = {"ngserver", "--stdio", "--tsProbeLocations", project_library_path , "--ngProbeLocations", project_library_path} + +require'lspconfig'.angularls.setup{ + cmd = cmd, + on_new_config = function(new_config,new_root_dir) + new_config.cmd = cmd + end, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.angularls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ngserver", "--stdio", "--tsProbeLocations", "", "--ngProbeLocations", "" } + ``` + - `filetypes` : + ```lua + { "typescript", "html", "typescriptreact", "typescript.tsx" } + ``` + - `root_dir` : + ```lua + root_pattern("angular.json", ".git") + ``` + + +## ansiblels + +https://github.com/ansible/ansible-language-server + +Language server for the ansible configuration management tool. + +`ansible-language-server` can be installed via `npm`: + +```sh +npm install -g @ansible/ansible-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ansiblels.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ansible-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml.ansible" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + ansible = { + ansible = { + path = "ansible" + }, + ansibleLint = { + enabled = true, + path = "ansible-lint" + }, + executionEnvironment = { + enabled = false + }, + python = { + interpreterPath = "python" + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## arduino_language_server + +https://github.com/arduino/arduino-language-server + +Language server for Arduino + +The `arduino-language-server` can be installed by running: + go get -u github.com/arduino/arduino-language-server + +The `arduino-cli` tools must also be installed. Follow these instructions for your distro: + https://arduino.github.io/arduino-cli/latest/installation/ + +After installing the `arduino-cli` tools, follow these instructions for generating +a configuration file: + https://arduino.github.io/arduino-cli/latest/getting-started/#create-a-configuration-file +and make sure you install any relevant platforms libraries: + https://arduino.github.io/arduino-cli/latest/getting-started/#install-the-core-for-your-board + +The language server also requires `clangd` be installed. It will look for `clangd` by default but +the binary path can be overridden if need be. + +After all dependencies are installed you'll need to override the lspconfig command for the +language server in your setup function with the necessary configurations: + +```lua +lspconfig.arduino_language_server.setup({ + cmd = { + -- Required + "arduino-language-server", + "-cli-config", "/path/to/arduino-cli.yaml", + -- Optional + "-cli", "/path/to/arduino-cli", + "-clangd", "/path/to/clangd" + } +}) +``` + +For further instruction about configuration options, run `arduino-language-server --help`. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.arduino_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "arduino-language-server" } + ``` + - `filetypes` : + ```lua + { "arduino" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## asm_lsp + +https://github.com/bergercookie/asm-lsp + +Language Server for GAS/GO Assembly + +`asm-lsp` can be installed via cargo: +cargo install asm-lsp + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.asm_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "asm-lsp" } + ``` + - `filetypes` : + ```lua + { "asm", "vmasm" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## awk_ls + +https://github.com/Beaglefoot/awk-language-server/ + +`awk-language-server` can be installed via `npm`: +```sh +npm install -g awk-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.awk_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "awk-language-server" } + ``` + - `filetypes` : + ```lua + { "awk" } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bashls + +https://github.com/mads-hartmann/bash-language-server + +`bash-language-server` can be installed via `npm`: +```sh +npm i -g bash-language-server +``` + +Language server for bash, written using tree sitter in typescript. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bashls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "bash-language-server", "start" } + ``` + - `cmd_env` : + ```lua + { + GLOB_PATTERN = "*@(.sh|.inc|.bash|.command)" + } + ``` + - `filetypes` : + ```lua + { "sh" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## beancount + +https://github.com/polarmutex/beancount-language-server#installation + +See https://github.com/polarmutex/beancount-language-server#configuration for configuration options + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.beancount.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "beancount-langserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "beancount" } + ``` + - `init_options` : + ```lua + { + journalFile = "", + pythonPath = "python3" + } + ``` + - `root_dir` : + ```lua + root_pattern("elm.json") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bicep + +https://github.com/azure/bicep +Bicep language server + +Bicep language server can be installed by downloading and extracting a release of bicep-langserver.zip from [Bicep GitHub releases](https://github.com/Azure/bicep/releases). + +Bicep language server requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +Neovim does not have built-in support for the bicep filetype which is required for lspconfig to automatically launch the language server. + +Filetype detection can be added via an autocmd: +```lua +vim.cmd [[ autocmd BufNewFile,BufRead *.bicep set filetype=bicep ]] +``` + +**By default, bicep language server does not have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. + +```lua +local bicep_lsp_bin = "/path/to/bicep-langserver/Bicep.LangServer.dll" +require'lspconfig'.bicep.setup{ + cmd = { "dotnet", bicep_lsp_bin }; + ... +} +``` + +To download the latest release and place in /usr/local/bin/bicep-langserver: +```bash +(cd $(mktemp -d) \ + && curl -fLO https://github.com/Azure/bicep/releases/latest/download/bicep-langserver.zip \ + && rm -rf /usr/local/bin/bicep-langserver \ + && unzip -d /usr/local/bin/bicep-langserver bicep-langserver.zip) +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bicep.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "bicep" } + ``` + - `init_options` : + ```lua + {} + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## bsl_ls + + https://github.com/1c-syntax/bsl-language-server + + Language Server Protocol implementation for 1C (BSL) - 1C:Enterprise 8 and OneScript languages. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bsl_ls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "bsl", "os" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## ccls + +https://github.com/MaskRay/ccls/wiki + +ccls relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) specified +as compile_commands.json or, for simpler projects, a .ccls. +For details on how to automatically generate one using CMake look [here](https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html). Alternatively, you can use [Bear](https://github.com/rizsotto/Bear). + +Customization options are passed to ccls at initialization time via init_options, a list of available options can be found [here](https://github.com/MaskRay/ccls/wiki/Customization#initialization-options). For example: + +```lua +local lspconfig = require'lspconfig' +lspconfig.ccls.setup { + init_options = { + compilationDatabaseDirectory = "build"; + index = { + threads = 0; + }; + clang = { + excludeArgs = { "-frounding-math"} ; + }; + } +} + +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ccls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ccls" } + ``` + - `filetypes` : + ```lua + { "c", "cpp", "objc", "objcpp" } + ``` + - `offset_encoding` : + ```lua + "utf-32" + ``` + - `root_dir` : + ```lua + root_pattern("compile_commands.json", ".ccls", ".git") + ``` + - `single_file_support` : + ```lua + false + ``` + + +## clangd + +https://clangd.llvm.org/installation.html + +**NOTE:** Clang >= 11 is recommended! See [this issue for more](https://github.com/neovim/nvim-lsp/issues/23). + +clangd relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) specified as compile_commands.json, see https://clangd.llvm.org/installation#compile_commandsjson + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.clangd.setup{} +``` +**Commands:** +- ClangdSwitchSourceHeader: Switch between source/header + +**Default values:** + - `capabilities` : + ```lua + default capabilities, with offsetEncoding utf-8 + ``` + - `cmd` : + ```lua + { "clangd" } + ``` + - `filetypes` : + ```lua + { "c", "cpp", "objc", "objcpp" } + ``` + - `root_dir` : + ```lua + root_pattern( + '.clangd', + '.clang-tidy', + '.clang-format', + 'compile_commands.json', + 'compile_flags.txt', + 'configure.ac', + '.git' + ) + + ``` + - `single_file_support` : + ```lua + true + ``` + + +## clarity_lsp + +`clarity-lsp` is a language server for the Clarity language. Clarity is a decidable smart contract language that optimizes for predictability and security. Smart contracts allow developers to encode essential business logic on a blockchain. + +To learn how to configure the clarity language server, see the [clarity-lsp documentation](https://github.com/hirosystems/clarity-lsp). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.clarity_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "clarity-lsp" } + ``` + - `filetypes` : + ```lua + { "clar", "clarity" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## clojure_lsp + +https://github.com/snoe/clojure-lsp + +Clojure Language Server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.clojure_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "clojure-lsp" } + ``` + - `filetypes` : + ```lua + { "clojure", "edn" } + ``` + - `root_dir` : + ```lua + root_pattern("project.clj", "deps.edn", "build.boot", "shadow-cljs.edn", ".git") + ``` + + +## cmake + +https://github.com/regen100/cmake-language-server + +CMake LSP Implementation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cmake.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cmake-language-server" } + ``` + - `filetypes` : + ```lua + { "cmake" } + ``` + - `init_options` : + ```lua + { + buildDirectory = "build" + } + ``` + - `root_dir` : + ```lua + root_pattern(".git", "compile_commands.json", "build") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## codeqlls + +Reference: +https://help.semmle.com/codeql/codeql-cli.html + +Binaries: +https://github.com/github/codeql-cli-binaries + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.codeqlls.setup{} +``` + + +**Default values:** + - `before_init` : + ```lua + see source file + ``` + - `cmd` : + ```lua + { "codeql", "execute", "language-server", "--check-errors", "ON_CHANGE", "-q" } + ``` + - `filetypes` : + ```lua + { "ql" } + ``` + - `log_level` : + ```lua + 2 + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + search_path = "list containing all search paths, eg: '~/codeql-home/codeql-repo'" + } + ``` + + +## crystalline + +https://github.com/elbywan/crystalline + +Crystal language server. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.crystalline.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "crystalline" } + ``` + - `filetypes` : + ```lua + { "crystal" } + ``` + - `root_dir` : + ```lua + root_pattern('shard.yml', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## csharp_ls + +https://github.com/razzmatazz/csharp-language-server + +Language Server for C#. + +csharp-ls requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +The preferred way to install csharp-ls is with `dotnet tool install --global csharp-ls`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.csharp_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "csharp-ls" } + ``` + - `filetypes` : + ```lua + { "cs" } + ``` + - `init_options` : + ```lua + { + AutomaticWorkspaceInit = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## cssls + + +https://github.com/hrsh7th/vscode-langservers-extracted + +`css-languageserver` can be installed via `npm`: + +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-css-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.cssls.setup { + capabilities = capabilities, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cssls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vscode-css-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "css", "scss", "less" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") or bufdir + ``` + - `settings` : + ```lua + { + css = { + validate = true + }, + less = { + validate = true + }, + scss = { + validate = true + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## cssmodules_ls + +https://github.com/antonk52/cssmodules-language-server + +Language server for autocompletion and go-to-definition functionality for CSS modules. + +You can install cssmodules-language-server via npm: +```sh +npm install -g cssmodules-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cssmodules_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cssmodules-language-server" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "typescript", "typescriptreact" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json") + ``` + + +## cucumber_language_server + +https://cucumber.io +https://github.com/cucumber/common +https://www.npmjs.com/package/@cucumber/language-server + +Language server for Cucumber. + +`cucumber-language-server` can be installed via `npm`: +```sh +npm install -g @cucumber/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cucumber_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cucumber-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "cucumber" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## dartls + +https://github.com/dart-lang/sdk/tree/master/pkg/analysis_server/tool/lsp_spec + +Language server for dart. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dartls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dart", "./snapshots/analysis_server.dart.snapshot", "--lsp" } + ``` + - `filetypes` : + ```lua + { "dart" } + ``` + - `init_options` : + ```lua + { + closingLabels = true, + flutterOutline = true, + onlyAnalyzeProjectsWithOpenFiles = true, + outline = true, + suggestFromUnimportedLibraries = true + } + ``` + - `root_dir` : + ```lua + root_pattern("pubspec.yaml") + ``` + - `settings` : + ```lua + { + dart = { + completeFunctionCalls = true, + showTodos = true + } + } + ``` + + +## denols + +https://github.com/denoland/deno + +Deno's built-in language server + +To approrpiately highlight codefences returned from denols, you will need to augment vim.g.markdown_fenced languages + in your init.lua. Example: + +```lua +vim.g.markdown_fenced_languages = { + "ts=typescript" +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.denols.setup{} +``` +**Commands:** +- DenolsCache: Cache a module and all of its dependencies. + +**Default values:** + - `cmd` : + ```lua + { "deno", "lsp" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" } + ``` + - `handlers` : + ```lua + { + ["textDocument/definition"] = , + ["textDocument/references"] = + } + ``` + - `init_options` : + ```lua + { + enable = true, + lint = false, + unstable = false + } + ``` + - `root_dir` : + ```lua + root_pattern("deno.json", "deno.jsonc", "tsconfig.json", ".git") + ``` + + +## dhall_lsp_server + +https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-lsp-server + +language server for dhall + +`dhall-lsp-server` can be installed via cabal: +```sh +cabal install dhall-lsp-server +``` +prebuilt binaries can be found [here](https://github.com/dhall-lang/dhall-haskell/releases). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dhall_lsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dhall-lsp-server" } + ``` + - `filetypes` : + ```lua + { "dhall" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## diagnosticls + +https://github.com/iamcco/diagnostic-languageserver + +Diagnostic language server integrate with linters. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.diagnosticls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "diagnostic-languageserver", "--stdio" } + ``` + - `filetypes` : + ```lua + Empty by default, override to add filetypes + ``` + - `root_dir` : + ```lua + Vim's starting directory + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dockerls + +https://github.com/rcjsuen/dockerfile-language-server-nodejs + +`docker-langserver` can be installed via `npm`: +```sh +npm install -g dockerfile-language-server-nodejs +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dockerls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "docker-langserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "dockerfile" } + ``` + - `root_dir` : + ```lua + root_pattern("Dockerfile") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dotls + +https://github.com/nikeee/dot-language-server + +`dot-language-server` can be installed via `npm`: +```sh +npm install -g dot-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dotls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dot-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "dot" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## efm + +https://github.com/mattn/efm-langserver + +General purpose Language Server that can use specified error message format generated from specified command. + +Requires at minimum EFM version [v0.0.38](https://github.com/mattn/efm-langserver/releases/tag/v0.0.38) to support +launching the language server on single files. If on an older version of EFM, disable single file support: + +```lua +require('lspconfig')['efm'].setup{ + settings = ..., -- You must populate this according to the EFM readme + filetypes = ..., -- Populate this according to the note below + single_file_support = false, -- This is the important line for supporting older version of EFM +} +``` + +Note: In order for neovim's built-in language server client to send the appropriate `languageId` to EFM, **you must +specify `filetypes` in your call to `setup{}`**. Otherwise `lspconfig` will launch EFM on the `BufEnter` instead +of the `FileType` autocommand, and the `filetype` variable used to populate the `languageId` will not yet be set. + +```lua +require('lspconfig')['efm'].setup{ + settings = ..., -- You must populate this according to the EFM readme + filetypes = { 'python','cpp','lua' } +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.efm.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "efm-langserver" } + ``` + - `root_dir` : + ```lua + util.root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## elixirls + +https://github.com/elixir-lsp/elixir-ls + +`elixir-ls` can be installed by following the instructions [here](https://github.com/elixir-lsp/elixir-ls#building-and-running). + +```bash +curl -fLO https://github.com/elixir-lsp/elixir-ls/releases/latest/download/elixir-ls.zip +unzip elixir-ls.zip -d /path/to/elixir-ls +# Unix +chmod +x /path/to/elixir-ls/language_server.sh +``` + +**By default, elixir-ls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of your unzipped elixir-ls. + +```lua +require'lspconfig'.elixirls.setup{ + -- Unix + cmd = { "/path/to/elixir-ls/language_server.sh" }; + -- Windows + cmd = { "/path/to/elixir-ls/language_server.bat" }; + ... +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.elixirls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "elixir", "eelixir" } + ``` + - `root_dir` : + ```lua + root_pattern("mix.exs", ".git") or vim.loop.os_homedir() + ``` + + +## elmls + +https://github.com/elm-tooling/elm-language-server#installation + +If you don't want to use Nvim to install it, then you can use: +```sh +npm install -g elm elm-test elm-format @elm-tooling/elm-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.elmls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "elm-language-server" } + ``` + - `filetypes` : + ```lua + { "elm" } + ``` + - `init_options` : + ```lua + { + elmAnalyseTrigger = "change" + } + ``` + - `root_dir` : + ```lua + root_pattern("elm.json") + ``` + + +## ember + +https://github.com/lifeart/ember-language-server + +`ember-language-server` can be installed via `npm`: + +```sh +npm install -g @lifeart/ember-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ember.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ember-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "handlebars", "typescript", "javascript" } + ``` + - `root_dir` : + ```lua + root_pattern("ember-cli-build.js", ".git") + ``` + + +## emmet_ls + +https://github.com/aca/emmet-ls + +Package can be installed via `npm`: +```sh +npm install -g emmet-ls +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.emmet_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "emmet-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "html", "css" } + ``` + - `root_dir` : + ```lua + git root + ``` + - `single_file_support` : + ```lua + true + ``` + + +## erlangls + +https://erlang-ls.github.io + +Language Server for Erlang. + +Clone [erlang_ls](https://github.com/erlang-ls/erlang_ls) +Compile the project with `make` and copy resulting binaries somewhere in your $PATH eg. `cp _build/*/bin/* ~/local/bin` + +Installation instruction can be found [here](https://github.com/erlang-ls/erlang_ls). + +Installation requirements: + - [Erlang OTP 21+](https://github.com/erlang/otp) + - [rebar3 3.9.1+](https://github.com/erlang/rebar3) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.erlangls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "erlang_ls" } + ``` + - `filetypes` : + ```lua + { "erlang" } + ``` + - `root_dir` : + ```lua + root_pattern('rebar.config', 'erlang.mk', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## esbonio + +https://github.com/swyddfa/esbonio + +Esbonio is a language server for [Sphinx](https://www.sphinx-doc.org/en/master/) documentation projects. +The language server can be installed via pip + +``` +pip install esbonio +``` + +Since Sphinx is highly extensible you will get best results if you install the language server in the same +Python environment as the one used to build your documentation. To ensure that the correct Python environment +is picked up, you can either launch `nvim` with the correct environment activated. + +``` +source env/bin/activate +nvim +``` + +Or you can modify the default `cmd` to include the full path to the Python interpreter. + +```lua +require'lspconfig'.esbonio.setup { + cmd = { '/path/to/virtualenv/bin/python', '-m', 'esbonio' } +} +``` + +Esbonio supports a number of config values passed as `init_options` on startup, for example. + +```lua +require'lspconfig'.esbonio.setup { + init_options = { + server = { + logLevel = "debug" + }, + sphinx = { + confDir = "/path/to/docs", + srcDir = "${confDir}/../docs-src" + } +} +``` + +A full list and explanation of the available options can be found [here](https://swyddfa.github.io/esbonio/docs/lsp/editors/index.html) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.esbonio.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "python3", "-m", "esbonio" } + ``` + - `filetypes` : + ```lua + { "rst" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## eslint + +https://github.com/hrsh7th/vscode-langservers-extracted + +vscode-eslint-language-server: A linting engine for JavaScript / Typescript + +`vscode-eslint-language-server` can be installed via `npm`: +```sh +npm i -g vscode-langservers-extracted +``` + +vscode-eslint-language-server provides an EslintFixAll command that can be used to format document on save +```vim +autocmd BufWritePre *.tsx,*.ts,*.jsx,*.js EslintFixAll +``` + +See [vscode-eslint](https://github.com/microsoft/vscode-eslint/blob/55871979d7af184bf09af491b6ea35ebd56822cf/server/src/eslintServer.ts#L216-L229) for configuration options. + +Additional messages you can handle: eslint/noConfig +Messages already handled in lspconfig: eslint/openDoc, eslint/confirmESLintExecution, eslint/probeFailed, eslint/noLibrary + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.eslint.setup{} +``` +**Commands:** +- EslintFixAll: Fix all eslint problems for this buffer + +**Default values:** + - `cmd` : + ```lua + { "vscode-eslint-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx", "vue" } + ``` + - `handlers` : + ```lua + { + ["eslint/confirmESLintExecution"] = , + ["eslint/noLibrary"] = , + ["eslint/openDoc"] = , + ["eslint/probeFailed"] = + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + codeAction = { + disableRuleComment = { + enable = true, + location = "separateLine" + }, + showDocumentation = { + enable = true + } + }, + codeActionOnSave = { + enable = false, + mode = "all" + }, + format = true, + nodePath = "", + onIgnoredFiles = "off", + packageManager = "npm", + quiet = false, + rulesCustomizations = {}, + run = "onType", + useESLintClass = false, + validate = "on", + workingDirectory = { + mode = "location" + } + } + ``` + + +## flow + +https://flow.org/ +https://github.com/facebook/flow + +See below for how to setup Flow itself. +https://flow.org/en/docs/install/ + +See below for lsp command options. + +```sh +npx flow lsp --help +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.flow.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "npx", "--no-install", "flow", "lsp" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx" } + ``` + - `root_dir` : + ```lua + root_pattern(".flowconfig") + ``` + + +## flux_lsp + +https://github.com/influxdata/flux-lsp +`flux-lsp` can be installed via `cargo`: +```sh +cargo install --git https://github.com/influxdata/flux-lsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.flux_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "flux-lsp" } + ``` + - `filetypes` : + ```lua + { "flux" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## foam_ls + +https://github.com/FoamScience/foam-language-server + +`foam-language-server` can be installed via `npm` +```sh +npm install -g foam-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.foam_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "foam-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "foam", "OpenFOAM" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## fortls + +https://github.com/hansec/fortran-language-server + +Fortran Language Server for the Language Server Protocol + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fortls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fortls" } + ``` + - `filetypes` : + ```lua + { "fortran" } + ``` + - `root_dir` : + ```lua + root_pattern(".fortls") + ``` + - `settings` : + ```lua + { + nthreads = 1 + } + ``` + + +## fsautocomplete + +https://github.com/fsharp/FsAutoComplete + +Language Server for F# provided by FsAutoComplete (FSAC). + +FsAutoComplete requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +The preferred way to install FsAutoComplete is with `dotnet tool install --global fsautocomplete`. + +Instructions to compile from source are found on the main [repository](https://github.com/fsharp/FsAutoComplete). + +You may also need to configure the filetype as Vim defaults to Forth for `*.fs` files: + +`autocmd BufNewFile,BufRead *.fs,*.fsx,*.fsi set filetype=fsharp` + +This is automatically done by plugins such as [PhilT/vim-fsharp](https://github.com/PhilT/vim-fsharp), [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp), and [adelarsq/neofsharp.vim](https://github.com/adelarsq/neofsharp.vim). + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fsautocomplete.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fsautocomplete", "--background-service-enabled" } + ``` + - `filetypes` : + ```lua + { "fsharp" } + ``` + - `init_options` : + ```lua + { + AutomaticWorkspaceInit = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## fstar + +https://github.com/FStarLang/FStar + +LSP support is included in FStar. Make sure `fstar.exe` is in your PATH. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fstar.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fstar.exe", "--lsp" } + ``` + - `filetypes` : + ```lua + { "fstar" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## gdscript + +https://github.com/godotengine/godot + +Language server for GDScript, used by Godot Engine. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gdscript.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nc", "localhost", "6008" } + ``` + - `filetypes` : + ```lua + { "gd", "gdscript", "gdscript3" } + ``` + - `root_dir` : + ```lua + util.root_pattern("project.godot", ".git") + ``` + + +## ghcide + +https://github.com/digital-asset/ghcide + +A library for building Haskell IDE tooling. +"ghcide" isn't for end users now. Use "haskell-language-server" instead of "ghcide". + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ghcide.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ghcide", "--lsp" } + ``` + - `filetypes` : + ```lua + { "haskell", "lhaskell" } + ``` + - `root_dir` : + ```lua + root_pattern("stack.yaml", "hie-bios", "BUILD.bazel", "cabal.config", "package.yaml") + ``` + + +## golangci_lint_ls + +Combination of both lint server and client + +https://github.com/nametake/golangci-lint-langserver +https://github.com/golangci/golangci-lint + + +Installation of binaries needed is done via + +``` +go install github.com/nametake/golangci-lint-langserver@latest +go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.42.1 +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.golangci_lint_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "golangci-lint-langserver" } + ``` + - `filetypes` : + ```lua + { "go", "gomod" } + ``` + - `init_options` : + ```lua + { + command = { "golangci-lint", "run", "--out-format", "json" } + } + ``` + - `root_dir` : + ```lua + root_pattern('go.work') or root_pattern('go.mod', '.golangci.yaml', '.git') + ``` + + +## gopls + +https://github.com/golang/tools/tree/master/gopls + +Google's lsp server for golang. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gopls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "gopls" } + ``` + - `filetypes` : + ```lua + { "go", "gomod", "gotmpl" } + ``` + - `root_dir` : + ```lua + root_pattern("go.mod", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## gradle_ls + +https://github.com/microsoft/vscode-gradle + +Microsoft's lsp server for gradle files + +If you're setting this up manually, build vscode-gradle using `./gradlew installDist` and point `cmd` to the `gradle-language-server` generated in the build directory + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gradle_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "gradle-language-server" } + ``` + - `filetypes` : + ```lua + { "groovy" } + ``` + - `root_dir` : + ```lua + root_pattern("settings.gradle") + ``` + + +## grammarly + +https://github.com/emacs-grammarly/unofficial-grammarly-language-server + +`unofficial-grammarly-language-server` can be installed via `npm`: + +```sh +npm i -g @emacs-grammarly/unofficial-grammarly-language-server +``` + +WARNING: Since this language server uses Grammarly's API, any document you open with it running is shared with them. Please evaluate their [privacy policy](https://www.grammarly.com/privacy-policy) before using this. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.grammarly.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "unofficial-grammarly-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `handlers` : + ```lua + { + ["$/updateDocumentState"] = + } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## graphql + +https://github.com/graphql/graphiql/tree/main/packages/graphql-language-service-cli + +`graphql-lsp` can be installed via `npm`: + +```sh +npm install -g graphql-language-service-cli +``` + +Note that you must also have [the graphql package](https://github.com/graphql/graphql-js) installed and create a [GraphQL config file](https://www.graphql-config.com/docs/user/user-introduction). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.graphql.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "graphql-lsp", "server", "-m", "stream" } + ``` + - `filetypes` : + ```lua + { "graphql", "typescriptreact", "javascriptreact" } + ``` + - `root_dir` : + ```lua + root_pattern('.git', '.graphqlrc*', '.graphql.config.*') + ``` + + +## groovyls + +https://github.com/prominic/groovy-language-server.git + +Requirements: + - Linux/macOS (for now) + - Java 11+ + +`groovyls` can be installed by following the instructions [here](https://github.com/prominic/groovy-language-server.git#build). + +If you have installed groovy language server, you can set the `cmd` custom path as follow: + +```lua +require'lspconfig'.groovyls.setup{ + -- Unix + cmd = { "java", "-jar", "path/to/groovyls/groovy-language-server-all.jar" }, + ... +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.groovyls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "java", "-jar", "groovy-language-server-all.jar" } + ``` + - `filetypes` : + ```lua + { "groovy" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## haxe_language_server + +https://github.com/vshaxe/haxe-language-server + +The Haxe language server can be built by running the following commands from +the project's root directory: + + npm install + npx lix run vshaxe-build -t language-server + +This will create `bin/server.js`. Note that the server requires Haxe 3.4.0 or +higher. + +After building the language server, set the `cmd` setting in your setup +function: + +```lua +lspconfig.haxe_language_server.setup({ + cmd = {"node", "path/to/bin/server.js"}, +}) +``` + +By default, an HXML compiler arguments file named `build.hxml` is expected in +your project's root directory. If your file is named something different, +specify it using the `init_options.displayArguments` setting. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.haxe_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "haxe-language-server" } + ``` + - `filetypes` : + ```lua + { "haxe" } + ``` + - `init_options` : + ```lua + { + displayArguments = { "build.hxml" } + } + ``` + - `root_dir` : + ```lua + root_pattern("*.hxml") + ``` + - `settings` : + ```lua + { + haxe = { + executable = "haxe" + } + } + ``` + + +## hdl_checker + +https://github.com/suoto/hdl_checker +Language server for hdl-checker. +Install using: `pip install hdl-checker --upgrade` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hdl_checker.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hdl_checker", "--lsp" } + ``` + - `filetypes` : + ```lua + { "vhdl", "verilog", "systemverilog" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## hhvm + +Language server for programs written in Hack +https://hhvm.com/ +https://github.com/facebook/hhvm +See below for how to setup HHVM & typechecker: +https://docs.hhvm.com/hhvm/getting-started/getting-started + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hhvm.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hh_client", "lsp" } + ``` + - `filetypes` : + ```lua + { "php", "hack" } + ``` + - `root_dir` : + ```lua + root_pattern(".hhconfig") + ``` + + +## hie + +https://github.com/haskell/haskell-ide-engine + +the following init_options are supported (see https://github.com/haskell/haskell-ide-engine#configuration): +```lua +init_options = { + languageServerHaskell = { + hlintOn = bool; + maxNumberOfProblems = number; + diagnosticsDebounceDuration = number; + liquidOn = bool (default false); + completionSnippetsOn = bool (default true); + formatOnImportOn = bool (default true); + formattingProvider = string (default "brittany", alternate "floskell"); + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hie.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hie-wrapper", "--lsp" } + ``` + - `filetypes` : + ```lua + { "haskell" } + ``` + - `root_dir` : + ```lua + root_pattern("stack.yaml", "package.yaml", ".git") + ``` + + +## hls + +https://github.com/haskell/haskell-language-server + +Haskell Language Server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "haskell-language-server-wrapper", "--lsp" } + ``` + - `filetypes` : + ```lua + { "haskell", "lhaskell" } + ``` + - `lspinfo` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml") + ``` + - `settings` : + ```lua + { + haskell = { + formattingProvider = "ormolu" + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## hoon_ls + +https://github.com/urbit/hoon-language-server + +A language server for Hoon. + +The language server can be installed via `npm install -g @hoon-language-server` + +Start a fake ~zod with `urbit -F zod`. +Start the language server at the Urbit Dojo prompt with: `|start %language-server` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hoon_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hoon-language-server" } + ``` + - `filetypes` : + ```lua + { "hoon" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## html + +https://github.com/hrsh7th/vscode-langservers-extracted + +`vscode-html-language-server` can be installed via `npm`: +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-html-language-server` only provides completions when snippet support is enabled. +To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +The code-formatting feature of the lsp can be controlled with the `provideFormatter` option. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.html.setup { + capabilities = capabilities, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.html.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vscode-html-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "html" } + ``` + - `init_options` : + ```lua + { + configurationSection = { "html", "css", "javascript" }, + embeddedLanguages = { + css = true, + javascript = true + }, + provideFormatter = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## idris2_lsp + +https://github.com/idris-community/idris2-lsp + +The Idris 2 language server. + +Plugins for the Idris 2 filetype include +[Idris2-Vim](https://github.com/edwinb/idris2-vim) (fewer features, stable) and +[Nvim-Idris2](https://github.com/ShinKage/nvim-idris2) (cutting-edge, +experimental). + +Idris2-Lsp requires a build of Idris 2 that includes the "Idris 2 API" package. +Package managers with known support for this build include the +[AUR](https://aur.archlinux.org/packages/idris2-api-git/) and +[Homebrew](https://formulae.brew.sh/formula/idris2#default). + +If your package manager does not support the Idris 2 API, you will need to build +Idris 2 from source. Refer to the +[the Idris 2 installation instructions](https://github.com/idris-lang/Idris2/blob/main/INSTALL.md) +for details. Steps 5 and 8 are listed as "optional" in that guide, but they are +necessary in order to make the Idris 2 API available. + +You need to install a version of Idris2-Lsp that is compatible with your +version of Idris 2. There should be a branch corresponding to every released +Idris 2 version after v0.4.0. Use the latest commit on that branch. For example, +if you have Idris v0.5.1, you should use the v0.5.1 branch of Idris2-Lsp. + +If your Idris 2 version is newer than the newest Idris2-Lsp branch, use the +latest commit on the `master` branch, and set a reminder to check the Idris2-Lsp +repo for the release of a compatible versioned branch. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.idris2_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "idris2-lsp" } + ``` + - `filetypes` : + ```lua + { "idris2" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## intelephense + +https://intelephense.com/ + +`intelephense` can be installed via `npm`: +```sh +npm install -g intelephense +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.intelephense.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "intelephense", "--stdio" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("composer.json", ".git") + ``` + + +## java_language_server + +https://github.com/georgewfraser/java-language-server + +Java language server + +Point `cmd` to `lang_server_linux.sh` or the equivalent script for macOS/Windows provided by java-language-server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.java_language_server.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "java" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## jdtls + +https://projects.eclipse.org/projects/eclipse.jdt.ls + +Language server for Java. + +IMPORTANT: If you want all the features jdtls has to offer, [nvim-jdtls](https://github.com/mfussenegger/nvim-jdtls) +is highly recommended. If all you need is diagnostics, completion, imports, gotos and formatting and some code actions +you can keep reading here. + +For manual installation you can download precompiled binaries from the +[official downloads site](http://download.eclipse.org/jdtls/snapshots/?d) + +Due to the nature of java, settings cannot be inferred. Please set the following +environmental variables to match your installation. If you need per-project configuration +[direnv](https://github.com/direnv/direnv) is highly recommended. + +```bash +# Mandatory: +# .bashrc +export JDTLS_HOME=/path/to/jdtls_root # Directory with the plugin and configs directories + +# Optional: +export JAVA_HOME=/path/to/java_home # In case you don't have java in path or want to use a version in particular +export WORKSPACE=/path/to/workspace # Defaults to $HOME/workspace +``` +```lua + -- init.lua + require'lspconfig'.jdtls.setup{} +``` + +For automatic installation you can use the following unofficial installers/launchers under your own risk: + - [jdtls-launcher](https://github.com/eruizc-dev/jdtls-launcher) (Includes lombok support by default) + ```lua + -- init.lua + require'lspconfig'.jdtls.setup{ cmd = { 'jdtls' } } + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jdtls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "/usr/lib/jvm/temurin-11-jdk-amd64/bin/java", "-Declipse.application=org.eclipse.jdt.ls.core.id1", "-Dosgi.bundles.defaultStartLevel=4", "-Declipse.product=org.eclipse.jdt.ls.core.product", "-Dlog.protocol=true", "-Dlog.level=ALL", "-Xms1g", "-Xmx2G", "--add-modules=ALL-SYSTEM", "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "-jar", "/plugins/org.eclipse.equinox.launcher_*.jar", "-configuration", "config_linux", "-data", "/home/runner/workspace" } + ``` + - `filetypes` : + ```lua + { "java" } + ``` + - `handlers` : + ```lua + { + ["language/status"] = , + ["textDocument/codeAction"] = , + ["textDocument/rename"] = , + ["workspace/applyEdit"] = + } + ``` + - `init_options` : + ```lua + { + jvm_args = {}, + workspace = "/home/runner/workspace" + } + ``` + - `root_dir` : + ```lua + { + -- Single-module projects + { + 'build.xml', -- Ant + 'pom.xml', -- Maven + 'settings.gradle', -- Gradle + 'settings.gradle.kts', -- Gradle + }, + -- Multi-module projects + { 'build.gradle', 'build.gradle.kts' }, + } or vim.fn.getcwd() + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jedi_language_server + +https://github.com/pappasam/jedi-language-server + +`jedi-language-server`, a language server for Python, built on top of jedi + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jedi_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "jedi-language-server" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + vim's starting directory + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jsonls + +https://github.com/hrsh7th/vscode-langservers-extracted + +vscode-json-language-server, a language server for JSON and JSON schema + +`vscode-json-language-server` can be installed via `npm`: +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-json-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.jsonls.setup { + capabilities = capabilities, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jsonls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vscode-json-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "json", "jsonc" } + ``` + - `init_options` : + ```lua + { + provideFormatter = true + } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jsonnet_ls + +https://github.com/grafana/jsonnet-language-server + +A Language Server Protocol (LSP) server for Jsonnet. + +The language server can be installed with `go`: +```sh +go install github.com/grafana/jsonnet-language-server@latest +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jsonnet_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "jsonnet-language-server" } + ``` + - `filetypes` : + ```lua + { "jsonnet", "libsonnet" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("jsonnetfile.json") + ``` + + +## julials + +https://github.com/julia-vscode/julia-vscode + +LanguageServer.jl can be installed with `julia` and `Pkg`: +```sh +julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.add("LanguageServer")' +``` +where `~/.julia/environments/nvim-lspconfig` is the location where +the default configuration expects LanguageServer.jl to be installed. + +To update an existing install, use the following command: +```sh +julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.update()' +``` + +Note: In order to have LanguageServer.jl pick up installed packages or dependencies in a +Julia project, you must make sure that the project is instantiated: +```sh +julia --project=/path/to/my/project -e 'using Pkg; Pkg.instantiate()' +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.julials.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "julia", "--startup-file=no", "--history-file=no", "-e", ' # Load LanguageServer.jl: attempt to load from ~/.julia/environments/nvim-lspconfig\n # with the regular load path as a fallback\n ls_install_path = joinpath(\n get(DEPOT_PATH, 1, joinpath(homedir(), ".julia")),\n "environments", "nvim-lspconfig"\n )\n pushfirst!(LOAD_PATH, ls_install_path)\n using LanguageServer\n popfirst!(LOAD_PATH)\n depot_path = get(ENV, "JULIA_DEPOT_PATH", "")\n project_path = let\n dirname(something(\n ## 1. Finds an explicitly set project (JULIA_PROJECT)\n Base.load_path_expand((\n p = get(ENV, "JULIA_PROJECT", nothing);\n p === nothing ? nothing : isempty(p) ? nothing : p\n )),\n ## 2. Look for a Project.toml file in the current working directory,\n ## or parent directories, with $HOME as an upper boundary\n Base.current_project(),\n ## 3. First entry in the load path\n get(Base.load_path(), 1, nothing),\n ## 4. Fallback to default global environment,\n ## this is more or less unreachable\n Base.load_path_expand("@v#.#"),\n ))\n end\n @info "Running language server" VERSION pwd() project_path depot_path\n server = LanguageServer.LanguageServerInstance(stdin, stdout, project_path, depot_path)\n server.runlinter = true\n run(server)\n ' } + ``` + - `filetypes` : + ```lua + { "julia" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## kotlin_language_server + + A kotlin language server which was developed for internal usage and + released afterwards. Maintaining is not done by the original author, + but by fwcd. + + It is built via gradle and developed on github. + Source and additional description: + https://github.com/fwcd/kotlin-language-server + + This server requires vim to be aware of the kotlin-filetype. + You could refer for this capability to: + https://github.com/udalov/kotlin-vim (recommended) + Note that there is no LICENSE specified yet. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.kotlin_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "kotlin-language-server" } + ``` + - `filetypes` : + ```lua + { "kotlin" } + ``` + - `root_dir` : + ```lua + root_pattern("settings.gradle") + ``` + + +## lean3ls + +https://github.com/leanprover/lean-client-js/tree/master/lean-language-server + +Lean installation instructions can be found +[here](https://leanprover-community.github.io/get_started.html#regular-install). + +Once Lean is installed, you can install the Lean 3 language server by running +```sh +npm install -g lean-language-server +``` + +Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim), +that plugin fully handles the setup of the Lean language server, +and you shouldn't set up `lean3ls` both with it and `lspconfig`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lean3ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lean-language-server", "--stdio", "--", "-M", "4096", "-T", "100000" } + ``` + - `filetypes` : + ```lua + { "lean3" } + ``` + - `offset_encoding` : + ```lua + "utf-32" + ``` + - `root_dir` : + ```lua + root_pattern("leanpkg.toml") or root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## leanls + +https://github.com/leanprover/lean4 + +Lean installation instructions can be found +[here](https://leanprover-community.github.io/get_started.html#regular-install). + +The Lean 4 language server is built-in with a Lean 4 install +(and can be manually run with, e.g., `lean --server`). + +Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim), +that plugin fully handles the setup of the Lean language server, +and you shouldn't set up `leanls` both with it and `lspconfig`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.leanls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lake", "serve", "--" } + ``` + - `filetypes` : + ```lua + { "lean" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `options` : + ```lua + { + no_lake_lsp_cmd = { "lean", "--server" } + } + ``` + - `root_dir` : + ```lua + root_pattern("lakefile.lean", "lean-toolchain", "leanpkg.toml", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## lelwel_ls + +https://github.com/0x2a-42/lelwel + +Language server for lelwel grammars. + +You can install `lelwel-ls` via cargo: +```sh +cargo install --features="lsp" lelwel +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lelwel_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lelwel-ls" } + ``` + - `filetypes` : + ```lua + { "llw" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## lemminx + +https://github.com/eclipse/lemminx + +The easiest way to install the server is to get a binary at https://download.jboss.org/jbosstools/vscode/stable/lemminx-binary/ and place it in your PATH. + +NOTE to macOS users: Binaries from unidentified developers are blocked by default. If you trust the downloaded binary from jboss.org, run it once, cancel the prompt, then remove the binary from Gatekeeper quarantine with `xattr -d com.apple.quarantine lemminx`. It should now run without being blocked. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lemminx.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lemminx" } + ``` + - `filetypes` : + ```lua + { "xml", "xsd", "xsl", "xslt", "svg" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ltex + +https://github.com/valentjn/ltex-ls + +LTeX Language Server: LSP language server for LanguageTool 🔍✔️ with support for LaTeX 🎓, Markdown 📝, and others + +To install, download the latest [release](https://github.com/valentjn/ltex-ls/releases) and ensure `ltex-ls` is on your path. + +To support org files or R sweave, users can define a custom filetype autocommand (or use a plugin which defines these filetypes): + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.org set filetype=org ]] +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ltex.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ltex-ls" } + ``` + - `filetypes` : + ```lua + { "bib", "gitcommit", "markdown", "org", "plaintex", "rst", "rnoweb", "tex" } + ``` + - `get_language_id` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## metals + +https://scalameta.org/metals/ + +Scala language server with rich IDE features. + +See full instructions in the Metals documentation: + +https://scalameta.org/metals/docs/editors/vim.html#using-an-alternative-lsp-client + +Note: that if you're using [nvim-metals](https://github.com/scalameta/nvim-metals), that plugin fully handles the setup and installation of Metals, and you shouldn't set up Metals both with it and `lspconfig`. + +To install Metals, make sure to have [coursier](https://get-coursier.io/docs/cli-installation) installed, and once you do you can install the latest Metals with `cs install metals`. You can also manually bootstrap Metals with the following command. + +```bash +cs bootstrap \ + --java-opt -Xss4m \ + --java-opt -Xms100m \ + org.scalameta:metals_2.12: \ + -r bintray:scalacenter/releases \ + -r sonatype:snapshots \ + -o /usr/local/bin/metals -f +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.metals.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "metals" } + ``` + - `filetypes` : + ```lua + { "scala" } + ``` + - `init_options` : + ```lua + { + compilerOptions = { + snippetAutoIndent = false + }, + isHttpEnabled = true, + statusBarProvider = "show-message" + } + ``` + - `message_level` : + ```lua + 4 + ``` + - `root_dir` : + ```lua + util.root_pattern("build.sbt", "build.sc", "build.gradle", "pom.xml") + ``` + + +## mint + +https://www.mint-lang.com + +Install Mint using the [instructions](https://www.mint-lang.com/install). +The language server is included since version 0.12.0. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mint.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mint", "ls" } + ``` + - `filetypes` : + ```lua + { "mint" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## mm0_ls + +https://github.com/digama0/mm0 + +Language Server for the metamath-zero theorem prover. + +Requires [mm0-rs](https://github.com/digama0/mm0/tree/master/mm0-rs) to be installed +and available on the `PATH`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mm0_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mm0-rs", "server" } + ``` + - `filetypes` : + ```lua + { "metamath-zero" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nickel_ls + +Nickel Language Server + +https://github.com/tweag/nickel + +`nls` can be installed with nix, or cargo, from the Nickel repository. +```sh +git clone https://github.com/tweag/nickel.git +``` + +Nix: +```sh +cd nickel +nix-env -f . -i +``` + +cargo: +```sh +cd nickel/lsp/nls +cargo install --path . +``` + +In order to have lspconfig detect Nickel filetypes (a prequisite for autostarting a server), +install the [Nickel vim plugin](https://github.com/nickel-lang/vim-nickel). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nickel_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nls" } + ``` + - `filetypes` : + ```lua + { "ncl", "nickel" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## nimls + +https://github.com/PMunch/nimlsp +`nimlsp` can be installed via the `nimble` package manager: +```sh +nimble install nimlsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nimls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nimlsp" } + ``` + - `filetypes` : + ```lua + { "nim" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ocamlls + +https://github.com/ocaml-lsp/ocaml-language-server + +`ocaml-language-server` can be installed via `npm` +```sh +npm install -g ocaml-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ocamlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ocaml-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "ocaml", "reason" } + ``` + - `root_dir` : + ```lua + root_pattern("*.opam", "esy.json", "package.json") + ``` + + +## ocamllsp + +https://github.com/ocaml/ocaml-lsp + +`ocaml-lsp` can be installed as described in [installation guide](https://github.com/ocaml/ocaml-lsp#installation). + +To install the lsp server in a particular opam switch: +```sh +opam pin add ocaml-lsp-server https://github.com/ocaml/ocaml-lsp.git +opam install ocaml-lsp-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ocamllsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ocamllsp" } + ``` + - `filetypes` : + ```lua + { "ocaml", "ocaml.menhir", "ocaml.interface", "ocaml.ocamllex", "reason" } + ``` + - `get_language_id` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("*.opam", "esy.json", "package.json", ".git") + ``` + + +## ols + + https://github.com/DanielGavin/ols + + `Odin Language Server`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ols.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ols" } + ``` + - `filetypes` : + ```lua + { "odin" } + ``` + - `root_dir` : + ```lua + util.root_pattern("ols.json", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## omnisharp + +https://github.com/omnisharp/omnisharp-roslyn +OmniSharp server based on Roslyn workspaces + +`omnisharp-roslyn` can be installed by downloading and extracting a release from [here](https://github.com/OmniSharp/omnisharp-roslyn/releases). +Omnisharp can also be built from source by following the instructions [here](https://github.com/omnisharp/omnisharp-roslyn#downloading-omnisharp). + +Omnisharp requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +**By default, omnisharp-roslyn doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. + +```lua +local pid = vim.fn.getpid() +-- On linux/darwin if using a release build, otherwise under scripts/OmniSharp(.Core)(.cmd) +local omnisharp_bin = "/path/to/omnisharp-repo/run" +-- on Windows +-- local omnisharp_bin = "/path/to/omnisharp/OmniSharp.exe" +require'lspconfig'.omnisharp.setup{ + cmd = { omnisharp_bin, "--languageserver" , "--hostPID", tostring(pid) }; + ... +} +``` + +Note, if you download the executable for darwin you will need to strip the quarantine label to run: +```bash +find /path/to/omnisharp-osx | xargs xattr -r -d com.apple.quarantine +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.omnisharp.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "cs", "vb" } + ``` + - `init_options` : + ```lua + {} + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern(".sln") or root_pattern(".csproj") + ``` + + +## opencl_ls + +https://github.com/Galarius/opencl-language-server + +Build instructions can be found [here](https://github.com/Galarius/opencl-language-server/blob/main/_dev/build.md). + +Prebuilt binaries are available for Linux, macOS and Windows [here](https://github.com/Galarius/opencl-language-server/releases). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.opencl_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "opencl-language-server" } + ``` + - `filetypes` : + ```lua + { "opencl" } + ``` + - `root_dir` : + ```lua + util.root_pattern(".git") + ``` + + +## openscad_ls + +https://github.com/dzhu/openscad-language-server + +A Language Server Protocol server for OpenSCAD + +You can build and install `openscad-language-server` binary with `cargo`: +```sh +cargo install openscad-language-server +``` + +Vim does not have built-in syntax for the `openscad` filetype currently. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.scad set filetype=openscad ]] +``` + +or by installing a filetype plugin such as https://github.com/sirtaj/vim-openscad + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.openscad_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "openscad-language-server" } + ``` + - `filetypes` : + ```lua + { "openscad" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## pasls + +https://github.com/genericptr/pascal-language-server + +An LSP server implementation for Pascal variants that are supported by Free Pascal, including Object Pascal. It uses CodeTools from Lazarus as backend. + +First set `cmd` to the Pascal lsp binary. + +Customization options are passed to pasls as environment variables for example in your `.bashrc`: +```bash +export FPCDIR='/usr/lib/fpc/src' # FPC source directory (This is the only required option for the server to work). +export PP='/usr/lib/fpc/3.2.2/ppcx64' # Path to the Free Pascal compiler executable. +export LAZARUSDIR='/usr/lib/lazarus' # Path to the Lazarus sources. +export FPCTARGET='' # Target operating system for cross compiling. +export FPCTARGETCPU='x86_64' # Target CPU for cross compiling. +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pasls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pasls" } + ``` + - `filetypes` : + ```lua + { "pascal" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## perlls + +https://github.com/richterger/Perl-LanguageServer/tree/master/clients/vscode/perl + +`Perl-LanguageServer`, a language server for Perl. + +To use the language server, ensure that you have Perl::LanguageServer installed and perl command is on your path. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.perlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "perl", "-MPerl::LanguageServer", "-e", "Perl::LanguageServer::run", "--", "--port 13603", "--nostdio 0", "--version 2.1.0" } + ``` + - `filetypes` : + ```lua + { "perl" } + ``` + - `root_dir` : + ```lua + vim's starting directory + ``` + - `settings` : + ```lua + { + perl = { + fileFilter = { ".pm", ".pl" }, + ignoreDirs = ".git", + perlCmd = "perl", + perlInc = " " + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## perlnavigator + +https://github.com/bscan/PerlNavigator + +A Perl language server + +**By default, perlnavigator doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. +You have to install the language server manually. + +Clone the PerlNavigator repo, install based on the [instructions](https://github.com/bscan/PerlNavigator#installation-for-other-editors), +and point `cmd` to `server.js` inside the `server/out` directory: + +```lua +cmd = {'node', '/server/out/server.js', '--stdio'} +``` + +At minimum, you will need `perl` in your path. If you want to use a non-standard `perl` you will need to set your configuration like so: +```lua +settings = { + perlnavigator = { + perlPath = '/some/odd/location/my-perl' + } +} +``` + +The `contributes.configuration.properties` section of `perlnavigator`'s `package.json` has all available configuration settings. All +settings have a reasonable default, but, at minimum, you may want to point `perlnavigator` at your `perltidy` and `perlcritic` configurations. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.perlnavigator.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + {} + ``` + - `filetypes` : + ```lua + { "perl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## perlpls + +https://github.com/FractalBoy/perl-language-server +https://metacpan.org/pod/PLS + +`PLS`, another language server for Perl. + +To use the language server, ensure that you have PLS installed and that it is in your path + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.perlpls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pls" } + ``` + - `filetypes` : + ```lua + { "perl" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `settings` : + ```lua + { + perl = { + perlcritic = { + enabled = false + }, + syntax = { + enabled = true + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## phpactor + +https://github.com/phpactor/phpactor + +Installation: https://phpactor.readthedocs.io/en/master/usage/standalone.html#global-installation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.phpactor.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "phpactor", "language-server" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("composer.json", ".git") + ``` + + +## please + +https://github.com/thought-machine/please + +High-performance extensible build system for reproducible multi-language builds. + +The `plz` binary will automatically install the LSP for you on first run + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.please.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "plz", "tool", "lps" } + ``` + - `filetypes` : + ```lua + { "bzl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## powershell_es + +https://github.com/PowerShell/PowerShellEditorServices + +Language server for PowerShell. + +To install, download and extract PowerShellEditorServices.zip +from the [releases](https://github.com/PowerShell/PowerShellEditorServices/releases). +To configure the language server, set the property `bundle_path` to the root +of the extracted PowerShellEditorServices.zip. + +The default configuration doesn't set `cmd` unless `bundle_path` is specified. + +```lua +require'lspconfig'.powershell_es.setup{ + bundle_path = 'c:/w/PowerShellEditorServices', +} +``` + +By default the languageserver is started in `pwsh` (PowerShell Core). This can be changed by specifying `shell`. + +```lua +require'lspconfig'.powershell_es.setup{ + bundle_path = 'c:/w/PowerShellEditorServices', + shell = 'powershell.exe', +} +``` + +Note that the execution policy needs to be set to `Unrestricted` for the languageserver run under PowerShell + +If necessary, specific `cmd` can be defined instead of `bundle_path`. +See [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices#stdio) +to learn more. + +```lua +require'lspconfig'.powershell_es.setup{ + cmd = {'pwsh', '-NoLogo', '-NoProfile', '-Command', "c:/PSES/Start-EditorServices.ps1 ..."} +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.powershell_es.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "ps1" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + git root or current directory + ``` + - `shell` : + ```lua + "pwsh" + ``` + - `single_file_support` : + ```lua + true + ``` + + +## prismals + +Language Server for the Prisma JavaScript and TypeScript ORM + +`@prisma/language-server` can be installed via npm +```sh +npm install -g @prisma/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.prismals.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "prisma-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "prisma" } + ``` + - `root_dir` : + ```lua + root_pattern(".git", "package.json") + ``` + - `settings` : + ```lua + { + prisma = { + prismaFmtBinPath = "" + } + } + ``` + + +## prosemd_lsp + +https://github.com/kitten/prosemd-lsp + +An experimental LSP for Markdown. + +Please see the manual installation instructions: https://github.com/kitten/prosemd-lsp#manual-installation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.prosemd_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "prosemd-lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + + ``` + - `single_file_support` : + ```lua + true + ``` + + +## psalm + +https://github.com/vimeo/psalm + +Can be installed with composer. +```sh +composer global require vimeo/psalm +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.psalm.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "psalm-language-server" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("psalm.xml", "psalm.xml.dist") + ``` + + +## puppet + +LSP server for Puppet. + +Installation: + +- Clone the editor-services repository: + https://github.com/puppetlabs/puppet-editor-services + +- Navigate into that directory and run: `bundle install` + +- Install the 'puppet-lint' gem: `gem install puppet-lint` + +- Add that repository to $PATH. + +- Ensure you can run `puppet-languageserver` from outside the editor-services directory. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.puppet.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "puppet-languageserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "puppet" } + ``` + - `root_dir` : + ```lua + root_pattern("manifests", ".puppet-lint.rc", "hiera.yaml", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## purescriptls + +https://github.com/nwolverson/purescript-language-server +`purescript-language-server` can be installed via `npm` +```sh +npm install -g purescript-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.purescriptls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "purescript-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "purescript" } + ``` + - `root_dir` : + ```lua + root_pattern("spago.dhall, 'psc-package.json', bower.json") + ``` + + +## pylsp + +https://github.com/python-lsp/python-lsp-server + +A Python 3.6+ implementation of the Language Server Protocol. + +The language server can be installed via `pipx install 'python-lsp-server[all]'`. +Further instructions can be found in the [project's README](https://github.com/python-lsp/python-lsp-server). + +Note: This is a community fork of `pyls`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pylsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pylsp" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## pyre + +https://pyre-check.org/ + +`pyre` a static type checker for Python 3. + +`pyre` offers an extremely limited featureset. It currently only supports diagnostics, +which are triggered on save. + +Do not report issues for missing features in `pyre` to `lspconfig`. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pyre.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pyre", "persistent" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## pyright + +https://github.com/microsoft/pyright + +`pyright`, a static type checker and language server for python + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pyright.setup{} +``` +**Commands:** +- PyrightOrganizeImports: Organize Imports + +**Default values:** + - `cmd` : + ```lua + { "pyright-langserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + python = { + analysis = { + autoSearchPaths = true, + diagnosticMode = "workspace", + useLibraryCodeForTypes = true + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## quick_lint_js + +https://quick-lint-js.com/ + +quick-lint-js finds bugs in JavaScript programs. + +See installation [instructions](https://quick-lint-js.com/install/) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.quick_lint_js.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "quick-lint-js", "--lsp-server" } + ``` + - `filetypes` : + ```lua + { "javascript" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## r_language_server + +[languageserver](https://github.com/REditorSupport/languageserver) is an +implementation of the Microsoft's Language Server Protocol for the R +language. + +It is released on CRAN and can be easily installed by + +```R +install.packages("languageserver") +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.r_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "R", "--slave", "-e", "languageserver::run()" } + ``` + - `filetypes` : + ```lua + { "r", "rmd" } + ``` + - `log_level` : + ```lua + 2 + ``` + - `root_dir` : + ```lua + root_pattern(".git") or os_homedir + ``` + + +## racket_langserver + +[https://github.com/jeapostrophe/racket-langserver](https://github.com/jeapostrophe/racket-langserver) + +The Racket language server. This project seeks to use +[DrRacket](https://github.com/racket/drracket)'s public API to provide +functionality that mimics DrRacket's code tools as closely as possible. + +Install via `raco`: `raco pkg install racket-langserver` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.racket_langserver.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "racket", "--lib", "racket-langserver" } + ``` + - `filetypes` : + ```lua + { "racket", "scheme" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## reason_ls + +Reason language server + +**By default, reason_ls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. +You have to install the language server manually. + +You can install reason language server from [reason-language-server](https://github.com/jaredly/reason-language-server) repository. + +```lua +cmd = {''} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.reason_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "reason-language-server" } + ``` + - `filetypes` : + ```lua + { "reason" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## remark_ls + +https://github.com/remarkjs/remark-language-server + +`remark-language-server` can be installed via `npm`: +```sh +npm install -g remark-language-server +``` + +`remark-language-server` uses the same +[configuration files](https://github.com/remarkjs/remark/tree/main/packages/remark-cli#example-config-files-json-yaml-js) +as `remark-cli`. + +This uses a plugin based system. Each plugin needs to be installed locally using `npm` or `yarn`. + +For example, given the following `.remarkrc.json`: + +```json +{ + "presets": [ + "remark-preset-lint-recommended" + ] +} +``` + +`remark-preset-lint-recommended` needs to be installed in the local project: + +```sh +npm install remark-preset-lint-recommended +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.remark_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "remark-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## rescriptls + +https://github.com/rescript-lang/rescript-vscode + +ReScript language server + +**By default, rescriptls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. +You have to install the language server manually. + +You can use the bundled language server inside the [vim-rescript](https://github.com/rescript-lang/vim-rescript) repo. + +Clone the vim-rescript repo and point `cmd` to `server.js` inside `server/out` directory: + +```lua +cmd = {'node', '/server/out/server.js', '--stdio'} + +``` + +If you have vim-rescript installed you can also use that installation. for example if you're using packer.nvim you can set cmd to something like this: + +```lua +cmd = { + 'node', + '/home/username/.local/share/nvim/site/pack/packer/start/vim-rescript/server/out/server.js', + '--stdio' +} +``` + +Another option is to use vscode extension [release](https://github.com/rescript-lang/rescript-vscode/releases). +Take a look at [here](https://github.com/rescript-lang/rescript-vscode#use-with-other-editors) for instructions. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rescriptls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + {} + ``` + - `filetypes` : + ```lua + { "rescript" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## rls + +https://github.com/rust-lang/rls + +rls, a language server for Rust + +See https://github.com/rust-lang/rls#setup to setup rls itself. +See https://github.com/rust-lang/rls#configuration for rls-specific settings. +All settings listed on the rls configuration section of the readme +must be set under settings.rust as follows: + +```lua +nvim_lsp.rls.setup { + settings = { + rust = { + unstable_features = true, + build_on_save = false, + all_features = true, + }, + }, +} +``` + +If you want to use rls for a particular build, eg nightly, set cmd as follows: + +```lua +cmd = {"rustup", "run", "nightly", "rls"} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rls" } + ``` + - `filetypes` : + ```lua + { "rust" } + ``` + - `root_dir` : + ```lua + root_pattern("Cargo.toml") + ``` + + +## rnix + +https://github.com/nix-community/rnix-lsp + +A language server for Nix providing basic completion and formatting via nixpkgs-fmt. + +To install manually, run `cargo install rnix-lsp`. If you are using nix, rnix-lsp is in nixpkgs. + +This server accepts configuration via the `settings` key. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rnix.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rnix-lsp" } + ``` + - `filetypes` : + ```lua + { "nix" } + ``` + - `init_options` : + ```lua + {} + ``` + - `root_dir` : + ```lua + vim's starting directory + ``` + - `settings` : + ```lua + {} + ``` + + +## robotframework_ls + +https://github.com/robocorp/robotframework-lsp + +Language Server Protocol implementation for Robot Framework. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.robotframework_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "robotframework_ls" } + ``` + - `filetypes` : + ```lua + { "robot" } + ``` + - `root_dir` : + ```lua + util.root_pattern('robotidy.toml', 'pyproject.toml')(fname) or util.find_git_ancestor(fname) + ``` + + +## rome + +https://rome.tools + +Language server for the Rome Frontend Toolchain. + +```sh +npm install [-g] rome +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rome.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rome", "lsp" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "json", "typescript", "typescript.tsx", "typescriptreact" } + ``` + - `root_dir` : + ```lua + root_pattern('package.json', 'node_modules', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## rust_analyzer + +https://github.com/rust-analyzer/rust-analyzer + +rust-analyzer (aka rls 2.0), a language server for Rust + +See [docs](https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/user#settings) for extra settings. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rust_analyzer.setup{} +``` +**Commands:** +- CargoReload: Reload current cargo workspace + +**Default values:** + - `cmd` : + ```lua + { "rust-analyzer" } + ``` + - `filetypes` : + ```lua + { "rust" } + ``` + - `root_dir` : + ```lua + root_pattern("Cargo.toml", "rust-project.json") + ``` + - `settings` : + ```lua + { + ["rust-analyzer"] = {} + } + ``` + + +## salt_ls + +Language server for Salt configuration files. +https://github.com/dcermak/salt-lsp + +The language server can be installed with `pip`: +```sh +pip install salt-lsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.salt_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "salt_lsp_server" } + ``` + - `filetypes` : + ```lua + { "sls" } + ``` + - `root_dir` : + ```lua + root_pattern('.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## scry + +https://github.com/crystal-lang-tools/scry + +Crystal language server. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.scry.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "scry" } + ``` + - `filetypes` : + ```lua + { "crystal" } + ``` + - `root_dir` : + ```lua + root_pattern('shard.yml', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## serve_d + + https://github.com/Pure-D/serve-d + + `Microsoft language server protocol implementation for D using workspace-d.` + Download a binary from https://github.com/Pure-D/serve-d/releases and put it in your $PATH. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.serve_d.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "serve-d" } + ``` + - `filetypes` : + ```lua + { "d" } + ``` + - `root_dir` : + ```lua + util.root_pattern("dub.json", "dub.sdl", ".git") + ``` + + +## sixtyfps + +https://github.com/sixtyfpsui/sixtyfps +`SixtyFPS`'s language server + +You can build and install `sixtyfps-lsp` binary with `cargo`: +```sh +cargo install sixtyfps-lsp +``` + +Vim does not have built-in syntax for the `sixtyfps` filetype currently. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.60 set filetype=sixtyfps ]] +``` + +or by installing a filetype plugin such as https://github.com/RustemB/sixtyfps-vim + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sixtyfps.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sixtyfps-lsp" } + ``` + - `filetypes` : + ```lua + { "sixtyfps" } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## slint_lsp + +https://github.com/slint-ui/slint +`Slint`'s language server + +You can build and install `slint-lsp` binary with `cargo`: +```sh +cargo install slint-lsp +``` + +Vim does not have built-in syntax for the `slint` filetype at this time. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.slint set filetype=slint ]] +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.slint_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "slint-lsp" } + ``` + - `filetypes` : + ```lua + { "slint" } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## solang + +A language server for Solidity + +See the [documentation](https://solang.readthedocs.io/en/latest/installing.html) for installation instructions. + +The language server only provides the following capabilities: +* Syntax highlighting +* Diagnostics +* Hover + +There is currently no support for completion, goto definition, references, or other functionality. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solang.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solang", "--language-server", "--target", "ewasm" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## solargraph + +https://solargraph.org/ + +solargraph, a language server for Ruby + +You can install solargraph via gem install. + +```sh +gem install --user-install solargraph +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solargraph.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solargraph", "stdio" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `init_options` : + ```lua + { + formatting = true + } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + - `settings` : + ```lua + { + solargraph = { + diagnostics = true + } + } + ``` + + +## solc + +https://docs.soliditylang.org/en/latest/installing-solidity.html + +solc is the native language server for the Solidity language. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solc.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solc", "--lsp" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## solidity_ls + +npm install -g solidity-language-server + +solidity-language-server is a language server for the solidity language ported from the vscode solidity extension + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solidity_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solidity-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + root_pattern(".git", "package.json") + ``` + + +## sorbet + +https://sorbet.org + +Sorbet is a fast, powerful type checker designed for Ruby. + +You can install Sorbet via gem install. You might also be interested in how to set +Sorbet up for new projects: https://sorbet.org/docs/adopting. + +```sh +gem install sorbet +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sorbet.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "srb", "tc", "--lsp" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + + +## sourcekit + +https://github.com/apple/sourcekit-lsp + +Language server for Swift and C/C++/Objective-C. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sourcekit.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sourcekit-lsp" } + ``` + - `filetypes` : + ```lua + { "swift", "c", "cpp", "objective-c", "objective-cpp" } + ``` + - `root_dir` : + ```lua + root_pattern("Package.swift", ".git") + ``` + + +## sourcery + +https://github.com/sourcery-ai/sourcery + +Refactor Python instantly using the power of AI. + +It requires the initializationOptions param to be populated as shown below and will respond with the list of ServerCapabilities that it supports. + +init_options = { + --- The Sourcery token for authenticating the user. + --- This is retrieved from the Sourcery website and must be + --- provided by each user. The extension must provide a + --- configuration option for the user to provide this value. + token = + + --- The extension's name and version as defined by the extension. + extension_version = 'vim.lsp' + + --- The editor's name and version as defined by the editor. + editor_version = 'vim' +} + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sourcery.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sourcery", "lsp" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `init_options` : + ```lua + { + editor_version = "vim", + extension_version = "vim.lsp" + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## spectral + +https://github.com/luizcorreia/spectral-language-server + `A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v2 & v3.` + +`spectral-language-server` can be installed via `npm`: +```sh +npm i -g spectral-language-server +``` +See [vscode-spectral](https://github.com/stoplightio/vscode-spectral#extension-settings) for configuration options. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.spectral.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "spectral-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml", "json", "yml" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + enable = true, + run = "onType", + validateLanguages = { "yaml", "json", "yml" } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## sqlls + +https://github.com/joe-re/sql-language-server + +This LSP can be installed via `npm`. Find further instructions on manual installation of the sql-language-server at [joe-re/sql-language-server](https://github.com/joe-re/sql-language-server). +
+ + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sqlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sql-language-server", "up", "--method", "stdio" } + ``` + - `filetypes` : + ```lua + { "sql", "mysql" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## sqls + +https://github.com/lighttiger2505/sqls + +```lua +require'lspconfig'.sqls.setup{ + cmd = {"path/to/command", "-config", "path/to/config.yml"}; + ... +} +``` +Sqls can be installed via `go get github.com/lighttiger2505/sqls`. Instructions for compiling Sqls from the source can be found at [lighttiger2505/sqls](https://github.com/lighttiger2505/sqls). + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sqls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sqls" } + ``` + - `filetypes` : + ```lua + { "sql", "mysql" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## stylelint_lsp + +https://github.com/bmatcuk/stylelint-lsp + +`stylelint-lsp` can be installed via `npm`: + +```sh +npm i -g stylelint-lsp +``` + +Can be configured by passing a `settings.stylelintplus` object to `stylelint_lsp.setup`: + +```lua +require'lspconfig'.stylelint_lsp.setup{ + settings = { + stylelintplus = { + -- see available options in stylelint-lsp documentation + } + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.stylelint_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "stylelint-lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "css", "less", "scss", "sugarss", "vue", "wxss", "javascript", "javascriptreact", "typescript", "typescriptreact" } + ``` + - `root_dir` : + ```lua + root_pattern('.stylelintrc', 'package.json') + ``` + - `settings` : + ```lua + {} + ``` + + +## sumneko_lua + +https://github.com/sumneko/lua-language-server + +Lua language server. + +`lua-language-server` can be installed by following the instructions [here](https://github.com/sumneko/lua-language-server/wiki/Build-and-Run). The default `cmd` assumes that the `lua-language-server` binary can be found in `$PATH`. + +```lua +local runtime_path = vim.split(package.path, ';') +table.insert(runtime_path, "lua/?.lua") +table.insert(runtime_path, "lua/?/init.lua") + +require'lspconfig'.sumneko_lua.setup { + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT', + -- Setup your lua path + path = runtime_path, + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = {'vim'}, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = vim.api.nvim_get_runtime_file("", true), + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + }, + }, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sumneko_lua.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lua-language-server" } + ``` + - `filetypes` : + ```lua + { "lua" } + ``` + - `log_level` : + ```lua + 2 + ``` + - `root_dir` : + ```lua + root_pattern(".luarc.json", ".luacheckrc", ".stylua.toml", "selene.toml", ".git") + ``` + - `settings` : + ```lua + { + Lua = { + telemetry = { + enable = false + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## svelte + +https://github.com/sveltejs/language-tools/tree/master/packages/language-server + +`svelte-language-server` can be installed via `npm`: +```sh +npm install -g svelte-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.svelte.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "svelteserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "svelte" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") + ``` + + +## svls + +https://github.com/dalance/svls + +Language server for verilog and SystemVerilog + +`svls` can be installed via `cargo`: + ```sh + cargo install svls + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.svls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "svls" } + ``` + - `filetypes` : + ```lua + { "verilog", "systemverilog" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## tailwindcss + +https://github.com/tailwindlabs/tailwindcss-intellisense + +Tailwind CSS Language Server can be installed via npm: +```sh +npm install -g @tailwindcss/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tailwindcss.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tailwindcss-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "aspnetcorerazor", "astro", "astro-markdown", "blade", "django-html", "htmldjango", "edge", "eelixir", "ejs", "erb", "eruby", "gohtml", "haml", "handlebars", "hbs", "html", "html-eex", "heex", "jade", "leaf", "liquid", "markdown", "mdx", "mustache", "njk", "nunjucks", "php", "razor", "slim", "twig", "css", "less", "postcss", "sass", "scss", "stylus", "sugarss", "javascript", "javascriptreact", "reason", "rescript", "typescript", "typescriptreact", "vue", "svelte" } + ``` + - `init_options` : + ```lua + { + userLanguages = { + eelixir = "html-eex", + eruby = "erb" + } + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern('tailwind.config.js', 'tailwind.config.ts', 'postcss.config.js', 'postcss.config.ts', 'package.json', 'node_modules', '.git') + ``` + - `settings` : + ```lua + { + tailwindCSS = { + classAttributes = { "class", "className", "classList", "ngClass" }, + lint = { + cssConflict = "warning", + invalidApply = "error", + invalidConfigPath = "error", + invalidScreen = "error", + invalidTailwindDirective = "error", + invalidVariant = "error", + recommendedVariantOrder = "warning" + }, + validate = true + } + } + ``` + + +## taplo + +https://taplo.tamasfe.dev/lsp/ + +Language server for Taplo, a TOML toolkit. + +`taplo-cli` can be installed via `cargo`: +```sh +cargo install --locked taplo-cli +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.taplo.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "taplo", "lsp", "stdio" } + ``` + - `filetypes` : + ```lua + { "toml" } + ``` + - `root_dir` : + ```lua + root_pattern("*.toml", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## teal_ls + +https://github.com/teal-language/teal-language-server + +Install with: +``` +luarocks install --dev teal-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.teal_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "teal-language-server" } + ``` + - `filetypes` : + ```lua + { "teal" } + ``` + - `root_dir` : + ```lua + root_pattern("tlconfig.lua", ".git") + ``` + + +## terraform_lsp + +https://github.com/juliosueiras/terraform-lsp + +Terraform language server +Download a released binary from +https://github.com/juliosueiras/terraform-lsp/releases. + +From https://github.com/hashicorp/terraform-ls#terraform-ls-vs-terraform-lsp: + +Both HashiCorp and the maintainer of terraform-lsp expressed interest in +collaborating on a language server and are working towards a _long-term_ +goal of a single stable and feature-complete implementation. + +For the time being both projects continue to exist, giving users the +choice: + +- `terraform-ls` providing + - overall stability (by relying only on public APIs) + - compatibility with any provider and any Terraform >=0.12.0 currently + less features + - due to project being younger and relying on public APIs which may + not offer the same functionality yet + +- `terraform-lsp` providing + - currently more features + - compatibility with a single particular Terraform (0.12.20 at time of writing) + - configs designed for other 0.12 versions may work, but interpretation may be inaccurate + - less stability (due to reliance on Terraform's own internal packages) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.terraform_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "terraform-lsp" } + ``` + - `filetypes` : + ```lua + { "terraform", "hcl" } + ``` + - `root_dir` : + ```lua + root_pattern(".terraform", ".git") + ``` + + +## terraformls + +https://github.com/hashicorp/terraform-ls + +Terraform language server +Download a released binary from https://github.com/hashicorp/terraform-ls/releases. + +From https://github.com/hashicorp/terraform-ls#terraform-ls-vs-terraform-lsp: + +Both HashiCorp and the maintainer of terraform-lsp expressed interest in +collaborating on a language server and are working towards a _long-term_ +goal of a single stable and feature-complete implementation. + +For the time being both projects continue to exist, giving users the +choice: + +- `terraform-ls` providing + - overall stability (by relying only on public APIs) + - compatibility with any provider and any Terraform >=0.12.0 currently + less features + - due to project being younger and relying on public APIs which may + not offer the same functionality yet + +- `terraform-lsp` providing + - currently more features + - compatibility with a single particular Terraform (0.12.20 at time of writing) + - configs designed for other 0.12 versions may work, but interpretation may be inaccurate + - less stability (due to reliance on Terraform's own internal packages) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.terraformls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "terraform-ls", "serve" } + ``` + - `filetypes` : + ```lua + { "terraform" } + ``` + - `root_dir` : + ```lua + root_pattern(".terraform", ".git") + ``` + + +## texlab + +https://github.com/latex-lsp/texlab + +A completion engine built from scratch for (La)TeX. + +See https://github.com/latex-lsp/texlab/blob/master/docs/options.md for configuration options. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.texlab.setup{} +``` +**Commands:** +- TexlabBuild: Build the current buffer +- TexlabForward: Forward search from current position + +**Default values:** + - `cmd` : + ```lua + { "texlab" } + ``` + - `filetypes` : + ```lua + { "tex", "bib" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + texlab = { + auxDirectory = ".", + bibtexFormatter = "texlab", + build = { + args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" }, + executable = "latexmk", + forwardSearchAfter = false, + onSave = false + }, + chktex = { + onEdit = false, + onOpenAndSave = false + }, + diagnosticsDelay = 300, + formatterLineLength = 80, + forwardSearch = { + args = {} + }, + latexFormatter = "latexindent", + latexindent = { + modifyLineBreaks = false + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## tflint + +https://github.com/terraform-linters/tflint + +A pluggable Terraform linter that can act as lsp server. +Installation instructions can be found in https://github.com/terraform-linters/tflint#installation. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tflint.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tflint", "--langserver" } + ``` + - `filetypes` : + ```lua + { "terraform" } + ``` + - `root_dir` : + ```lua + root_pattern(".terraform", ".git", ".tflint.hcl") + ``` + + +## theme_check + +https://github.com/Shopify/shopify-cli + +`theme-check-language-server` is bundled with `shopify-cli` or it can also be installed via + +https://github.com/Shopify/theme-check#installation + +**NOTE:** +If installed via Homebrew, `cmd` must be set to 'theme-check-liquid-server' + +```lua +require lspconfig.theme_check.setup { + cmd = { 'theme-check-liquid-server' } +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.theme_check.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "theme-check-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "liquid" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## tsserver + +https://github.com/theia-ide/typescript-language-server + +`typescript-language-server` depends on `typescript`. Both packages can be installed via `npm`: +```sh +npm install -g typescript typescript-language-server +``` + +To configure type language server, add a +[`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or +[`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to the root of your +project. + +Here's an example that disables type checking in JavaScript files. + +```json +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "checkJs": false + }, + "exclude": [ + "node_modules" + ] +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tsserver.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "typescript-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" } + ``` + - `init_options` : + ```lua + { + hostInfo = "neovim" + } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git") + ``` + + +## typeprof + +https://github.com/ruby/typeprof + +`typeprof` is the built-in analysis and LSP tool for Ruby 3.1+. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.typeprof.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "typeprof", "--lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "ruby", "eruby" } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + + +## vala_ls + +https://github.com/Prince781/vala-language-server + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vala_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vala-language-server" } + ``` + - `filetypes` : + ```lua + { "vala", "genie" } + ``` + - `root_dir` : + ```lua + root_pattern("meson.build", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## vdmj + +https://github.com/nickbattle/vdmj + +The VDMJ language server can be installed by cloning the VDMJ repository and +running `mvn clean install`. + +Various options are provided to configure the language server (see below). In +particular: +- `annotation_paths` is a list of folders and/or jar file paths for annotations +that should be used with the language server; +- any value of `debugger_port` less than zero will disable the debugger; note +that if a non-zero value is used, only one instance of the server can be active +at a time. + +More settings for VDMJ can be changed in a file called `vdmj.properties` under +`root_dir/.vscode`. For a description of the available settings, see +[Section 7 of the VDMJ User Guide](https://raw.githubusercontent.com/nickbattle/vdmj/master/vdmj/documentation/UserGuide.pdf). + +Note: proof obligations and combinatorial testing are not currently supported +by neovim. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vdmj.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + Generated from the options given + ``` + - `filetypes` : + ```lua + { "vdmsl", "vdmpp", "vdmrt" } + ``` + - `options` : + ```lua + { + annotation_paths = {}, + debugger_port = -1, + high_precision = false, + java = "$JAVA_HOME/bin/java", + java_opts = { "-Xmx3000m", "-Xss1m" }, + logfile = "path.join(vim.fn.stdpath 'cache', 'vdm-lsp.log')", + mavenrepo = "$HOME/.m2/repository/com/fujitsu", + version = "The latest version installed in `mavenrepo`" + } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor(fname) or find_vscode_ancestor(fname) + ``` + + +## verible + +https://github.com/chipsalliance/verible + +A linter and formatter for verilog and SystemVerilog files. + +Release binaries can be downloaded from [here](https://github.com/chipsalliance/verible/releases) +and placed in a directory on PATH. + +See https://github.com/chipsalliance/verible/tree/master/verilog/tools/ls/README.md for options. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.verible.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "verible-verilog-ls" } + ``` + - `filetypes` : + ```lua + { "systemverilog", "verilog" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## vimls + +https://github.com/iamcco/vim-language-server + +You can install vim-language-server via npm: +```sh +npm install -g vim-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vimls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vim-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "vim" } + ``` + - `init_options` : + ```lua + { + diagnostic = { + enable = true + }, + indexes = { + count = 3, + gap = 100, + projectRootPatterns = { "runtime", "nvim", ".git", "autoload", "plugin" }, + runtimepath = true + }, + iskeyword = "@,48-57,_,192-255,-#", + runtimepath = "", + suggest = { + fromRuntimepath = true, + fromVimruntime = true + }, + vimruntime = "" + } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## vls + +https://github.com/vlang/vls + +V language server. + +`v-language-server` can be installed by following the instructions [here](https://github.com/vlang/vls#installation). + +**By default, v-language-server doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of your unzipped and compiled v-language-server. + +```lua +-- set the path to the vls installation; +local vls_root_path = vim.fn.stdpath('cache')..'/lspconfig/vls' +local vls_binary = vls_root_path.."/cmd/vls/vls" + +require'lspconfig'.vls.setup { + cmd = {vls_binary}, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "vlang" } + ``` + - `root_dir` : + ```lua + root_pattern("v.mod", ".git") + ``` + + +## volar + +https://github.com/johnsoncodehk/volar/tree/master/packages/vue-language-server + +Volar language server for Vue + +Volar can be installed via npm: + +```sh +npm install -g @volar/vue-language-server +``` + +Volar by default supports Vue 3 projects. Vue 2 projects need [additional configuration](https://github.com/johnsoncodehk/volar/blob/master/extensions/vscode-vue-language-features/README.md?plain=1#L28-L63). + +**Take Over Mode** +Volar can serve as a language server for both Vue and TypeScript via [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471). + +To enable Take Over Mode, override the default filetypes in `setup{}` as follows: + +```lua +require'lspconfig'.volar.setup{ + filetypes = {'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue', 'json'} +} +``` + +**Overriding the default TypeScript Server used by Volar** +The default config looks for TS in the local node_modules. The alternatives are: + +- use a global TypeScript Server installation + +```lua +require'lspconfig'.volar.setup{ + init_options = { + typescript = { + serverPath = '/path/to/.npm/lib/node_modules/typescript/lib/tsserverlib.js' + } + } +} +``` + +- use a global TypeScript Server installation if a local server is not found + +```lua +local util = require 'lspconfig.util' + +local function get_typescript_server_path(root_dir) + local project_root = util.find_node_modules_ancestor(root_dir) + + local local_tsserverlib = project_root ~= nil and util.path.join(project_root, 'node_modules', 'typescript', 'lib', 'tsserverlibrary.js') + local global_tsserverlib = '/home/[yourusernamehere]/.npm/lib/node_modules/typescript/lib/tsserverlibrary.js' + + if local_tsserverlib and util.path.exists(local_tsserverlib) then + return local_tsserverlib + else + return global_tsserverlib + end +end + +require'lspconfig'.volar.setup{ + on_new_config = function(new_config, new_root_dir) + new_config.init_options.typescript.serverPath = get_typescript_server_path(new_root_dir) + end, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.volar.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vue-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "vue" } + ``` + - `init_options` : + ```lua + { + documentFeatures = { + documentColor = false, + documentFormatting = { + defaultPrintWidth = 100 + }, + documentSymbol = true, + foldingRange = true, + linkedEditingRange = true, + selectionRange = true + }, + languageFeatures = { + callHierarchy = true, + codeAction = true, + codeLens = true, + completion = { + defaultAttrNameCase = "kebabCase", + defaultTagNameCase = "both" + }, + definition = true, + diagnostics = true, + documentHighlight = true, + documentLink = true, + hover = true, + implementation = true, + references = true, + rename = true, + renameFileRefactoring = true, + schemaRequestService = true, + semanticTokens = false, + signatureHelp = true, + typeDefinition = true + }, + typescript = { + serverPath = "" + } + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## vuels + +https://github.com/vuejs/vetur/tree/master/server + +Vue language server(vls) +`vue-language-server` can be installed via `npm`: +```sh +npm install -g vls +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vuels.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vls" } + ``` + - `filetypes` : + ```lua + { "vue" } + ``` + - `init_options` : + ```lua + { + config = { + css = {}, + emmet = {}, + html = { + suggest = {} + }, + javascript = { + format = {} + }, + stylusSupremacy = {}, + typescript = { + format = {} + }, + vetur = { + completion = { + autoImport = false, + tagCasing = "kebab", + useScaffoldSnippets = false + }, + format = { + defaultFormatter = { + js = "none", + ts = "none" + }, + defaultFormatterOptions = {}, + scriptInitialIndent = false, + styleInitialIndent = false + }, + useWorkspaceDependencies = false, + validation = { + script = true, + style = true, + template = true + } + } + } + } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", "vue.config.js") + ``` + + +## yamlls + +https://github.com/redhat-developer/yaml-language-server + +`yaml-language-server` can be installed via `yarn`: +```sh +yarn global add yaml-language-server +``` + +To use a schema for validation, there are two options: + +1. Add a modeline to the file. A modeline is a comment of the form: + +``` +# yaml-language-server: $schema= +``` + +where the relative filepath is the path relative to the open yaml file, and the absolute filepath +is the filepath relative to the filesystem root ('/' on unix systems) + +2. Associated a schema url, relative , or absolute (to root of project, not to filesystem root) path to +the a glob pattern relative to the detected project root. Check `:LspInfo` to determine the resolved project +root. + +```lua +require('lspconfig').yamlls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + ... -- other settings. note this overrides the lspconfig defaults. + schemas = { + ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*" + ["../path/relative/to/file.yml"] = "/.github/workflows/*" + ["/path/from/root/of/project"] = "/.github/workflows/*" + }, + }, + } +} +``` + +Currently, kubernetes is special-cased in yammls, see the following upstream issues: +* [#211](https://github.com/redhat-developer/yaml-language-server/issues/211). +* [#307](https://github.com/redhat-developer/yaml-language-server/issues/307). + +To override a schema to use a specific k8s schema version (for example, to use 1.18): + +```lua +require('lspconfig').yamlls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + ... -- other settings. note this overrides the lspconfig defaults. + schemas = { + ["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.18.0-standalone-strict/all.json"] = "/*.k8s.yaml", + ... -- other schemas + }, + }, + } +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.yamlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "yaml-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml", "yaml.docker-compose" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `settings` : + ```lua + { + redhat = { + telemetry = { + enabled = false + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## zeta_note + +https://github.com/artempyanykh/zeta-note + +Markdown LSP server for easy note-taking with cross-references and diagnostics. + +Binaries can be downloaded from https://github.com/artempyanykh/zeta-note/releases + +**By default, zeta-note doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of your zeta-note binary. + +```lua +require'lspconfig'.zeta_note.setup{ + cmd = {'path/to/zeta-note'} +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.zeta_note.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + root_pattern(".zeta.toml") + ``` + + +## zk + +github.com/mickael-menu/zk + +A plain text note-taking assistant + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.zk.setup{} +``` +**Commands:** +- ZkIndex: Index +- ZkNew: ZkNew + +**Default values:** + - `cmd` : + ```lua + { "zk", "lsp" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + root_pattern(".zk") + ``` + + +## zls + +https://github.com/zigtools/zls + +Zig LSP implementation + Zig Language Server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.zls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "zls" } + ``` + - `filetypes` : + ```lua + { "zig", "zir" } + ``` + - `root_dir` : + ```lua + util.root_pattern("zls.json", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + + +vim:ft=markdown diff --git a/bundle/nvim-lspconfig-0.1.3/flake.lock b/bundle/nvim-lspconfig-0.1.3/flake.lock new file mode 100644 index 000000000..9f8f156a1 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/flake.lock @@ -0,0 +1,41 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1642700792, + "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1643202076, + "narHash": "sha256-EcrUSBkBnw3KtDBoDwHvvwR1R6YF0axNFE4Vd2++iok=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e722007bf05802573b41701c49da6c8814878171", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/bundle/nvim-lspconfig-0.1.3/flake.nix b/bundle/nvim-lspconfig-0.1.3/flake.nix new file mode 100644 index 000000000..2f0785446 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/flake.nix @@ -0,0 +1,19 @@ +{ + description = "Quickstart configurations for the Nvim LSP client"; + + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let pkgs = nixpkgs.legacyPackages.${system}; in + rec { + devShell = pkgs.mkShell { + buildInputs = [ + pkgs.stylua + pkgs.luaPackages.luacheck + pkgs.selene + ]; + }; + } + ); +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig.lua new file mode 100644 index 000000000..8404632df --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig.lua @@ -0,0 +1,92 @@ +local configs = require 'lspconfig.configs' + +local M = { + util = require 'lspconfig.util', +} + +M._root = {} + +function M.available_servers() + return vim.tbl_keys(configs) +end + +-- Called from plugin/lspconfig.vim because it requires knowing that the last +-- script in scriptnames to be executed is lspconfig. +function M._root._setup() + M._root.commands = { + LspInfo = { + function() + require 'lspconfig.ui.lspinfo'() + end, + '-nargs=0', + description = '`:LspInfo` Displays attached, active, and configured language servers', + }, + LspStart = { + function(server_name) + if server_name then + if configs[server_name] then + configs[server_name].launch() + end + else + local buffer_filetype = vim.bo.filetype + for _, config in pairs(configs) do + for _, filetype_match in ipairs(config.filetypes or {}) do + if buffer_filetype == filetype_match then + config.launch() + end + end + end + end + end, + '-nargs=? -complete=custom,v:lua.lsp_complete_configured_servers', + description = '`:LspStart` Manually launches a language server.', + }, + LspStop = { + function(cmd_args) + for _, client in ipairs(M.util.get_clients_from_cmd_args(cmd_args)) do + client.stop() + end + end, + '-nargs=? -complete=customlist,v:lua.lsp_get_active_client_ids', + description = '`:LspStop` Manually stops the given language client(s).', + }, + LspRestart = { + function(cmd_args) + for _, client in ipairs(M.util.get_clients_from_cmd_args(cmd_args)) do + client.stop() + vim.defer_fn(function() + configs[client.name].launch() + end, 500) + end + end, + '-nargs=? -complete=customlist,v:lua.lsp_get_active_client_ids', + description = '`:LspRestart` Manually restart the given language client(s).', + }, + } + + M.util.create_module_commands('_root', M._root.commands) +end + +local mt = {} +function mt:__index(k) + if configs[k] == nil then + local success, config = pcall(require, 'lspconfig.server_configurations.' .. k) + if success then + configs[k] = config + else + vim.notify( + string.format( + '[lspconfig] Cannot access configuration for %s. Ensure this server is listed in ' + .. '`server_configurations.md` or added as a custom server.', + k + ), + vim.log.levels.WARN + ) + -- Return a dummy function for compatibility with user configs + return { setup = function() end } + end + end + return configs[k] +end + +return setmetatable(M, mt) diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/configs.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/configs.lua new file mode 100644 index 000000000..a47ecbaed --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/configs.lua @@ -0,0 +1,295 @@ +local util = require 'lspconfig.util' +local api, validate, lsp = vim.api, vim.validate, vim.lsp +local tbl_extend = vim.tbl_extend + +local configs = {} + +function configs.__newindex(t, config_name, config_def) + validate { + name = { config_name, 's' }, + default_config = { config_def.default_config, 't' }, + on_new_config = { config_def.on_new_config, 'f', true }, + on_attach = { config_def.on_attach, 'f', true }, + commands = { config_def.commands, 't', true }, + } + if config_def.commands then + for k, v in pairs(config_def.commands) do + validate { + ['command.name'] = { k, 's' }, + ['command.fn'] = { v[1], 'f' }, + } + end + else + config_def.commands = {} + end + + local M = {} + + local default_config = tbl_extend('keep', config_def.default_config, util.default_config) + + -- Force this part. + default_config.name = config_name + + function M.setup(config) + validate { + cmd = { config.cmd, 't', true }, + root_dir = { config.root_dir, 'f', true }, + filetypes = { config.filetype, 't', true }, + on_new_config = { config.on_new_config, 'f', true }, + on_attach = { config.on_attach, 'f', true }, + commands = { config.commands, 't', true }, + } + if config.commands then + for k, v in pairs(config.commands) do + validate { + ['command.name'] = { k, 's' }, + ['command.fn'] = { v[1], 'f' }, + } + end + end + + config = tbl_extend('keep', config, default_config) + + if util.on_setup then + pcall(util.on_setup, config) + end + + if config.autostart == true then + local event + local pattern + if config.filetypes then + event = 'FileType' + pattern = table.concat(config.filetypes, ',') + else + event = 'BufReadPost' + pattern = '*' + end + api.nvim_command( + string.format( + "autocmd %s %s unsilent lua require'lspconfig'[%q].manager.try_add()", + event, + pattern, + config.name + ) + ) + end + + local get_root_dir = config.root_dir + + function M.launch() + local root_dir + if get_root_dir then + local bufnr = api.nvim_get_current_buf() + local bufname = api.nvim_buf_get_name(bufnr) + if not util.bufname_valid(bufname) then + return + end + root_dir = get_root_dir(util.path.sanitize(bufname), bufnr) + end + + if root_dir then + api.nvim_command( + string.format( + "autocmd BufReadPost %s/* unsilent lua require'lspconfig'[%q].manager.try_add_wrapper()", + vim.fn.fnameescape(root_dir), + config.name + ) + ) + for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do + local bufname = api.nvim_buf_get_name(bufnr) + if util.bufname_valid(bufname) then + local buf_dir = util.path.sanitize(bufname) + if buf_dir:sub(1, root_dir:len()) == root_dir then + M.manager.try_add_wrapper(bufnr) + end + end + end + elseif config.single_file_support then + -- This allows on_new_config to use the parent directory of the file + -- Effectively this is the root from lspconfig's perspective, as we use + -- this to attach additional files in the same parent folder to the same server. + -- We just no longer send rootDirectory or workspaceFolders during initialization. + local bufname = api.nvim_buf_get_name(0) + if not util.bufname_valid(bufname) then + return + end + local pseudo_root = util.path.dirname(util.path.sanitize(bufname)) + local client_id = M.manager.add(pseudo_root, true) + vim.lsp.buf_attach_client(vim.api.nvim_get_current_buf(), client_id) + end + end + + -- Used by :LspInfo + M.get_root_dir = get_root_dir + M.filetypes = config.filetypes + M.handlers = config.handlers + M.cmd = config.cmd + M.autostart = config.autostart + + -- In the case of a reload, close existing things. + local reload = false + if M.manager then + for _, client in ipairs(M.manager.clients()) do + client.stop(true) + end + reload = true + M.manager = nil + end + + local make_config = function(root_dir) + local new_config = vim.tbl_deep_extend('keep', vim.empty_dict(), config) + new_config = vim.tbl_deep_extend('keep', new_config, default_config) + new_config.capabilities = new_config.capabilities or lsp.protocol.make_client_capabilities() + new_config.capabilities = vim.tbl_deep_extend('keep', new_config.capabilities, { + workspace = { + configuration = true, + }, + }) + + if config_def.on_new_config then + pcall(config_def.on_new_config, new_config, root_dir) + end + if config.on_new_config then + pcall(config.on_new_config, new_config, root_dir) + end + + new_config.on_init = util.add_hook_after(new_config.on_init, function(client, result) + -- Handle offset encoding by default + if result.offsetEncoding then + client.offset_encoding = result.offsetEncoding + end + + -- Send `settings to server via workspace/didChangeConfiguration + function client.workspace_did_change_configuration(settings) + if not settings then + return + end + if vim.tbl_isempty(settings) then + settings = { [vim.type_idx] = vim.types.dictionary } + end + return client.notify('workspace/didChangeConfiguration', { + settings = settings, + }) + end + if not vim.tbl_isempty(new_config.settings) then + client.workspace_did_change_configuration(new_config.settings) + end + end) + + -- Save the old _on_attach so that we can reference it via the BufEnter. + new_config._on_attach = new_config.on_attach + new_config.on_attach = vim.schedule_wrap(function(client, bufnr) + if bufnr == api.nvim_get_current_buf() then + M._setup_buffer(client.id, bufnr) + else + api.nvim_command( + string.format( + "autocmd BufEnter ++once lua require'lspconfig'[%q]._setup_buffer(%d,%d)", + bufnr, + config_name, + client.id, + bufnr + ) + ) + end + end) + + new_config.root_dir = root_dir + new_config.workspace_folders = { + { + uri = vim.uri_from_fname(root_dir), + name = string.format('%s', root_dir), + }, + } + return new_config + end + + local manager = util.server_per_root_dir_manager(function(root_dir) + return make_config(root_dir) + end) + + function manager.try_add(bufnr) + bufnr = bufnr or api.nvim_get_current_buf() + + if vim.api.nvim_buf_get_option(bufnr, 'buftype') == 'nofile' then + return + end + + local id + local root_dir + + local bufname = api.nvim_buf_get_name(bufnr) + if not util.bufname_valid(bufname) then + return + end + local buf_path = util.path.sanitize(bufname) + + if get_root_dir then + root_dir = get_root_dir(buf_path, bufnr) + end + + if root_dir then + id = manager.add(root_dir, false) + elseif config.single_file_support then + local pseudo_root = util.path.dirname(buf_path) + id = manager.add(pseudo_root, true) + end + + if id then + lsp.buf_attach_client(bufnr, id) + end + end + + function manager.try_add_wrapper(bufnr) + bufnr = bufnr or api.nvim_get_current_buf() + local buf_filetype = vim.api.nvim_buf_get_option(bufnr, 'filetype') + if config.filetypes then + for _, filetype in ipairs(config.filetypes) do + if buf_filetype == filetype then + manager.try_add(bufnr) + return + end + end + else + manager.try_add(bufnr) + end + end + + M.manager = manager + M.make_config = make_config + if reload and config.autostart ~= false then + for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do + manager.try_add_wrapper(bufnr) + end + end + end + + function M._setup_buffer(client_id, bufnr) + local client = lsp.get_client_by_id(client_id) + if not client then + return + end + if client.config._on_attach then + client.config._on_attach(client, bufnr) + end + if client.config.commands and not vim.tbl_isempty(client.config.commands) then + M.commands = vim.tbl_deep_extend('force', M.commands, client.config.commands) + end + if not M.commands_created and not vim.tbl_isempty(M.commands) then + -- Create the module commands + util.create_module_commands(config_name, M.commands) + M.commands_created = true + end + end + + M.commands_created = false + M.commands = config_def.commands + M.name = config_name + M.document_config = config_def + + rawset(t, config_name, M) + + return M +end + +return setmetatable({}, configs) diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/als.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/als.lua new file mode 100644 index 000000000..7d916adf6 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/als.lua @@ -0,0 +1,37 @@ +local util = require 'lspconfig.util' +local bin_name = 'ada_language_server' + +if vim.fn.has 'win32' == 1 then + bin_name = 'ada_language_server.exe' +end + +return { + default_config = { + cmd = { bin_name }, + filetypes = { 'ada' }, + root_dir = util.root_pattern('Makefile', '.git', '*.gpr', '*.adc'), + }, + docs = { + description = [[ +https://github.com/AdaCore/ada_language_server + +Installation instructions can be found [here](https://github.com/AdaCore/ada_language_server#Install). + +Can be configured by passing a "settings" object to `als.setup{}`: + +```lua +require('lspconfig').als.setup{ + settings = { + ada = { + projectFile = "project.gpr"; + scenarioVariables = { ... }; + } + } +} +``` +]], + default_config = { + root_dir = [[util.root_pattern("Makefile", ".git", "*.gpr", "*.adc")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/angularls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/angularls.lua new file mode 100644 index 000000000..4d30de712 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/angularls.lua @@ -0,0 +1,75 @@ +local util = require 'lspconfig.util' + +-- Angular requires a node_modules directory to probe for @angular/language-service and typescript +-- in order to use your projects configured versions. +-- This defaults to the vim cwd, but will get overwritten by the resolved root of the file. +local function get_probe_dir(root_dir) + local project_root = util.find_node_modules_ancestor(root_dir) + + return project_root and (project_root .. '/node_modules') or '' +end + +local default_probe_dir = get_probe_dir(vim.fn.getcwd()) + +local bin_name = 'ngserver' +local args = { + '--stdio', + '--tsProbeLocations', + default_probe_dir, + '--ngProbeLocations', + default_probe_dir, +} + +local cmd = { bin_name, unpack(args) } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, unpack(args) } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'typescript', 'html', 'typescriptreact', 'typescript.tsx' }, + -- Check for angular.json or .git first since that is the root of the project. + -- Don't check for tsconfig.json or package.json since there are multiple of these + -- in an angular monorepo setup. + root_dir = util.root_pattern('angular.json', '.git'), + }, + on_new_config = function(new_config, new_root_dir) + local new_probe_dir = get_probe_dir(new_root_dir) + + -- We need to check our probe directories because they may have changed. + new_config.cmd = { + 'ngserver', + '--stdio', + '--tsProbeLocations', + new_probe_dir, + '--ngProbeLocations', + new_probe_dir, + } + end, + docs = { + description = [[ +https://github.com/angular/vscode-ng-language-service + +`angular-language-server` can be installed via npm `npm install -g @angular/language-server`. + +Note, that if you override the default `cmd`, you must also update `on_new_config` to set `new_config.cmd` during startup. + +```lua +local project_library_path = "/path/to/project/lib" +local cmd = {"ngserver", "--stdio", "--tsProbeLocations", project_library_path , "--ngProbeLocations", project_library_path} + +require'lspconfig'.angularls.setup{ + cmd = cmd, + on_new_config = function(new_config,new_root_dir) + new_config.cmd = cmd + end, +} +``` + ]], + default_config = { + root_dir = [[root_pattern("angular.json", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ansiblels.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ansiblels.lua new file mode 100644 index 000000000..b4bb32422 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ansiblels.lua @@ -0,0 +1,47 @@ +local util = require 'lspconfig.util' + +local bin_name = 'ansible-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + settings = { + ansible = { + python = { + interpreterPath = 'python', + }, + ansibleLint = { + path = 'ansible-lint', + enabled = true, + }, + ansible = { + path = 'ansible', + }, + executionEnvironment = { + enabled = false, + }, + }, + }, + filetypes = { 'yaml.ansible' }, + root_dir = util.root_pattern('ansible.cfg', '.ansible-lint'), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/ansible/ansible-language-server + +Language server for the ansible configuration management tool. + +`ansible-language-server` can be installed via `npm`: + +```sh +npm install -g @ansible/ansible-language-server +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/arduino_language_server.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/arduino_language_server.lua new file mode 100644 index 000000000..72f48a1d1 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/arduino_language_server.lua @@ -0,0 +1,50 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'arduino-language-server' }, + filetypes = { 'arduino' }, + root_dir = util.root_pattern '*.ino', + }, + docs = { + description = [[ +https://github.com/arduino/arduino-language-server + +Language server for Arduino + +The `arduino-language-server` can be installed by running: + go get -u github.com/arduino/arduino-language-server + +The `arduino-cli` tools must also be installed. Follow these instructions for your distro: + https://arduino.github.io/arduino-cli/latest/installation/ + +After installing the `arduino-cli` tools, follow these instructions for generating +a configuration file: + https://arduino.github.io/arduino-cli/latest/getting-started/#create-a-configuration-file +and make sure you install any relevant platforms libraries: + https://arduino.github.io/arduino-cli/latest/getting-started/#install-the-core-for-your-board + +The language server also requires `clangd` be installed. It will look for `clangd` by default but +the binary path can be overridden if need be. + +After all dependencies are installed you'll need to override the lspconfig command for the +language server in your setup function with the necessary configurations: + +```lua +lspconfig.arduino_language_server.setup({ + cmd = { + -- Required + "arduino-language-server", + "-cli-config", "/path/to/arduino-cli.yaml", + -- Optional + "-cli", "/path/to/arduino-cli", + "-clangd", "/path/to/clangd" + } +}) +``` + +For further instruction about configuration options, run `arduino-language-server --help`. + +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/asm_lsp.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/asm_lsp.lua new file mode 100644 index 000000000..102bcbab1 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/asm_lsp.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'asm-lsp' }, + filetypes = { 'asm', 'vmasm' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/bergercookie/asm-lsp + +Language Server for GAS/GO Assembly + +`asm-lsp` can be installed via cargo: +cargo install asm-lsp +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/awk_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/awk_ls.lua new file mode 100644 index 000000000..ff1087dcd --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/awk_ls.lua @@ -0,0 +1,22 @@ +if vim.version().major == 0 and vim.version().minor < 7 then + vim.notify('The AWK language server requires nvim >= 0.7', vim.log.levels.ERROR) + return +end + +return { + default_config = { + cmd = { 'awk-language-server' }, + filetypes = { 'awk' }, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/Beaglefoot/awk-language-server/ + +`awk-language-server` can be installed via `npm`: +```sh +npm install -g awk-language-server +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/bashls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/bashls.lua new file mode 100644 index 000000000..3f25c76f4 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/bashls.lua @@ -0,0 +1,39 @@ +local util = require 'lspconfig.util' + +local bin_name = 'bash-language-server' +local cmd = { bin_name, 'start' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, 'start' } +end + +return { + default_config = { + cmd = cmd, + cmd_env = { + -- Prevent recursive scanning which will cause issues when opening a file + -- directly in the home directory (e.g. ~/foo.sh). + -- + -- Default upstream pattern is "**/*@(.sh|.inc|.bash|.command)". + GLOB_PATTERN = vim.env.GLOB_PATTERN or '*@(.sh|.inc|.bash|.command)', + }, + filetypes = { 'sh' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/mads-hartmann/bash-language-server + +`bash-language-server` can be installed via `npm`: +```sh +npm i -g bash-language-server +``` + +Language server for bash, written using tree sitter in typescript. +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/beancount.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/beancount.lua new file mode 100644 index 000000000..1d86d34be --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/beancount.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'beancount-langserver', '--stdio' }, + filetypes = { 'beancount' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + init_options = { + -- this is the path to the beancout journal file + journalFile = '', + -- this is the path to the python binary with beancount installed + pythonPath = 'python3', + }, + }, + docs = { + description = [[ +https://github.com/polarmutex/beancount-language-server#installation + +See https://github.com/polarmutex/beancount-language-server#configuration for configuration options +]], + default_config = { + root_dir = [[root_pattern("elm.json")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/bicep.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/bicep.lua new file mode 100644 index 000000000..1ec703238 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/bicep.lua @@ -0,0 +1,47 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'bicep' }, + root_dir = util.find_git_ancestor, + init_options = {}, + }, + docs = { + description = [=[ +https://github.com/azure/bicep +Bicep language server + +Bicep language server can be installed by downloading and extracting a release of bicep-langserver.zip from [Bicep GitHub releases](https://github.com/Azure/bicep/releases). + +Bicep language server requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +Neovim does not have built-in support for the bicep filetype which is required for lspconfig to automatically launch the language server. + +Filetype detection can be added via an autocmd: +```lua +vim.cmd [[ autocmd BufNewFile,BufRead *.bicep set filetype=bicep ]] +``` + +**By default, bicep language server does not have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. + +```lua +local bicep_lsp_bin = "/path/to/bicep-langserver/Bicep.LangServer.dll" +require'lspconfig'.bicep.setup{ + cmd = { "dotnet", bicep_lsp_bin }; + ... +} +``` + +To download the latest release and place in /usr/local/bin/bicep-langserver: +```bash +(cd $(mktemp -d) \ + && curl -fLO https://github.com/Azure/bicep/releases/latest/download/bicep-langserver.zip \ + && rm -rf /usr/local/bin/bicep-langserver \ + && unzip -d /usr/local/bin/bicep-langserver bicep-langserver.zip) +``` +]=], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/bsl_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/bsl_ls.lua new file mode 100644 index 000000000..fef15f927 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/bsl_ls.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'bsl', 'os' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ + https://github.com/1c-syntax/bsl-language-server + + Language Server Protocol implementation for 1C (BSL) - 1C:Enterprise 8 and OneScript languages. + + ]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ccls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ccls.lua new file mode 100644 index 000000000..dd642db27 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ccls.lua @@ -0,0 +1,43 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'ccls' }, + filetypes = { 'c', 'cpp', 'objc', 'objcpp' }, + root_dir = util.root_pattern('compile_commands.json', '.ccls', '.git'), + offset_encoding = 'utf-32', + -- ccls does not support sending a null root directory + single_file_support = false, + }, + docs = { + description = [[ +https://github.com/MaskRay/ccls/wiki + +ccls relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) specified +as compile_commands.json or, for simpler projects, a .ccls. +For details on how to automatically generate one using CMake look [here](https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html). Alternatively, you can use [Bear](https://github.com/rizsotto/Bear). + +Customization options are passed to ccls at initialization time via init_options, a list of available options can be found [here](https://github.com/MaskRay/ccls/wiki/Customization#initialization-options). For example: + +```lua +local lspconfig = require'lspconfig' +lspconfig.ccls.setup { + init_options = { + compilationDatabaseDirectory = "build"; + index = { + threads = 0; + }; + clang = { + excludeArgs = { "-frounding-math"} ; + }; + } +} + +``` + +]], + default_config = { + root_dir = [[root_pattern("compile_commands.json", ".ccls", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/clangd.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/clangd.lua new file mode 100644 index 000000000..4e0f2d7f2 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/clangd.lua @@ -0,0 +1,87 @@ +local util = require 'lspconfig.util' + +-- https://clangd.llvm.org/extensions.html#switch-between-sourceheader +local function switch_source_header(bufnr) + bufnr = util.validate_bufnr(bufnr) + local clangd_client = util.get_active_client_by_name(bufnr, 'clangd') + local params = { uri = vim.uri_from_bufnr(bufnr) } + if clangd_client then + clangd_client.request('textDocument/switchSourceHeader', params, function(err, result) + if err then + error(tostring(err)) + end + if not result then + print 'Corresponding file cannot be determined' + return + end + vim.api.nvim_command('edit ' .. vim.uri_to_fname(result)) + end, bufnr) + else + print 'method textDocument/switchSourceHeader is not supported by any servers active on the current buffer' + end +end + +local root_files = { + '.clangd', + '.clang-tidy', + '.clang-format', + 'compile_commands.json', + 'compile_flags.txt', + 'configure.ac', -- AutoTools +} + +local default_capabilities = vim.tbl_deep_extend( + 'force', + util.default_config.capabilities or vim.lsp.protocol.make_client_capabilities(), + { + textDocument = { + completion = { + editsNearCursor = true, + }, + }, + offsetEncoding = { 'utf-8', 'utf-16' }, + } +) + +return { + default_config = { + cmd = { 'clangd' }, + filetypes = { 'c', 'cpp', 'objc', 'objcpp' }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + capabilities = default_capabilities, + }, + commands = { + ClangdSwitchSourceHeader = { + function() + switch_source_header(0) + end, + description = 'Switch between source/header', + }, + }, + docs = { + description = [[ +https://clangd.llvm.org/installation.html + +**NOTE:** Clang >= 11 is recommended! See [this issue for more](https://github.com/neovim/nvim-lsp/issues/23). + +clangd relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) specified as compile_commands.json, see https://clangd.llvm.org/installation#compile_commandsjson +]], + default_config = { + root_dir = [[ + root_pattern( + '.clangd', + '.clang-tidy', + '.clang-format', + 'compile_commands.json', + 'compile_flags.txt', + 'configure.ac', + '.git' + ) + ]], + capabilities = [[default capabilities, with offsetEncoding utf-8]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/clarity_lsp.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/clarity_lsp.lua new file mode 100644 index 000000000..72a619721 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/clarity_lsp.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'clarity-lsp' }, + filetypes = { 'clar', 'clarity' }, + root_dir = util.root_pattern '.git', + }, + docs = { + description = [[ +`clarity-lsp` is a language server for the Clarity language. Clarity is a decidable smart contract language that optimizes for predictability and security. Smart contracts allow developers to encode essential business logic on a blockchain. + +To learn how to configure the clarity language server, see the [clarity-lsp documentation](https://github.com/hirosystems/clarity-lsp). +]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/clojure_lsp.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/clojure_lsp.lua new file mode 100644 index 000000000..5340693c2 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/clojure_lsp.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'clojure-lsp' }, + filetypes = { 'clojure', 'edn' }, + root_dir = util.root_pattern('project.clj', 'deps.edn', 'build.boot', 'shadow-cljs.edn', '.git'), + }, + docs = { + description = [[ +https://github.com/snoe/clojure-lsp + +Clojure Language Server +]], + default_config = { + root_dir = [[root_pattern("project.clj", "deps.edn", "build.boot", "shadow-cljs.edn", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/cmake.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/cmake.lua new file mode 100644 index 000000000..d3345357e --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/cmake.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +local root_files = { 'CMakeLists.txt', 'cmake' } +return { + default_config = { + cmd = { 'cmake-language-server' }, + filetypes = { 'cmake' }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + init_options = { + buildDirectory = 'build', + }, + }, + docs = { + description = [[ +https://github.com/regen100/cmake-language-server + +CMake LSP Implementation +]], + default_config = { + root_dir = [[root_pattern(".git", "compile_commands.json", "build")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/codeqlls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/codeqlls.lua new file mode 100644 index 000000000..9184d2f81 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/codeqlls.lua @@ -0,0 +1,46 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'codeql', 'execute', 'language-server', '--check-errors', 'ON_CHANGE', '-q' }, + filetypes = { 'ql' }, + root_dir = util.root_pattern 'qlpack.yml', + log_level = vim.lsp.protocol.MessageType.Warning, + before_init = function(initialize_params) + initialize_params['workspaceFolders'] = { + { + name = 'workspace', + uri = initialize_params['rootUri'], + }, + } + end, + settings = { + search_path = vim.empty_dict(), + }, + }, + docs = { + description = [[ +Reference: +https://help.semmle.com/codeql/codeql-cli.html + +Binaries: +https://github.com/github/codeql-cli-binaries + ]], + default_config = { + settings = { + search_path = [[list containing all search paths, eg: '~/codeql-home/codeql-repo']], + }, + }, + }, + on_new_config = function(config) + if type(config.settings.search_path) == 'table' and not vim.tbl_isempty(config.settings.search_path) then + local search_path = '--search-path=' + for _, path in ipairs(config.settings.search_path) do + search_path = search_path .. vim.fn.expand(path) .. ':' + end + config.cmd = { 'codeql', 'execute', 'language-server', '--check-errors', 'ON_CHANGE', '-q', search_path } + else + config.cmd = { 'codeql', 'execute', 'language-server', '--check-errors', 'ON_CHANGE', '-q' } + end + end, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/crystalline.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/crystalline.lua new file mode 100644 index 000000000..ef4d6bca1 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/crystalline.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'crystalline' }, + filetypes = { 'crystal' }, + root_dir = util.root_pattern 'shard.yml' or util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/elbywan/crystalline + +Crystal language server. +]], + default_config = { + root_dir = [[root_pattern('shard.yml', '.git')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/csharp_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/csharp_ls.lua new file mode 100644 index 000000000..828cba44c --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/csharp_ls.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'csharp-ls' }, + root_dir = util.root_pattern('*.sln', '*.csproj', '.git'), + filetypes = { 'cs' }, + init_options = { + AutomaticWorkspaceInit = true, + }, + }, + docs = { + description = [[ +https://github.com/razzmatazz/csharp-language-server + +Language Server for C#. + +csharp-ls requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +The preferred way to install csharp-ls is with `dotnet tool install --global csharp-ls`. + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/cssls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/cssls.lua new file mode 100644 index 000000000..41c38e6af --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/cssls.lua @@ -0,0 +1,49 @@ +local util = require 'lspconfig.util' + +local bin_name = 'vscode-css-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'css', 'scss', 'less' }, + root_dir = util.root_pattern('package.json', '.git'), + single_file_support = true, + settings = { + css = { validate = true }, + scss = { validate = true }, + less = { validate = true }, + }, + }, + docs = { + description = [[ + +https://github.com/hrsh7th/vscode-langservers-extracted + +`css-languageserver` can be installed via `npm`: + +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-css-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.cssls.setup { + capabilities = capabilities, +} +``` +]], + default_config = { + root_dir = [[root_pattern("package.json", ".git") or bufdir]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/cssmodules_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/cssmodules_ls.lua new file mode 100644 index 000000000..3107b75d3 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/cssmodules_ls.lua @@ -0,0 +1,31 @@ +local util = require 'lspconfig.util' + +local bin_name = 'cssmodules-language-server' +local cmd = { bin_name } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact' }, + root_dir = util.find_package_json_ancestor, + }, + docs = { + description = [[ +https://github.com/antonk52/cssmodules-language-server + +Language server for autocompletion and go-to-definition functionality for CSS modules. + +You can install cssmodules-language-server via npm: +```sh +npm install -g cssmodules-language-server +``` + ]], + default_config = { + root_dir = [[root_pattern("package.json")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/cucumber_language_server.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/cucumber_language_server.lua new file mode 100644 index 000000000..07832061f --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/cucumber_language_server.lua @@ -0,0 +1,33 @@ +local util = require 'lspconfig.util' + +local bin_name = 'cucumber-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'cucumber' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://cucumber.io +https://github.com/cucumber/common +https://www.npmjs.com/package/@cucumber/language-server + +Language server for Cucumber. + +`cucumber-language-server` can be installed via `npm`: +```sh +npm install -g @cucumber/language-server +``` + ]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/dartls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/dartls.lua new file mode 100644 index 000000000..eecb0b728 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/dartls.lua @@ -0,0 +1,60 @@ +local util = require 'lspconfig.util' + +local bin_name = 'dart' + +local find_dart_sdk_root_path = function() + if os.getenv 'FLUTTER_SDK' then + local flutter_path = os.getenv 'FLUTTER_SDK' + return util.path.join(flutter_path, 'cache', 'dart-sdk', 'bin', 'dart') + elseif vim.fn['executable'] 'flutter' == 1 then + local flutter_path = vim.fn['resolve'](vim.fn['exepath'] 'flutter') + local flutter_bin = vim.fn['fnamemodify'](flutter_path, ':h') + return util.path.join(flutter_bin, 'cache', 'dart-sdk', 'bin', 'dart') + elseif vim.fn['executable'] 'dart' == 1 then + return vim.fn['resolve'](vim.fn['exepath'] 'dart') + else + return '' + end +end + +local analysis_server_snapshot_path = function() + local dart_sdk_root_path = vim.fn['fnamemodify'](find_dart_sdk_root_path(), ':h') + local snapshot = util.path.join(dart_sdk_root_path, 'snapshots', 'analysis_server.dart.snapshot') + + if vim.fn['has'] 'win32' == 1 or vim.fn['has'] 'win64' == 1 then + snapshot = snapshot:gsub('/', '\\') + end + + return snapshot +end + +return { + default_config = { + cmd = { bin_name, analysis_server_snapshot_path(), '--lsp' }, + filetypes = { 'dart' }, + root_dir = util.root_pattern 'pubspec.yaml', + init_options = { + onlyAnalyzeProjectsWithOpenFiles = true, + suggestFromUnimportedLibraries = true, + closingLabels = true, + outline = true, + flutterOutline = true, + }, + settings = { + dart = { + completeFunctionCalls = true, + showTodos = true, + }, + }, + }, + docs = { + description = [[ +https://github.com/dart-lang/sdk/tree/master/pkg/analysis_server/tool/lsp_spec + +Language server for dart. +]], + default_config = { + root_dir = [[root_pattern("pubspec.yaml")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/denols.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/denols.lua new file mode 100644 index 000000000..a7bed35fb --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/denols.lua @@ -0,0 +1,114 @@ +local util = require 'lspconfig.util' +local lsp = vim.lsp + +local function buf_cache(bufnr) + local params = {} + params['referrer'] = { uri = vim.uri_from_bufnr(bufnr) } + params['uris'] = {} + lsp.buf_request(bufnr, 'deno/cache', params, function(err) + if err then + error(tostring(err)) + end + end) +end + +local function virtual_text_document_handler(uri, result) + if not result then + return nil + end + + for client_id, res in pairs(result) do + local lines = vim.split(res.result, '\n') + local bufnr = vim.uri_to_bufnr(uri) + + local current_buf = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false) + if #current_buf ~= 0 then + return nil + end + + vim.api.nvim_buf_set_lines(bufnr, 0, -1, nil, lines) + vim.api.nvim_buf_set_option(bufnr, 'readonly', true) + vim.api.nvim_buf_set_option(bufnr, 'modified', false) + vim.api.nvim_buf_set_option(bufnr, 'modifiable', false) + lsp.buf_attach_client(bufnr, client_id) + end +end + +local function virtual_text_document(uri) + local params = { + textDocument = { + uri = uri, + }, + } + local result = lsp.buf_request_sync(0, 'deno/virtualTextDocument', params) + virtual_text_document_handler(uri, result) +end + +local function denols_handler(err, result, ctx) + if not result or vim.tbl_isempty(result) then + return nil + end + + for _, res in pairs(result) do + local uri = res.uri or res.targetUri + if uri:match '^deno:' then + virtual_text_document(uri) + res['uri'] = uri + res['targetUri'] = uri + end + end + + lsp.handlers[ctx.method](err, result, ctx) +end + +return { + default_config = { + cmd = { 'deno', 'lsp' }, + filetypes = { + 'javascript', + 'javascriptreact', + 'javascript.jsx', + 'typescript', + 'typescriptreact', + 'typescript.tsx', + }, + root_dir = util.root_pattern('deno.json', 'deno.jsonc', 'tsconfig.json', '.git'), + init_options = { + enable = true, + lint = false, + unstable = false, + }, + handlers = { + ['textDocument/definition'] = denols_handler, + ['textDocument/references'] = denols_handler, + }, + }, + commands = { + DenolsCache = { + function() + buf_cache(0) + end, + description = 'Cache a module and all of its dependencies.', + }, + }, + docs = { + description = [[ +https://github.com/denoland/deno + +Deno's built-in language server + +To approrpiately highlight codefences returned from denols, you will need to augment vim.g.markdown_fenced languages + in your init.lua. Example: + +```lua +vim.g.markdown_fenced_languages = { + "ts=typescript" +} +``` + +]], + default_config = { + root_dir = [[root_pattern("deno.json", "deno.jsonc", "tsconfig.json", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/dhall_lsp_server.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/dhall_lsp_server.lua new file mode 100644 index 000000000..af910f365 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/dhall_lsp_server.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'dhall-lsp-server' }, + filetypes = { 'dhall' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-lsp-server + +language server for dhall + +`dhall-lsp-server` can be installed via cabal: +```sh +cabal install dhall-lsp-server +``` +prebuilt binaries can be found [here](https://github.com/dhall-lang/dhall-haskell/releases). +]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/diagnosticls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/diagnosticls.lua new file mode 100644 index 000000000..8f0476b61 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/diagnosticls.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +local bin_name = 'diagnostic-languageserver' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + root_dir = util.find_git_ancestor, + single_file_support = true, + filetypes = {}, + }, + docs = { + description = [[ +https://github.com/iamcco/diagnostic-languageserver + +Diagnostic language server integrate with linters. +]], + default_config = { + filetypes = 'Empty by default, override to add filetypes', + root_dir = "Vim's starting directory", + init_options = 'Configuration from https://github.com/iamcco/diagnostic-languageserver#config--document', + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/dockerls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/dockerls.lua new file mode 100644 index 000000000..6d1cfc7d2 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/dockerls.lua @@ -0,0 +1,30 @@ +local util = require 'lspconfig.util' + +local bin_name = 'docker-langserver' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'dockerfile' }, + root_dir = util.root_pattern 'Dockerfile', + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/rcjsuen/dockerfile-language-server-nodejs + +`docker-langserver` can be installed via `npm`: +```sh +npm install -g dockerfile-language-server-nodejs +``` + ]], + default_config = { + root_dir = [[root_pattern("Dockerfile")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/dotls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/dotls.lua new file mode 100644 index 000000000..dff14b9cd --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/dotls.lua @@ -0,0 +1,27 @@ +local util = require 'lspconfig.util' + +local bin_name = 'dot-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'dot' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/nikeee/dot-language-server + +`dot-language-server` can be installed via `npm`: +```sh +npm install -g dot-language-server +``` + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/efm.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/efm.lua new file mode 100644 index 000000000..f5f74edc5 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/efm.lua @@ -0,0 +1,43 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'efm-langserver' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + + docs = { + description = [[ +https://github.com/mattn/efm-langserver + +General purpose Language Server that can use specified error message format generated from specified command. + +Requires at minimum EFM version [v0.0.38](https://github.com/mattn/efm-langserver/releases/tag/v0.0.38) to support +launching the language server on single files. If on an older version of EFM, disable single file support: + +```lua +require('lspconfig')['efm'].setup{ + settings = ..., -- You must populate this according to the EFM readme + filetypes = ..., -- Populate this according to the note below + single_file_support = false, -- This is the important line for supporting older version of EFM +} +``` + +Note: In order for neovim's built-in language server client to send the appropriate `languageId` to EFM, **you must +specify `filetypes` in your call to `setup{}`**. Otherwise `lspconfig` will launch EFM on the `BufEnter` instead +of the `FileType` autocommand, and the `filetype` variable used to populate the `languageId` will not yet be set. + +```lua +require('lspconfig')['efm'].setup{ + settings = ..., -- You must populate this according to the EFM readme + filetypes = { 'python','cpp','lua' } +} +``` + +]], + default_config = { + root_dir = [[util.root_pattern(".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/elixirls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/elixirls.lua new file mode 100644 index 000000000..d51aa507c --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/elixirls.lua @@ -0,0 +1,39 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'elixir', 'eelixir' }, + root_dir = function(fname) + return util.root_pattern('mix.exs', '.git')(fname) or vim.loop.os_homedir() + end, + }, + docs = { + description = [[ +https://github.com/elixir-lsp/elixir-ls + +`elixir-ls` can be installed by following the instructions [here](https://github.com/elixir-lsp/elixir-ls#building-and-running). + +```bash +curl -fLO https://github.com/elixir-lsp/elixir-ls/releases/latest/download/elixir-ls.zip +unzip elixir-ls.zip -d /path/to/elixir-ls +# Unix +chmod +x /path/to/elixir-ls/language_server.sh +``` + +**By default, elixir-ls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of your unzipped elixir-ls. + +```lua +require'lspconfig'.elixirls.setup{ + -- Unix + cmd = { "/path/to/elixir-ls/language_server.sh" }; + -- Windows + cmd = { "/path/to/elixir-ls/language_server.bat" }; + ... +} +``` +]], + default_config = { + root_dir = [[root_pattern("mix.exs", ".git") or vim.loop.os_homedir()]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/elmls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/elmls.lua new file mode 100644 index 000000000..2718c88c7 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/elmls.lua @@ -0,0 +1,44 @@ +local util = require 'lspconfig.util' +local lsp = vim.lsp +local api = vim.api + +local bin_name = 'elm-language-server' +local cmd = { bin_name } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name } +end + +local default_capabilities = lsp.protocol.make_client_capabilities() +default_capabilities.offsetEncoding = { 'utf-8', 'utf-16' } +local elm_root_pattern = util.root_pattern 'elm.json' + +return { + default_config = { + cmd = cmd, + -- TODO(ashkan) if we comment this out, it will allow elmls to operate on elm.json. It seems like it could do that, but no other editor allows it right now. + filetypes = { 'elm' }, + root_dir = function(fname) + local filetype = api.nvim_buf_get_option(0, 'filetype') + if filetype == 'elm' or (filetype == 'json' and fname:match 'elm%.json$') then + return elm_root_pattern(fname) + end + end, + init_options = { + elmAnalyseTrigger = 'change', + }, + }, + docs = { + description = [[ +https://github.com/elm-tooling/elm-language-server#installation + +If you don't want to use Nvim to install it, then you can use: +```sh +npm install -g elm elm-test elm-format @elm-tooling/elm-language-server +``` +]], + default_config = { + root_dir = [[root_pattern("elm.json")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ember.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ember.lua new file mode 100644 index 000000000..e6ce1eae7 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ember.lua @@ -0,0 +1,30 @@ +local util = require 'lspconfig.util' + +local bin_name = 'ember-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'handlebars', 'typescript', 'javascript' }, + root_dir = util.root_pattern('ember-cli-build.js', '.git'), + }, + docs = { + description = [[ +https://github.com/lifeart/ember-language-server + +`ember-language-server` can be installed via `npm`: + +```sh +npm install -g @lifeart/ember-language-server +``` +]], + default_config = { + root_dir = [[root_pattern("ember-cli-build.js", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/emmet_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/emmet_ls.lua new file mode 100644 index 000000000..3750ae516 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/emmet_ls.lua @@ -0,0 +1,31 @@ +local util = require 'lspconfig.util' + +local bin_name = 'emmet-ls' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'html', 'css' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/aca/emmet-ls + +Package can be installed via `npm`: +```sh +npm install -g emmet-ls +``` +]], + default_config = { + root_dir = 'git root', + single_file_support = true, + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/erlangls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/erlangls.lua new file mode 100644 index 000000000..cec192845 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/erlangls.lua @@ -0,0 +1,34 @@ +local util = require 'lspconfig.util' + +local cmd = { 'erlang_ls' } +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', 'erlang_ls.cmd' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'erlang' }, + root_dir = util.root_pattern('rebar.config', 'erlang.mk', '.git'), + single_file_support = true, + }, + docs = { + description = [[ +https://erlang-ls.github.io + +Language Server for Erlang. + +Clone [erlang_ls](https://github.com/erlang-ls/erlang_ls) +Compile the project with `make` and copy resulting binaries somewhere in your $PATH eg. `cp _build/*/bin/* ~/local/bin` + +Installation instruction can be found [here](https://github.com/erlang-ls/erlang_ls). + +Installation requirements: + - [Erlang OTP 21+](https://github.com/erlang/otp) + - [rebar3 3.9.1+](https://github.com/erlang/rebar3) +]], + default_config = { + root_dir = [[root_pattern('rebar.config', 'erlang.mk', '.git')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/esbonio.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/esbonio.lua new file mode 100644 index 000000000..a97c26b26 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/esbonio.lua @@ -0,0 +1,55 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'python3', '-m', 'esbonio' }, + filetypes = { 'rst' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/swyddfa/esbonio + +Esbonio is a language server for [Sphinx](https://www.sphinx-doc.org/en/master/) documentation projects. +The language server can be installed via pip + +``` +pip install esbonio +``` + +Since Sphinx is highly extensible you will get best results if you install the language server in the same +Python environment as the one used to build your documentation. To ensure that the correct Python environment +is picked up, you can either launch `nvim` with the correct environment activated. + +``` +source env/bin/activate +nvim +``` + +Or you can modify the default `cmd` to include the full path to the Python interpreter. + +```lua +require'lspconfig'.esbonio.setup { + cmd = { '/path/to/virtualenv/bin/python', '-m', 'esbonio' } +} +``` + +Esbonio supports a number of config values passed as `init_options` on startup, for example. + +```lua +require'lspconfig'.esbonio.setup { + init_options = { + server = { + logLevel = "debug" + }, + sphinx = { + confDir = "/path/to/docs", + srcDir = "${confDir}/../docs-src" + } +} +``` + +A full list and explanation of the available options can be found [here](https://swyddfa.github.io/esbonio/docs/lsp/editors/index.html) +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/eslint.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/eslint.lua new file mode 100644 index 000000000..925cdfeea --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/eslint.lua @@ -0,0 +1,172 @@ +local util = require 'lspconfig.util' +local lsp = vim.lsp + +local get_eslint_client = function() + local active_clients = lsp.get_active_clients() + for _, client in ipairs(active_clients) do + if client.name == 'eslint' then + return client + end + end + return nil +end + +local function fix_all(opts) + opts = opts or {} + + local eslint_lsp_client = get_eslint_client() + if eslint_lsp_client == nil then + return + end + + local request + if opts.sync then + request = function(bufnr, method, params) + eslint_lsp_client.request_sync(method, params, nil, bufnr) + end + else + request = function(bufnr, method, params) + eslint_lsp_client.request(method, params, nil, bufnr) + end + end + + local bufnr = util.validate_bufnr(opts.bufnr or 0) + request(0, 'workspace/executeCommand', { + command = 'eslint.applyAllFixes', + arguments = { + { + uri = vim.uri_from_bufnr(bufnr), + version = lsp.util.buf_versions[bufnr], + }, + }, + }) +end + +local bin_name = 'vscode-eslint-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { + 'javascript', + 'javascriptreact', + 'javascript.jsx', + 'typescript', + 'typescriptreact', + 'typescript.tsx', + 'vue', + }, + -- https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-file-formats + root_dir = util.root_pattern( + '.eslintrc.js', + '.eslintrc.cjs', + '.eslintrc.yaml', + '.eslintrc.yml', + '.eslintrc.json', + 'package.json' + ), + -- Refer to https://github.com/Microsoft/vscode-eslint#settings-options for documentation. + settings = { + validate = 'on', + packageManager = 'npm', + useESLintClass = false, + codeActionOnSave = { + enable = false, + mode = 'all', + }, + format = true, + quiet = false, + onIgnoredFiles = 'off', + rulesCustomizations = {}, + run = 'onType', + -- nodePath configures the directory in which the eslint server should start its node_modules resolution. + -- This path is relative to the workspace folder (root dir) of the server instance. + nodePath = '', + -- use the workspace folder location or the file location (if no workspace folder is open) as the working directory + workingDirectory = { mode = 'location' }, + codeAction = { + disableRuleComment = { + enable = true, + location = 'separateLine', + }, + showDocumentation = { + enable = true, + }, + }, + }, + on_new_config = function(config, new_root_dir) + -- The "workspaceFolder" is a VSCode concept. It limits how far the + -- server will traverse the file system when locating the ESLint config + -- file (e.g., .eslintrc). + config.settings.workspaceFolder = { + uri = new_root_dir, + name = vim.fn.fnamemodify(new_root_dir, ':t'), + } + end, + handlers = { + ['eslint/openDoc'] = function(_, result) + if not result then + return + end + local sysname = vim.loop.os_uname().sysname + if sysname:match 'Windows' then + os.execute(string.format('start %q', result.url)) + elseif sysname:match 'Linux' then + os.execute(string.format('xdg-open %q', result.url)) + else + os.execute(string.format('open %q', result.url)) + end + return {} + end, + ['eslint/confirmESLintExecution'] = function(_, result) + if not result then + return + end + return 4 -- approved + end, + ['eslint/probeFailed'] = function() + vim.notify('[lspconfig] ESLint probe failed.', vim.log.levels.WARN) + return {} + end, + ['eslint/noLibrary'] = function() + vim.notify('[lspconfig] Unable to find ESLint library.', vim.log.levels.WARN) + return {} + end, + }, + }, + commands = { + EslintFixAll = { + function() + fix_all { sync = true, bufnr = 0 } + end, + description = 'Fix all eslint problems for this buffer', + }, + }, + docs = { + description = [[ +https://github.com/hrsh7th/vscode-langservers-extracted + +vscode-eslint-language-server: A linting engine for JavaScript / Typescript + +`vscode-eslint-language-server` can be installed via `npm`: +```sh +npm i -g vscode-langservers-extracted +``` + +vscode-eslint-language-server provides an EslintFixAll command that can be used to format document on save +```vim +autocmd BufWritePre *.tsx,*.ts,*.jsx,*.js EslintFixAll +``` + +See [vscode-eslint](https://github.com/microsoft/vscode-eslint/blob/55871979d7af184bf09af491b6ea35ebd56822cf/server/src/eslintServer.ts#L216-L229) for configuration options. + +Additional messages you can handle: eslint/noConfig +Messages already handled in lspconfig: eslint/openDoc, eslint/confirmESLintExecution, eslint/probeFailed, eslint/noLibrary +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/flow.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/flow.lua new file mode 100644 index 000000000..3ac59aaa2 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/flow.lua @@ -0,0 +1,27 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'npx', '--no-install', 'flow', 'lsp' }, + filetypes = { 'javascript', 'javascriptreact', 'javascript.jsx' }, + root_dir = util.root_pattern '.flowconfig', + }, + docs = { + description = [[ +https://flow.org/ +https://github.com/facebook/flow + +See below for how to setup Flow itself. +https://flow.org/en/docs/install/ + +See below for lsp command options. + +```sh +npx flow lsp --help +``` + ]], + default_config = { + root_dir = [[root_pattern(".flowconfig")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/flux_lsp.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/flux_lsp.lua new file mode 100644 index 000000000..3be9a1b11 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/flux_lsp.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'flux-lsp' }, + filetypes = { 'flux' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/influxdata/flux-lsp +`flux-lsp` can be installed via `cargo`: +```sh +cargo install --git https://github.com/influxdata/flux-lsp +``` +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/foam_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/foam_ls.lua new file mode 100644 index 000000000..1f0d7fc84 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/foam_ls.lua @@ -0,0 +1,31 @@ +local util = require 'lspconfig.util' +local bin_name = 'foam-ls' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'foam', 'OpenFOAM' }, + root_dir = function(fname) + return util.search_ancestors(fname, function(path) + if util.path.exists(util.path.join(path, 'system', 'controlDict')) then + return path + end + end) + end, + }, + docs = { + description = [[ +https://github.com/FoamScience/foam-language-server + +`foam-language-server` can be installed via `npm` +```sh +npm install -g foam-language-server +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/fortls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/fortls.lua new file mode 100644 index 000000000..58791392c --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/fortls.lua @@ -0,0 +1,24 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'fortls' }, + filetypes = { 'fortran' }, + root_dir = function(fname) + return util.root_pattern '.fortls'(fname) or util.find_git_ancestor(fname) + end, + settings = { + nthreads = 1, + }, + }, + docs = { + description = [[ +https://github.com/hansec/fortran-language-server + +Fortran Language Server for the Language Server Protocol + ]], + default_config = { + root_dir = [[root_pattern(".fortls")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/fsautocomplete.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/fsautocomplete.lua new file mode 100644 index 000000000..1a1d4c542 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/fsautocomplete.lua @@ -0,0 +1,32 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'fsautocomplete', '--background-service-enabled' }, + root_dir = util.root_pattern('*.sln', '*.fsproj', '.git'), + filetypes = { 'fsharp' }, + init_options = { + AutomaticWorkspaceInit = true, + }, + }, + docs = { + description = [[ +https://github.com/fsharp/FsAutoComplete + +Language Server for F# provided by FsAutoComplete (FSAC). + +FsAutoComplete requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +The preferred way to install FsAutoComplete is with `dotnet tool install --global fsautocomplete`. + +Instructions to compile from source are found on the main [repository](https://github.com/fsharp/FsAutoComplete). + +You may also need to configure the filetype as Vim defaults to Forth for `*.fs` files: + +`autocmd BufNewFile,BufRead *.fs,*.fsx,*.fsi set filetype=fsharp` + +This is automatically done by plugins such as [PhilT/vim-fsharp](https://github.com/PhilT/vim-fsharp), [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp), and [adelarsq/neofsharp.vim](https://github.com/adelarsq/neofsharp.vim). + + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/fstar.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/fstar.lua new file mode 100644 index 000000000..d866c544b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/fstar.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'fstar.exe', '--lsp' }, + filetypes = { 'fstar' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/FStarLang/FStar + +LSP support is included in FStar. Make sure `fstar.exe` is in your PATH. +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/gdscript.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/gdscript.lua new file mode 100644 index 000000000..d6d697f2c --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/gdscript.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'nc', 'localhost', '6008' }, + filetypes = { 'gd', 'gdscript', 'gdscript3' }, + root_dir = util.root_pattern('project.godot', '.git'), + }, + docs = { + description = [[ +https://github.com/godotengine/godot + +Language server for GDScript, used by Godot Engine. +]], + default_config = { + root_dir = [[util.root_pattern("project.godot", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ghcide.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ghcide.lua new file mode 100644 index 000000000..7f9307b1e --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ghcide.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'ghcide', '--lsp' }, + filetypes = { 'haskell', 'lhaskell' }, + root_dir = util.root_pattern('stack.yaml', 'hie-bios', 'BUILD.bazel', 'cabal.config', 'package.yaml'), + }, + + docs = { + description = [[ +https://github.com/digital-asset/ghcide + +A library for building Haskell IDE tooling. +"ghcide" isn't for end users now. Use "haskell-language-server" instead of "ghcide". +]], + default_config = { + root_dir = [[root_pattern("stack.yaml", "hie-bios", "BUILD.bazel", "cabal.config", "package.yaml")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/golangci_lint_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/golangci_lint_ls.lua new file mode 100644 index 000000000..8eaa01592 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/golangci_lint_ls.lua @@ -0,0 +1,34 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'golangci-lint-langserver' }, + filetypes = { 'go', 'gomod' }, + init_options = { + command = { 'golangci-lint', 'run', '--out-format', 'json' }, + }, + root_dir = function(fname) + return util.root_pattern 'go.work'(fname) or util.root_pattern('go.mod', '.golangci.yaml', '.git')(fname) + end, + }, + docs = { + description = [[ +Combination of both lint server and client + +https://github.com/nametake/golangci-lint-langserver +https://github.com/golangci/golangci-lint + + +Installation of binaries needed is done via + +``` +go install github.com/nametake/golangci-lint-langserver@latest +go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.42.1 +``` + +]], + default_config = { + root_dir = [[root_pattern('go.work') or root_pattern('go.mod', '.golangci.yaml', '.git')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/gopls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/gopls.lua new file mode 100644 index 000000000..f6a085de7 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/gopls.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'gopls' }, + filetypes = { 'go', 'gomod', 'gotmpl' }, + root_dir = function(fname) + return util.root_pattern 'go.work'(fname) or util.root_pattern('go.mod', '.git')(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/golang/tools/tree/master/gopls + +Google's lsp server for golang. +]], + default_config = { + root_dir = [[root_pattern("go.mod", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/gradle_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/gradle_ls.lua new file mode 100644 index 000000000..b23b599dd --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/gradle_ls.lua @@ -0,0 +1,37 @@ +local util = require 'lspconfig.util' + +local bin_name = 'gradle-language-server' +if vim.fn.has 'win32' == 1 then + bin_name = bin_name .. '.bat' +end + +local root_files = { + 'settings.gradle', -- Gradle (multi-project) +} + +local fallback_root_files = { + 'build.gradle', -- Gradle +} + +return { + default_config = { + filetypes = { 'groovy' }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) or util.root_pattern(unpack(fallback_root_files))(fname) + end, + cmd = { bin_name }, + }, + docs = { + description = [[ +https://github.com/microsoft/vscode-gradle + +Microsoft's lsp server for gradle files + +If you're setting this up manually, build vscode-gradle using `./gradlew installDist` and point `cmd` to the `gradle-language-server` generated in the build directory +]], + default_config = { + root_dir = [[root_pattern("settings.gradle")]], + cmd = { 'gradle-language-server' }, + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/grammarly.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/grammarly.lua new file mode 100644 index 000000000..675169da8 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/grammarly.lua @@ -0,0 +1,38 @@ +local util = require 'lspconfig.util' + +local bin_name = 'unofficial-grammarly-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'markdown' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + handlers = { + ['$/updateDocumentState'] = function() + return '' + end, + }, + }, + docs = { + description = [[ +https://github.com/emacs-grammarly/unofficial-grammarly-language-server + +`unofficial-grammarly-language-server` can be installed via `npm`: + +```sh +npm i -g @emacs-grammarly/unofficial-grammarly-language-server +``` + +WARNING: Since this language server uses Grammarly's API, any document you open with it running is shared with them. Please evaluate their [privacy policy](https://www.grammarly.com/privacy-policy) before using this. +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/graphql.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/graphql.lua new file mode 100644 index 000000000..d34881cd7 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/graphql.lua @@ -0,0 +1,33 @@ +local util = require 'lspconfig.util' + +local bin_name = 'graphql-lsp' +local cmd = { bin_name, 'server', '-m', 'stream' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, 'server', '-m', 'stream' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'graphql', 'typescriptreact', 'javascriptreact' }, + root_dir = util.root_pattern('.git', '.graphqlrc*', '.graphql.config.*', 'graphql.config.*'), + }, + + docs = { + description = [[ +https://github.com/graphql/graphiql/tree/main/packages/graphql-language-service-cli + +`graphql-lsp` can be installed via `npm`: + +```sh +npm install -g graphql-language-service-cli +``` + +Note that you must also have [the graphql package](https://github.com/graphql/graphql-js) installed and create a [GraphQL config file](https://www.graphql-config.com/docs/user/user-introduction). +]], + default_config = { + root_dir = [[root_pattern('.git', '.graphqlrc*', '.graphql.config.*')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/groovyls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/groovyls.lua new file mode 100644 index 000000000..b4182f4a3 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/groovyls.lua @@ -0,0 +1,36 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { + 'java', + '-jar', + 'groovy-language-server-all.jar', + }, + filetypes = { 'groovy' }, + root_dir = function(fname) + return util.root_pattern 'Jenkinsfile'(fname) or util.find_git_ancestor(fname) + end, + }, + docs = { + description = [[ +https://github.com/prominic/groovy-language-server.git + +Requirements: + - Linux/macOS (for now) + - Java 11+ + +`groovyls` can be installed by following the instructions [here](https://github.com/prominic/groovy-language-server.git#build). + +If you have installed groovy language server, you can set the `cmd` custom path as follow: + +```lua +require'lspconfig'.groovyls.setup{ + -- Unix + cmd = { "java", "-jar", "path/to/groovyls/groovy-language-server-all.jar" }, + ... +} +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/haxe_language_server.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/haxe_language_server.lua new file mode 100644 index 000000000..1589c7b04 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/haxe_language_server.lua @@ -0,0 +1,47 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'haxe-language-server' }, + filetypes = { 'haxe' }, + root_dir = util.root_pattern '*.hxml', + settings = { + haxe = { + executable = 'haxe', + }, + }, + init_options = { + displayArguments = { 'build.hxml' }, + }, + }, + docs = { + description = [[ +https://github.com/vshaxe/haxe-language-server + +The Haxe language server can be built by running the following commands from +the project's root directory: + + npm install + npx lix run vshaxe-build -t language-server + +This will create `bin/server.js`. Note that the server requires Haxe 3.4.0 or +higher. + +After building the language server, set the `cmd` setting in your setup +function: + +```lua +lspconfig.haxe_language_server.setup({ + cmd = {"node", "path/to/bin/server.js"}, +}) +``` + +By default, an HXML compiler arguments file named `build.hxml` is expected in +your project's root directory. If your file is named something different, +specify it using the `init_options.displayArguments` setting. +]], + default_config = { + root_dir = [[root_pattern("*.hxml")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/hdl_checker.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/hdl_checker.lua new file mode 100644 index 000000000..5cf294149 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/hdl_checker.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'hdl_checker', '--lsp' }, + filetypes = { 'vhdl', 'verilog', 'systemverilog' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/suoto/hdl_checker +Language server for hdl-checker. +Install using: `pip install hdl-checker --upgrade` +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/hhvm.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/hhvm.lua new file mode 100644 index 000000000..0e8ac5c5b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/hhvm.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'hh_client', 'lsp' }, + filetypes = { 'php', 'hack' }, + root_dir = util.root_pattern '.hhconfig', + }, + docs = { + description = [[ +Language server for programs written in Hack +https://hhvm.com/ +https://github.com/facebook/hhvm +See below for how to setup HHVM & typechecker: +https://docs.hhvm.com/hhvm/getting-started/getting-started + ]], + default_config = { + root_dir = [[root_pattern(".hhconfig")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/hie.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/hie.lua new file mode 100644 index 000000000..96148ad1c --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/hie.lua @@ -0,0 +1,34 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'hie-wrapper', '--lsp' }, + filetypes = { 'haskell' }, + root_dir = util.root_pattern('stack.yaml', 'package.yaml', '.git'), + }, + + docs = { + description = [[ +https://github.com/haskell/haskell-ide-engine + +the following init_options are supported (see https://github.com/haskell/haskell-ide-engine#configuration): +```lua +init_options = { + languageServerHaskell = { + hlintOn = bool; + maxNumberOfProblems = number; + diagnosticsDebounceDuration = number; + liquidOn = bool (default false); + completionSnippetsOn = bool (default true); + formatOnImportOn = bool (default true); + formattingProvider = string (default "brittany", alternate "floskell"); + } +} +``` + ]], + + default_config = { + root_dir = [[root_pattern("stack.yaml", "package.yaml", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/hls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/hls.lua new file mode 100644 index 000000000..32b3ea22d --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/hls.lua @@ -0,0 +1,43 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'haskell-language-server-wrapper', '--lsp' }, + filetypes = { 'haskell', 'lhaskell' }, + root_dir = util.root_pattern('*.cabal', 'stack.yaml', 'cabal.project', 'package.yaml', 'hie.yaml'), + single_file_support = true, + settings = { + haskell = { + formattingProvider = 'ormolu', + }, + }, + lspinfo = function(cfg) + local extra = {} + local function on_stdout(_, data, _) + local version = data[1] + table.insert(extra, 'version: ' .. version) + end + + local opts = { + cwd = cfg.cwd, + stdout_buffered = true, + on_stdout = on_stdout, + } + local chanid = vim.fn.jobstart({ cfg.cmd[1], '--version' }, opts) + vim.fn.jobwait { chanid } + return extra + end, + }, + + docs = { + description = [[ +https://github.com/haskell/haskell-language-server + +Haskell Language Server + ]], + + default_config = { + root_dir = [[root_pattern("*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/hoon_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/hoon_ls.lua new file mode 100644 index 000000000..80092db19 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/hoon_ls.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +local bin_name = 'hoon-language-server' +local cmd = { bin_name } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'hoon' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/urbit/hoon-language-server + +A language server for Hoon. + +The language server can be installed via `npm install -g @hoon-language-server` + +Start a fake ~zod with `urbit -F zod`. +Start the language server at the Urbit Dojo prompt with: `|start %language-server` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/html.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/html.lua new file mode 100644 index 000000000..2f8214f48 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/html.lua @@ -0,0 +1,48 @@ +local util = require 'lspconfig.util' + +local bin_name = 'vscode-html-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'html' }, + root_dir = util.root_pattern('package.json', '.git'), + single_file_support = true, + settings = {}, + init_options = { + provideFormatter = true, + embeddedLanguages = { css = true, javascript = true }, + configurationSection = { 'html', 'css', 'javascript' }, + }, + }, + docs = { + description = [[ +https://github.com/hrsh7th/vscode-langservers-extracted + +`vscode-html-language-server` can be installed via `npm`: +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-html-language-server` only provides completions when snippet support is enabled. +To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +The code-formatting feature of the lsp can be controlled with the `provideFormatter` option. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.html.setup { + capabilities = capabilities, +} +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/idris2_lsp.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/idris2_lsp.lua new file mode 100644 index 000000000..d6efdd116 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/idris2_lsp.lua @@ -0,0 +1,41 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'idris2-lsp' }, + filetypes = { 'idris2' }, + root_dir = util.root_pattern '*.ipkg', + }, + docs = { + description = [[ +https://github.com/idris-community/idris2-lsp + +The Idris 2 language server. + +Plugins for the Idris 2 filetype include +[Idris2-Vim](https://github.com/edwinb/idris2-vim) (fewer features, stable) and +[Nvim-Idris2](https://github.com/ShinKage/nvim-idris2) (cutting-edge, +experimental). + +Idris2-Lsp requires a build of Idris 2 that includes the "Idris 2 API" package. +Package managers with known support for this build include the +[AUR](https://aur.archlinux.org/packages/idris2-api-git/) and +[Homebrew](https://formulae.brew.sh/formula/idris2#default). + +If your package manager does not support the Idris 2 API, you will need to build +Idris 2 from source. Refer to the +[the Idris 2 installation instructions](https://github.com/idris-lang/Idris2/blob/main/INSTALL.md) +for details. Steps 5 and 8 are listed as "optional" in that guide, but they are +necessary in order to make the Idris 2 API available. + +You need to install a version of Idris2-Lsp that is compatible with your +version of Idris 2. There should be a branch corresponding to every released +Idris 2 version after v0.4.0. Use the latest commit on that branch. For example, +if you have Idris v0.5.1, you should use the v0.5.1 branch of Idris2-Lsp. + +If your Idris 2 version is newer than the newest Idris2-Lsp branch, use the +latest commit on the `master` branch, and set a reminder to check the Idris2-Lsp +repo for the release of a compatible versioned branch. +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/intelephense.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/intelephense.lua new file mode 100644 index 000000000..c9e35b9dd --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/intelephense.lua @@ -0,0 +1,50 @@ +local util = require 'lspconfig.util' + +local bin_name = 'intelephense' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'php' }, + root_dir = function(pattern) + local cwd = vim.loop.cwd() + local root = util.root_pattern('composer.json', '.git')(pattern) + + -- prefer cwd if root is a descendant + return util.path.is_descendant(cwd, root) and cwd or root + end, + }, + docs = { + description = [[ +https://intelephense.com/ + +`intelephense` can be installed via `npm`: +```sh +npm install -g intelephense +``` +]], + default_config = { + root_dir = [[root_pattern("composer.json", ".git")]], + init_options = [[{ + storagePath = Optional absolute path to storage dir. Defaults to os.tmpdir(). + globalStoragePath = Optional absolute path to a global storage dir. Defaults to os.homedir(). + licenceKey = Optional licence key or absolute path to a text file containing the licence key. + clearCache = Optional flag to clear server state. State can also be cleared by deleting {storagePath}/intelephense + -- See https://github.com/bmewburn/intelephense-docs/blob/master/installation.md#initialisation-options + }]], + settings = [[{ + intelephense = { + files = { + maxSize = 1000000; + }; + }; + -- See https://github.com/bmewburn/intelephense-docs + }]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/java_language_server.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/java_language_server.lua new file mode 100644 index 000000000..3ddf4b1b4 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/java_language_server.lua @@ -0,0 +1,18 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'java' }, + root_dir = util.root_pattern('build.gradle', 'pom.xml', '.git'), + settings = {}, + }, + docs = { + description = [[ +https://github.com/georgewfraser/java-language-server + +Java language server + +Point `cmd` to `lang_server_linux.sh` or the equivalent script for macOS/Windows provided by java-language-server +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/jdtls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/jdtls.lua new file mode 100644 index 000000000..d74057299 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/jdtls.lua @@ -0,0 +1,193 @@ +local util = require 'lspconfig.util' +local handlers = require 'vim.lsp.handlers' + +local sysname = vim.loop.os_uname().sysname +local env = { + HOME = vim.loop.os_homedir(), + JAVA_HOME = os.getenv 'JAVA_HOME', + JDTLS_HOME = os.getenv 'JDTLS_HOME', + WORKSPACE = os.getenv 'WORKSPACE', +} + +local function get_java_executable() + local executable = env.JAVA_HOME and util.path.join(env.JAVA_HOME, 'bin', 'java') or 'java' + + return sysname:match 'Windows' and executable .. '.exe' or executable +end + +local function get_workspace_dir() + return env.WORKSPACE and env.WORKSPACE or util.path.join(env.HOME, 'workspace') +end + +local function get_jdtls_jar() + return vim.fn.expand '$JDTLS_HOME/plugins/org.eclipse.equinox.launcher_*.jar' +end + +local function get_jdtls_config() + if sysname:match 'Linux' then + return util.path.join(env.JDTLS_HOME, 'config_linux') + elseif sysname:match 'Darwin' then + return util.path.join(env.JDTLS_HOME, 'config_mac') + elseif sysname:match 'Windows' then + return util.path.join(env.JDTLS_HOME, 'config_win') + else + return util.path.join(env.JDTLS_HOME, 'config_linux') + end +end + +-- TextDocument version is reported as 0, override with nil so that +-- the client doesn't think the document is newer and refuses to update +-- See: https://github.com/eclipse/eclipse.jdt.ls/issues/1695 +local function fix_zero_version(workspace_edit) + if workspace_edit and workspace_edit.documentChanges then + for _, change in pairs(workspace_edit.documentChanges) do + local text_document = change.textDocument + if text_document and text_document.version and text_document.version == 0 then + text_document.version = nil + end + end + end + return workspace_edit +end + +local function on_textdocument_codeaction(err, actions, ctx) + for _, action in ipairs(actions) do + -- TODO: (steelsojka) Handle more than one edit? + if action.command == 'java.apply.workspaceEdit' then -- 'action' is Command in java format + action.edit = fix_zero_version(action.edit or action.arguments[1]) + elseif type(action.command) == 'table' and action.command.command == 'java.apply.workspaceEdit' then -- 'action' is CodeAction in java format + action.edit = fix_zero_version(action.edit or action.command.arguments[1]) + end + end + + handlers[ctx.method](err, actions, ctx) +end + +local function on_textdocument_rename(err, workspace_edit, ctx) + handlers[ctx.method](err, fix_zero_version(workspace_edit), ctx) +end + +local function on_workspace_applyedit(err, workspace_edit, ctx) + handlers[ctx.method](err, fix_zero_version(workspace_edit), ctx) +end + +-- Non-standard notification that can be used to display progress +local function on_language_status(_, result) + local command = vim.api.nvim_command + command 'echohl ModeMsg' + command(string.format('echo "%s"', result.message)) + command 'echohl None' +end + +local root_files = { + -- Single-module projects + { + 'build.xml', -- Ant + 'pom.xml', -- Maven + 'settings.gradle', -- Gradle + 'settings.gradle.kts', -- Gradle + }, + -- Multi-module projects + { 'build.gradle', 'build.gradle.kts' }, +} + +return { + default_config = { + cmd = { + get_java_executable(), + '-Declipse.application=org.eclipse.jdt.ls.core.id1', + '-Dosgi.bundles.defaultStartLevel=4', + '-Declipse.product=org.eclipse.jdt.ls.core.product', + '-Dlog.protocol=true', + '-Dlog.level=ALL', + '-Xms1g', + '-Xmx2G', + '--add-modules=ALL-SYSTEM', + '--add-opens', + 'java.base/java.util=ALL-UNNAMED', + '--add-opens', + 'java.base/java.lang=ALL-UNNAMED', + '-jar', + get_jdtls_jar(), + '-configuration', + get_jdtls_config(), + '-data', + get_workspace_dir(), + }, + filetypes = { 'java' }, + root_dir = function(fname) + for _, patterns in ipairs(root_files) do + local root = util.root_pattern(unpack(patterns))(fname) + if root then + return root + end + end + end, + single_file_support = true, + init_options = { + workspace = get_workspace_dir(), + jvm_args = {}, + os_config = nil, + }, + handlers = { + -- Due to an invalid protocol implementation in the jdtls we have to conform these to be spec compliant. + -- https://github.com/eclipse/eclipse.jdt.ls/issues/376 + ['textDocument/codeAction'] = on_textdocument_codeaction, + ['textDocument/rename'] = on_textdocument_rename, + ['workspace/applyEdit'] = on_workspace_applyedit, + ['language/status'] = vim.schedule_wrap(on_language_status), + }, + }, + docs = { + description = [[ +https://projects.eclipse.org/projects/eclipse.jdt.ls + +Language server for Java. + +IMPORTANT: If you want all the features jdtls has to offer, [nvim-jdtls](https://github.com/mfussenegger/nvim-jdtls) +is highly recommended. If all you need is diagnostics, completion, imports, gotos and formatting and some code actions +you can keep reading here. + +For manual installation you can download precompiled binaries from the +[official downloads site](http://download.eclipse.org/jdtls/snapshots/?d) + +Due to the nature of java, settings cannot be inferred. Please set the following +environmental variables to match your installation. If you need per-project configuration +[direnv](https://github.com/direnv/direnv) is highly recommended. + +```bash +# Mandatory: +# .bashrc +export JDTLS_HOME=/path/to/jdtls_root # Directory with the plugin and configs directories + +# Optional: +export JAVA_HOME=/path/to/java_home # In case you don't have java in path or want to use a version in particular +export WORKSPACE=/path/to/workspace # Defaults to $HOME/workspace +``` +```lua + -- init.lua + require'lspconfig'.jdtls.setup{} +``` + +For automatic installation you can use the following unofficial installers/launchers under your own risk: + - [jdtls-launcher](https://github.com/eruizc-dev/jdtls-launcher) (Includes lombok support by default) + ```lua + -- init.lua + require'lspconfig'.jdtls.setup{ cmd = { 'jdtls' } } + ``` + ]], + default_config = { + root_dir = [[{ + -- Single-module projects + { + 'build.xml', -- Ant + 'pom.xml', -- Maven + 'settings.gradle', -- Gradle + 'settings.gradle.kts', -- Gradle + }, + -- Multi-module projects + { 'build.gradle', 'build.gradle.kts' }, + } or vim.fn.getcwd()]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/jedi_language_server.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/jedi_language_server.lua new file mode 100644 index 000000000..30cf8f506 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/jedi_language_server.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'pyproject.toml', + 'setup.py', + 'setup.cfg', + 'requirements.txt', + 'Pipfile', +} + +return { + default_config = { + cmd = { 'jedi-language-server' }, + filetypes = { 'python' }, + root_dir = util.root_pattern(unpack(root_files)), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/pappasam/jedi-language-server + +`jedi-language-server`, a language server for Python, built on top of jedi + ]], + default_config = { + root_dir = "vim's starting directory", + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/jsonls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/jsonls.lua new file mode 100644 index 000000000..a62a715d0 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/jsonls.lua @@ -0,0 +1,48 @@ +local util = require 'lspconfig.util' + +local bin_name = 'vscode-json-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'json', 'jsonc' }, + init_options = { + provideFormatter = true, + }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + -- this language server config is in VSCode built-in package.json + description = [[ +https://github.com/hrsh7th/vscode-langservers-extracted + +vscode-json-language-server, a language server for JSON and JSON schema + +`vscode-json-language-server` can be installed via `npm`: +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-json-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.jsonls.setup { + capabilities = capabilities, +} +``` +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/jsonnet_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/jsonnet_ls.lua new file mode 100644 index 000000000..3493e7ebd --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/jsonnet_ls.lua @@ -0,0 +1,40 @@ +local util = require 'lspconfig.util' + +-- common jsonnet library paths +local function jsonnet_path(root_dir) + local paths = { + util.path.join(root_dir, 'lib'), + util.path.join(root_dir, 'vendor'), + } + return table.concat(paths, ':') +end + +return { + default_config = { + cmd = { 'jsonnet-language-server' }, + filetypes = { 'jsonnet', 'libsonnet' }, + root_dir = function(fname) + return util.root_pattern 'jsonnetfile.json'(fname) or util.find_git_ancestor(fname) + end, + on_new_config = function(new_config, root_dir) + new_config.cmd_env = { + JSONNET_PATH = jsonnet_path(root_dir), + } + end, + }, + docs = { + description = [[ +https://github.com/grafana/jsonnet-language-server + +A Language Server Protocol (LSP) server for Jsonnet. + +The language server can be installed with `go`: +```sh +go install github.com/grafana/jsonnet-language-server@latest +``` +]], + default_config = { + root_dir = [[root_pattern("jsonnetfile.json")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/julials.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/julials.lua new file mode 100644 index 000000000..44360c71a --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/julials.lua @@ -0,0 +1,75 @@ +local util = require 'lspconfig.util' + +local cmd = { + 'julia', + '--startup-file=no', + '--history-file=no', + '-e', + [[ + # Load LanguageServer.jl: attempt to load from ~/.julia/environments/nvim-lspconfig + # with the regular load path as a fallback + ls_install_path = joinpath( + get(DEPOT_PATH, 1, joinpath(homedir(), ".julia")), + "environments", "nvim-lspconfig" + ) + pushfirst!(LOAD_PATH, ls_install_path) + using LanguageServer + popfirst!(LOAD_PATH) + depot_path = get(ENV, "JULIA_DEPOT_PATH", "") + project_path = let + dirname(something( + ## 1. Finds an explicitly set project (JULIA_PROJECT) + Base.load_path_expand(( + p = get(ENV, "JULIA_PROJECT", nothing); + p === nothing ? nothing : isempty(p) ? nothing : p + )), + ## 2. Look for a Project.toml file in the current working directory, + ## or parent directories, with $HOME as an upper boundary + Base.current_project(), + ## 3. First entry in the load path + get(Base.load_path(), 1, nothing), + ## 4. Fallback to default global environment, + ## this is more or less unreachable + Base.load_path_expand("@v#.#"), + )) + end + @info "Running language server" VERSION pwd() project_path depot_path + server = LanguageServer.LanguageServerInstance(stdin, stdout, project_path, depot_path) + server.runlinter = true + run(server) + ]], +} + +return { + default_config = { + cmd = cmd, + filetypes = { 'julia' }, + root_dir = function(fname) + return util.root_pattern 'Project.toml'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/julia-vscode/julia-vscode + +LanguageServer.jl can be installed with `julia` and `Pkg`: +```sh +julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.add("LanguageServer")' +``` +where `~/.julia/environments/nvim-lspconfig` is the location where +the default configuration expects LanguageServer.jl to be installed. + +To update an existing install, use the following command: +```sh +julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.update()' +``` + +Note: In order to have LanguageServer.jl pick up installed packages or dependencies in a +Julia project, you must make sure that the project is instantiated: +```sh +julia --project=/path/to/my/project -e 'using Pkg; Pkg.instantiate()' +``` + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/kotlin_language_server.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/kotlin_language_server.lua new file mode 100644 index 000000000..a955fe637 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/kotlin_language_server.lua @@ -0,0 +1,71 @@ +local util = require 'lspconfig.util' + +local bin_name = 'kotlin-language-server' +if vim.fn.has 'win32' == 1 then + bin_name = bin_name .. '.bat' +end + +--- The presence of one of these files indicates a project root directory +-- +-- These are configuration files for the various build systems supported by +-- Kotlin. I am not sure whether the language server supports Ant projects, +-- but I'm keeping it here as well since Ant does support Kotlin. +local root_files = { + 'settings.gradle', -- Gradle (multi-project) + 'settings.gradle.kts', -- Gradle (multi-project) + 'build.xml', -- Ant + 'pom.xml', -- Maven +} + +local fallback_root_files = { + 'build.gradle', -- Gradle + 'build.gradle.kts', -- Gradle +} + +return { + default_config = { + filetypes = { 'kotlin' }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) or util.root_pattern(unpack(fallback_root_files))(fname) + end, + cmd = { bin_name }, + }, + docs = { + description = [[ + A kotlin language server which was developed for internal usage and + released afterwards. Maintaining is not done by the original author, + but by fwcd. + + It is built via gradle and developed on github. + Source and additional description: + https://github.com/fwcd/kotlin-language-server + + This server requires vim to be aware of the kotlin-filetype. + You could refer for this capability to: + https://github.com/udalov/kotlin-vim (recommended) + Note that there is no LICENSE specified yet. + ]], + default_config = { + root_dir = [[root_pattern("settings.gradle")]], + cmd = { 'kotlin-language-server' }, + capabilities = [[ + smart code completion, + diagnostics, + hover, + document symbols, + definition lookup, + method signature help, + dependency resolution, + additional plugins from: https://github.com/fwcd + + Snipped of License (refer to source for full License): + + The MIT License (MIT) + + Copyright (c) 2016 George Fraser + Copyright (c) 2018 fwcd + + ]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/lean3ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/lean3ls.lua new file mode 100644 index 000000000..b35a6932b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/lean3ls.lua @@ -0,0 +1,54 @@ +local util = require 'lspconfig.util' + +local bin_name = 'lean-language-server' +local args = { '--stdio', '--', '-M', '4096', '-T', '100000' } +local cmd = { bin_name, unpack(args) } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, unpack(args) } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'lean3' }, + offset_encoding = 'utf-32', + root_dir = function(fname) + fname = util.path.sanitize(fname) + -- check if inside elan stdlib + local stdlib_dir + do + local _, endpos = fname:find '/lean/library' + if endpos then + stdlib_dir = fname:sub(1, endpos) + end + end + + return util.root_pattern 'leanpkg.toml'(fname) + or util.root_pattern 'leanpkg.path'(fname) + or stdlib_dir + or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/leanprover/lean-client-js/tree/master/lean-language-server + +Lean installation instructions can be found +[here](https://leanprover-community.github.io/get_started.html#regular-install). + +Once Lean is installed, you can install the Lean 3 language server by running +```sh +npm install -g lean-language-server +``` + +Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim), +that plugin fully handles the setup of the Lean language server, +and you shouldn't set up `lean3ls` both with it and `lspconfig`. + ]], + default_config = { + root_dir = [[root_pattern("leanpkg.toml") or root_pattern(".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/leanls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/leanls.lua new file mode 100644 index 000000000..208598af9 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/leanls.lua @@ -0,0 +1,77 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'lake', 'serve', '--' }, + filetypes = { 'lean' }, + root_dir = function(fname) + -- check if inside elan stdlib + fname = util.path.sanitize(fname) + local stdlib_dir + do + local _, endpos = fname:find '/src/lean' + if endpos then + stdlib_dir = fname:sub(1, endpos) + end + end + if not stdlib_dir then + local _, endpos = fname:find '/lib/lean' + if endpos then + stdlib_dir = fname:sub(1, endpos) + end + end + + return util.root_pattern('lakefile.lean', 'lean-toolchain', 'leanpkg.toml')(fname) + or stdlib_dir + or util.find_git_ancestor(fname) + end, + options = { + -- Only Lake 3.0+ supports lake serve, so for old enough Lean 4, + -- or core Lean itself, this command (typically using the in-built + -- Lean 4 language server) will be used instead. + no_lake_lsp_cmd = { 'lean', '--server' }, + }, + on_new_config = function(config, root_dir) + local use_lake_serve = false + if util.path.exists(util.path.join(root_dir, 'lakefile.lean')) then + local lake_version = '' + local lake_job = vim.fn.jobstart({ 'lake', '--version' }, { + on_stdout = function(_, d, _) + lake_version = table.concat(d, '\n') + end, + stdout_buffered = true, + }) + if lake_job > 0 and vim.fn.jobwait({ lake_job })[1] == 0 then + local major = lake_version:match 'Lake version (%d).' + if major and tonumber(major) >= 3 then + use_lake_serve = true + end + end + end + if not use_lake_serve then + config.cmd = config.options.no_lake_lsp_cmd + end + -- add root dir as command-line argument for `ps aux` + table.insert(config.cmd, root_dir) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/leanprover/lean4 + +Lean installation instructions can be found +[here](https://leanprover-community.github.io/get_started.html#regular-install). + +The Lean 4 language server is built-in with a Lean 4 install +(and can be manually run with, e.g., `lean --server`). + +Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim), +that plugin fully handles the setup of the Lean language server, +and you shouldn't set up `leanls` both with it and `lspconfig`. + ]], + default_config = { + root_dir = [[root_pattern("lakefile.lean", "lean-toolchain", "leanpkg.toml", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/lelwel_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/lelwel_ls.lua new file mode 100644 index 000000000..ac8c45605 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/lelwel_ls.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'lelwel-ls' }, + filetypes = { 'llw' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/0x2a-42/lelwel + +Language server for lelwel grammars. + +You can install `lelwel-ls` via cargo: +```sh +cargo install --features="lsp" lelwel +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/lemminx.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/lemminx.lua new file mode 100644 index 000000000..5bcf1cfdf --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/lemminx.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'lemminx' }, + filetypes = { 'xml', 'xsd', 'xsl', 'xslt', 'svg' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/eclipse/lemminx + +The easiest way to install the server is to get a binary at https://download.jboss.org/jbosstools/vscode/stable/lemminx-binary/ and place it in your PATH. + +NOTE to macOS users: Binaries from unidentified developers are blocked by default. If you trust the downloaded binary from jboss.org, run it once, cancel the prompt, then remove the binary from Gatekeeper quarantine with `xattr -d com.apple.quarantine lemminx`. It should now run without being blocked. + +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ltex.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ltex.lua new file mode 100644 index 000000000..0aeb38742 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ltex.lua @@ -0,0 +1,47 @@ +local util = require 'lspconfig.util' + +local language_id_mapping = { + bib = 'bibtex', + plaintex = 'tex', + rnoweb = 'sweave', + rst = 'restructuredtext', + tex = 'latex', + xhtml = 'xhtml', +} + +local bin_name = 'ltex-ls' +if vim.fn.has 'win32' == 1 then + bin_name = bin_name .. '.bat' +end + +return { + default_config = { + cmd = { bin_name }, + filetypes = { 'bib', 'gitcommit', 'markdown', 'org', 'plaintex', 'rst', 'rnoweb', 'tex' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + get_language_id = function(_, filetype) + local language_id = language_id_mapping[filetype] + if language_id then + return language_id + else + return filetype + end + end, + }, + docs = { + description = [=[ +https://github.com/valentjn/ltex-ls + +LTeX Language Server: LSP language server for LanguageTool 🔍✔️ with support for LaTeX 🎓, Markdown 📝, and others + +To install, download the latest [release](https://github.com/valentjn/ltex-ls/releases) and ensure `ltex-ls` is on your path. + +To support org files or R sweave, users can define a custom filetype autocommand (or use a plugin which defines these filetypes): + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.org set filetype=org ]] +``` +]=], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/metals.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/metals.lua new file mode 100644 index 000000000..b05db5cea --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/metals.lua @@ -0,0 +1,45 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'metals' }, + filetypes = { 'scala' }, + root_dir = util.root_pattern('build.sbt', 'build.sc', 'build.gradle', 'pom.xml'), + message_level = vim.lsp.protocol.MessageType.Log, + init_options = { + statusBarProvider = 'show-message', + isHttpEnabled = true, + compilerOptions = { + snippetAutoIndent = false, + }, + }, + }, + docs = { + description = [[ +https://scalameta.org/metals/ + +Scala language server with rich IDE features. + +See full instructions in the Metals documentation: + +https://scalameta.org/metals/docs/editors/vim.html#using-an-alternative-lsp-client + +Note: that if you're using [nvim-metals](https://github.com/scalameta/nvim-metals), that plugin fully handles the setup and installation of Metals, and you shouldn't set up Metals both with it and `lspconfig`. + +To install Metals, make sure to have [coursier](https://get-coursier.io/docs/cli-installation) installed, and once you do you can install the latest Metals with `cs install metals`. You can also manually bootstrap Metals with the following command. + +```bash +cs bootstrap \ + --java-opt -Xss4m \ + --java-opt -Xms100m \ + org.scalameta:metals_2.12: \ + -r bintray:scalacenter/releases \ + -r sonatype:snapshots \ + -o /usr/local/bin/metals -f +``` +]], + default_config = { + root_dir = [[util.root_pattern("build.sbt", "build.sc", "build.gradle", "pom.xml")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/mint.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/mint.lua new file mode 100644 index 000000000..7fde1c406 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/mint.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'mint', 'ls' }, + filetypes = { 'mint' }, + root_dir = function(fname) + return util.root_pattern 'mint.json'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://www.mint-lang.com + +Install Mint using the [instructions](https://www.mint-lang.com/install). +The language server is included since version 0.12.0. +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/mm0_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/mm0_ls.lua new file mode 100644 index 000000000..513bbeb95 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/mm0_ls.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'mm0-rs', 'server' }, + root_dir = util.find_git_ancestor, + filetypes = { 'metamath-zero' }, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/digama0/mm0 + +Language Server for the metamath-zero theorem prover. + +Requires [mm0-rs](https://github.com/digama0/mm0/tree/master/mm0-rs) to be installed +and available on the `PATH`. + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/nickel_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/nickel_ls.lua new file mode 100644 index 000000000..3a9387e85 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/nickel_ls.lua @@ -0,0 +1,37 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'nls' }, + filetypes = { 'ncl', 'nickel' }, + root_dir = util.find_git_ancestor, + }, + + docs = { + description = [[ +Nickel Language Server + +https://github.com/tweag/nickel + +`nls` can be installed with nix, or cargo, from the Nickel repository. +```sh +git clone https://github.com/tweag/nickel.git +``` + +Nix: +```sh +cd nickel +nix-env -f . -i +``` + +cargo: +```sh +cd nickel/lsp/nls +cargo install --path . +``` + +In order to have lspconfig detect Nickel filetypes (a prequisite for autostarting a server), +install the [Nickel vim plugin](https://github.com/nickel-lang/vim-nickel). + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/nimls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/nimls.lua new file mode 100644 index 000000000..f10b002a8 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/nimls.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'nimlsp' }, + filetypes = { 'nim' }, + root_dir = function(fname) + return util.root_pattern '*.nimble'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/PMunch/nimlsp +`nimlsp` can be installed via the `nimble` package manager: +```sh +nimble install nimlsp +``` + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ocamlls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ocamlls.lua new file mode 100644 index 000000000..fcc25dbc5 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ocamlls.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +local bin_name = 'ocaml-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end +return { + default_config = { + cmd = cmd, + filetypes = { 'ocaml', 'reason' }, + root_dir = util.root_pattern('*.opam', 'esy.json', 'package.json'), + }, + docs = { + description = [[ +https://github.com/ocaml-lsp/ocaml-language-server + +`ocaml-language-server` can be installed via `npm` +```sh +npm install -g ocaml-language-server +``` + ]], + default_config = { + root_dir = [[root_pattern("*.opam", "esy.json", "package.json")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ocamllsp.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ocamllsp.lua new file mode 100644 index 000000000..152847162 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ocamllsp.lua @@ -0,0 +1,38 @@ +local util = require 'lspconfig.util' + +local language_id_of = { + menhir = 'ocaml.menhir', + ocaml = 'ocaml', + ocamlinterface = 'ocaml.interface', + ocamllex = 'ocaml.ocamllex', + reason = 'reason', +} + +local get_language_id = function(_, ftype) + return language_id_of[ftype] +end + +return { + default_config = { + cmd = { 'ocamllsp' }, + filetypes = { 'ocaml', 'ocaml.menhir', 'ocaml.interface', 'ocaml.ocamllex', 'reason' }, + root_dir = util.root_pattern('*.opam', 'esy.json', 'package.json', '.git'), + get_language_id = get_language_id, + }, + docs = { + description = [[ +https://github.com/ocaml/ocaml-lsp + +`ocaml-lsp` can be installed as described in [installation guide](https://github.com/ocaml/ocaml-lsp#installation). + +To install the lsp server in a particular opam switch: +```sh +opam pin add ocaml-lsp-server https://github.com/ocaml/ocaml-lsp.git +opam install ocaml-lsp-server +``` + ]], + default_config = { + root_dir = [[root_pattern("*.opam", "esy.json", "package.json", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ols.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ols.lua new file mode 100644 index 000000000..65dd085c7 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/ols.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'ols' }, + filetypes = { 'odin' }, + root_dir = util.root_pattern('ols.json', '.git'), + single_file_support = true, + }, + docs = { + description = [[ + https://github.com/DanielGavin/ols + + `Odin Language Server`. + ]], + default_config = { + root_dir = [[util.root_pattern("ols.json", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/omnisharp.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/omnisharp.lua new file mode 100644 index 000000000..b51d8989c --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/omnisharp.lua @@ -0,0 +1,52 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'cs', 'vb' }, + root_dir = function(fname) + return util.root_pattern '*.sln'(fname) or util.root_pattern '*.csproj'(fname) + end, + on_new_config = function(new_config, new_root_dir) + if new_root_dir then + table.insert(new_config.cmd, '-s') + table.insert(new_config.cmd, new_root_dir) + end + end, + init_options = {}, + }, + -- on_new_config = function(new_config) end; + -- on_attach = function(client, bufnr) end; + docs = { + description = [[ +https://github.com/omnisharp/omnisharp-roslyn +OmniSharp server based on Roslyn workspaces + +`omnisharp-roslyn` can be installed by downloading and extracting a release from [here](https://github.com/OmniSharp/omnisharp-roslyn/releases). +Omnisharp can also be built from source by following the instructions [here](https://github.com/omnisharp/omnisharp-roslyn#downloading-omnisharp). + +Omnisharp requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +**By default, omnisharp-roslyn doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. + +```lua +local pid = vim.fn.getpid() +-- On linux/darwin if using a release build, otherwise under scripts/OmniSharp(.Core)(.cmd) +local omnisharp_bin = "/path/to/omnisharp-repo/run" +-- on Windows +-- local omnisharp_bin = "/path/to/omnisharp/OmniSharp.exe" +require'lspconfig'.omnisharp.setup{ + cmd = { omnisharp_bin, "--languageserver" , "--hostPID", tostring(pid) }; + ... +} +``` + +Note, if you download the executable for darwin you will need to strip the quarantine label to run: +```bash +find /path/to/omnisharp-osx | xargs xattr -r -d com.apple.quarantine +``` +]], + default_config = { + root_dir = [[root_pattern(".sln") or root_pattern(".csproj")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/opencl_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/opencl_ls.lua new file mode 100644 index 000000000..dc88d24c4 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/opencl_ls.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'opencl-language-server' }, + filetypes = { 'opencl' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/Galarius/opencl-language-server + +Build instructions can be found [here](https://github.com/Galarius/opencl-language-server/blob/main/_dev/build.md). + +Prebuilt binaries are available for Linux, macOS and Windows [here](https://github.com/Galarius/opencl-language-server/releases). +]], + default_config = { + root_dir = [[util.root_pattern(".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/openscad_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/openscad_ls.lua new file mode 100644 index 000000000..e5ca9cac5 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/openscad_ls.lua @@ -0,0 +1,32 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'openscad-language-server' }, + filetypes = { 'openscad' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [=[ +https://github.com/dzhu/openscad-language-server + +A Language Server Protocol server for OpenSCAD + +You can build and install `openscad-language-server` binary with `cargo`: +```sh +cargo install openscad-language-server +``` + +Vim does not have built-in syntax for the `openscad` filetype currently. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.scad set filetype=openscad ]] +``` + +or by installing a filetype plugin such as https://github.com/sirtaj/vim-openscad +]=], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/pasls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/pasls.lua new file mode 100644 index 000000000..5758c824f --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/pasls.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'pasls' }, + filetypes = { 'pascal' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/genericptr/pascal-language-server + +An LSP server implementation for Pascal variants that are supported by Free Pascal, including Object Pascal. It uses CodeTools from Lazarus as backend. + +First set `cmd` to the Pascal lsp binary. + +Customization options are passed to pasls as environment variables for example in your `.bashrc`: +```bash +export FPCDIR='/usr/lib/fpc/src' # FPC source directory (This is the only required option for the server to work). +export PP='/usr/lib/fpc/3.2.2/ppcx64' # Path to the Free Pascal compiler executable. +export LAZARUSDIR='/usr/lib/lazarus' # Path to the Lazarus sources. +export FPCTARGET='' # Target operating system for cross compiling. +export FPCTARGETCPU='x86_64' # Target CPU for cross compiling. +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/perlls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/perlls.lua new file mode 100644 index 000000000..5d241a5d6 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/perlls.lua @@ -0,0 +1,39 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { + 'perl', + '-MPerl::LanguageServer', + '-e', + 'Perl::LanguageServer::run', + '--', + '--port 13603', + '--nostdio 0', + '--version 2.1.0', + }, + settings = { + perl = { + perlCmd = 'perl', + perlInc = ' ', + fileFilter = { '.pm', '.pl' }, + ignoreDirs = '.git', + }, + }, + filetypes = { 'perl' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/richterger/Perl-LanguageServer/tree/master/clients/vscode/perl + +`Perl-LanguageServer`, a language server for Perl. + +To use the language server, ensure that you have Perl::LanguageServer installed and perl command is on your path. +]], + default_config = { + root_dir = "vim's starting directory", + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/perlnavigator.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/perlnavigator.lua new file mode 100644 index 000000000..7ba389552 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/perlnavigator.lua @@ -0,0 +1,39 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = {}, + filetypes = { 'perl' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/bscan/PerlNavigator + +A Perl language server + +**By default, perlnavigator doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. +You have to install the language server manually. + +Clone the PerlNavigator repo, install based on the [instructions](https://github.com/bscan/PerlNavigator#installation-for-other-editors), +and point `cmd` to `server.js` inside the `server/out` directory: + +```lua +cmd = {'node', '/server/out/server.js', '--stdio'} +``` + +At minimum, you will need `perl` in your path. If you want to use a non-standard `perl` you will need to set your configuration like so: +```lua +settings = { + perlnavigator = { + perlPath = '/some/odd/location/my-perl' + } +} +``` + +The `contributes.configuration.properties` section of `perlnavigator`'s `package.json` has all available configuration settings. All +settings have a reasonable default, but, at minimum, you may want to point `perlnavigator` at your `perltidy` and `perlcritic` configurations. +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/perlpls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/perlpls.lua new file mode 100644 index 000000000..332602812 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/perlpls.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'pls' }, + settings = { + perl = { + perlcritic = { enabled = false }, + syntax = { enabled = true }, + }, + }, + filetypes = { 'perl' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/FractalBoy/perl-language-server +https://metacpan.org/pod/PLS + +`PLS`, another language server for Perl. + +To use the language server, ensure that you have PLS installed and that it is in your path +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/phpactor.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/phpactor.lua new file mode 100644 index 000000000..5a1f0d10e --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/phpactor.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'phpactor', 'language-server' }, + filetypes = { 'php' }, + root_dir = function(pattern) + local cwd = vim.loop.cwd() + local root = util.root_pattern('composer.json', '.git')(pattern) + + -- prefer cwd if root is a descendant + return util.path.is_descendant(cwd, root) and cwd or root + end, + }, + docs = { + description = [[ +https://github.com/phpactor/phpactor + +Installation: https://phpactor.readthedocs.io/en/master/usage/standalone.html#global-installation +]], + default_config = { + cmd = { 'phpactor', 'language-server' }, + root_dir = [[root_pattern("composer.json", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/please.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/please.lua new file mode 100644 index 000000000..085d1e700 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/please.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'plz', 'tool', 'lps' }, + filetypes = { 'bzl' }, + root_dir = util.root_pattern '.plzconfig', + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/thought-machine/please + +High-performance extensible build system for reproducible multi-language builds. + +The `plz` binary will automatically install the LSP for you on first run +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/powershell_es.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/powershell_es.lua new file mode 100644 index 000000000..ac723f436 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/powershell_es.lua @@ -0,0 +1,72 @@ +local util = require 'lspconfig.util' + +local temp_path = vim.fn.stdpath 'cache' + +local function make_cmd(new_config) + if new_config.bundle_path ~= nil then + local command_fmt = + [[%s/PowerShellEditorServices/Start-EditorServices.ps1 -BundledModulesPath %s -LogPath %s/powershell_es.log -SessionDetailsPath %s/powershell_es.session.json -FeatureFlags @() -AdditionalModules @() -HostName nvim -HostProfileId 0 -HostVersion 1.0.0 -Stdio -LogLevel Normal]] + local command = command_fmt:format(new_config.bundle_path, new_config.bundle_path, temp_path, temp_path) + return { new_config.shell, '-NoLogo', '-NoProfile', '-Command', command } + end +end + +return { + default_config = { + shell = 'pwsh', + on_new_config = function(new_config, _) + -- Don't overwrite cmd if already set + if not new_config.cmd then + new_config.cmd = make_cmd(new_config) + end + end, + + filetypes = { 'ps1' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/PowerShell/PowerShellEditorServices + +Language server for PowerShell. + +To install, download and extract PowerShellEditorServices.zip +from the [releases](https://github.com/PowerShell/PowerShellEditorServices/releases). +To configure the language server, set the property `bundle_path` to the root +of the extracted PowerShellEditorServices.zip. + +The default configuration doesn't set `cmd` unless `bundle_path` is specified. + +```lua +require'lspconfig'.powershell_es.setup{ + bundle_path = 'c:/w/PowerShellEditorServices', +} +``` + +By default the languageserver is started in `pwsh` (PowerShell Core). This can be changed by specifying `shell`. + +```lua +require'lspconfig'.powershell_es.setup{ + bundle_path = 'c:/w/PowerShellEditorServices', + shell = 'powershell.exe', +} +``` + +Note that the execution policy needs to be set to `Unrestricted` for the languageserver run under PowerShell + +If necessary, specific `cmd` can be defined instead of `bundle_path`. +See [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices#stdio) +to learn more. + +```lua +require'lspconfig'.powershell_es.setup{ + cmd = {'pwsh', '-NoLogo', '-NoProfile', '-Command', "c:/PSES/Start-EditorServices.ps1 ..."} +} +``` +]], + default_config = { + root_dir = 'git root or current directory', + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/prismals.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/prismals.lua new file mode 100644 index 000000000..f330e2539 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/prismals.lua @@ -0,0 +1,34 @@ +local util = require 'lspconfig.util' + +local bin_name = 'prisma-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'prisma' }, + settings = { + prisma = { + prismaFmtBinPath = '', + }, + }, + root_dir = util.root_pattern('.git', 'package.json'), + }, + docs = { + description = [[ +Language Server for the Prisma JavaScript and TypeScript ORM + +`@prisma/language-server` can be installed via npm +```sh +npm install -g @prisma/language-server +``` +]], + default_config = { + root_dir = [[root_pattern(".git", "package.json")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/prosemd_lsp.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/prosemd_lsp.lua new file mode 100644 index 000000000..048e4b494 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/prosemd_lsp.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'prosemd-lsp', '--stdio' }, + filetypes = { 'markdown' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/kitten/prosemd-lsp + +An experimental LSP for Markdown. + +Please see the manual installation instructions: https://github.com/kitten/prosemd-lsp#manual-installation +]], + default_config = { + root_dir = util.find_git_ancestor, + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/psalm.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/psalm.lua new file mode 100644 index 000000000..01f758192 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/psalm.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +local bin_name = 'psalm-language-server' + +if vim.fn.has 'win32' == 1 then + bin_name = bin_name .. '.bat' +end + +return { + default_config = { + cmd = { bin_name }, + filetypes = { 'php' }, + root_dir = util.root_pattern('psalm.xml', 'psalm.xml.dist'), + }, + docs = { + description = [[ +https://github.com/vimeo/psalm + +Can be installed with composer. +```sh +composer global require vimeo/psalm +``` +]], + default_config = { + cmd = { 'psalm-language-server' }, + root_dir = [[root_pattern("psalm.xml", "psalm.xml.dist")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/puppet.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/puppet.lua new file mode 100644 index 000000000..18a1532cc --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/puppet.lua @@ -0,0 +1,38 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'manifests', + '.puppet-lint.rc', + 'hiera.yaml', + '.git', +} + +return { + default_config = { + cmd = { 'puppet-languageserver', '--stdio' }, + filetypes = { 'puppet' }, + root_dir = util.root_pattern(unpack(root_files)), + single_file_support = true, + }, + docs = { + description = [[ +LSP server for Puppet. + +Installation: + +- Clone the editor-services repository: + https://github.com/puppetlabs/puppet-editor-services + +- Navigate into that directory and run: `bundle install` + +- Install the 'puppet-lint' gem: `gem install puppet-lint` + +- Add that repository to $PATH. + +- Ensure you can run `puppet-languageserver` from outside the editor-services directory. +]], + default_config = { + root_dir = [[root_pattern("manifests", ".puppet-lint.rc", "hiera.yaml", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/purescriptls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/purescriptls.lua new file mode 100644 index 000000000..495133d26 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/purescriptls.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +local bin_name = 'purescript-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'purescript' }, + root_dir = util.root_pattern('bower.json', 'psc-package.json', 'spago.dhall'), + }, + docs = { + description = [[ +https://github.com/nwolverson/purescript-language-server +`purescript-language-server` can be installed via `npm` +```sh +npm install -g purescript-language-server +``` +]], + default_config = { + root_dir = [[root_pattern("spago.dhall, 'psc-package.json', bower.json")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/pylsp.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/pylsp.lua new file mode 100644 index 000000000..7284fac49 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/pylsp.lua @@ -0,0 +1,31 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'pylsp' }, + filetypes = { 'python' }, + root_dir = function(fname) + local root_files = { + 'pyproject.toml', + 'setup.py', + 'setup.cfg', + 'requirements.txt', + 'Pipfile', + } + return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/python-lsp/python-lsp-server + +A Python 3.6+ implementation of the Language Server Protocol. + +The language server can be installed via `pipx install 'python-lsp-server[all]'`. +Further instructions can be found in the [project's README](https://github.com/python-lsp/python-lsp-server). + +Note: This is a community fork of `pyls`. + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/pyre.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/pyre.lua new file mode 100644 index 000000000..5c2f8fb73 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/pyre.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'pyre', 'persistent' }, + filetypes = { 'python' }, + root_dir = util.root_pattern '.pyre_configuration', + }, + docs = { + description = [[ +https://pyre-check.org/ + +`pyre` a static type checker for Python 3. + +`pyre` offers an extremely limited featureset. It currently only supports diagnostics, +which are triggered on save. + +Do not report issues for missing features in `pyre` to `lspconfig`. + +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/pyright.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/pyright.lua new file mode 100644 index 000000000..a198477f4 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/pyright.lua @@ -0,0 +1,56 @@ +local util = require 'lspconfig.util' + +local bin_name = 'pyright-langserver' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +local root_files = { + 'pyproject.toml', + 'setup.py', + 'setup.cfg', + 'requirements.txt', + 'Pipfile', + 'pyrightconfig.json', +} + +local function organize_imports() + local params = { + command = 'pyright.organizeimports', + arguments = { vim.uri_from_bufnr(0) }, + } + vim.lsp.buf.execute_command(params) +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'python' }, + root_dir = util.root_pattern(unpack(root_files)), + single_file_support = true, + settings = { + python = { + analysis = { + autoSearchPaths = true, + useLibraryCodeForTypes = true, + diagnosticMode = 'workspace', + }, + }, + }, + }, + commands = { + PyrightOrganizeImports = { + organize_imports, + description = 'Organize Imports', + }, + }, + docs = { + description = [[ +https://github.com/microsoft/pyright + +`pyright`, a static type checker and language server for python +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/quick_lint_js.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/quick_lint_js.lua new file mode 100644 index 000000000..29daa966e --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/quick_lint_js.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'quick-lint-js', '--lsp-server' }, + filetypes = { 'javascript' }, + root_dir = util.root_pattern('package.json', 'jsconfig.json', '.git'), + single_file_support = true, + }, + docs = { + description = [[ +https://quick-lint-js.com/ + +quick-lint-js finds bugs in JavaScript programs. + +See installation [instructions](https://quick-lint-js.com/install/) +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/r_language_server.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/r_language_server.lua new file mode 100644 index 000000000..7e1e3f38a --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/r_language_server.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'R', '--slave', '-e', 'languageserver::run()' }, + filetypes = { 'r', 'rmd' }, + root_dir = function(fname) + return util.find_git_ancestor(fname) or vim.loop.os_homedir() + end, + log_level = vim.lsp.protocol.MessageType.Warning, + }, + docs = { + description = [[ +[languageserver](https://github.com/REditorSupport/languageserver) is an +implementation of the Microsoft's Language Server Protocol for the R +language. + +It is released on CRAN and can be easily installed by + +```R +install.packages("languageserver") +``` +]], + default_config = { + root_dir = [[root_pattern(".git") or os_homedir]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/racket_langserver.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/racket_langserver.lua new file mode 100644 index 000000000..25bd0ab1f --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/racket_langserver.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'racket', '--lib', 'racket-langserver' }, + filetypes = { 'racket', 'scheme' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +[https://github.com/jeapostrophe/racket-langserver](https://github.com/jeapostrophe/racket-langserver) + +The Racket language server. This project seeks to use +[DrRacket](https://github.com/racket/drracket)'s public API to provide +functionality that mimics DrRacket's code tools as closely as possible. + +Install via `raco`: `raco pkg install racket-langserver` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/reason_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/reason_ls.lua new file mode 100644 index 000000000..45e7d0b50 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/reason_ls.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'reason-language-server' }, + filetypes = { 'reason' }, + root_dir = util.root_pattern('bsconfig.json', '.git'), + }, + docs = { + description = [[ +Reason language server + +**By default, reason_ls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. +You have to install the language server manually. + +You can install reason language server from [reason-language-server](https://github.com/jaredly/reason-language-server) repository. + +```lua +cmd = {''} +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/remark_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/remark_ls.lua new file mode 100644 index 000000000..4ef37177c --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/remark_ls.lua @@ -0,0 +1,50 @@ +local util = require 'lspconfig.util' + +local bin_name = 'remark-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'markdown' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/remarkjs/remark-language-server + +`remark-language-server` can be installed via `npm`: +```sh +npm install -g remark-language-server +``` + +`remark-language-server` uses the same +[configuration files](https://github.com/remarkjs/remark/tree/main/packages/remark-cli#example-config-files-json-yaml-js) +as `remark-cli`. + +This uses a plugin based system. Each plugin needs to be installed locally using `npm` or `yarn`. + +For example, given the following `.remarkrc.json`: + +```json +{ + "presets": [ + "remark-preset-lint-recommended" + ] +} +``` + +`remark-preset-lint-recommended` needs to be installed in the local project: + +```sh +npm install remark-preset-lint-recommended +``` + +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/rescriptls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/rescriptls.lua new file mode 100644 index 000000000..1c80ada14 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/rescriptls.lua @@ -0,0 +1,42 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = {}, + filetypes = { 'rescript' }, + root_dir = util.root_pattern('bsconfig.json', '.git'), + settings = {}, + }, + docs = { + description = [[ +https://github.com/rescript-lang/rescript-vscode + +ReScript language server + +**By default, rescriptls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. +You have to install the language server manually. + +You can use the bundled language server inside the [vim-rescript](https://github.com/rescript-lang/vim-rescript) repo. + +Clone the vim-rescript repo and point `cmd` to `server.js` inside `server/out` directory: + +```lua +cmd = {'node', '/server/out/server.js', '--stdio'} + +``` + +If you have vim-rescript installed you can also use that installation. for example if you're using packer.nvim you can set cmd to something like this: + +```lua +cmd = { + 'node', + '/home/username/.local/share/nvim/site/pack/packer/start/vim-rescript/server/out/server.js', + '--stdio' +} +``` + +Another option is to use vscode extension [release](https://github.com/rescript-lang/rescript-vscode/releases). +Take a look at [here](https://github.com/rescript-lang/rescript-vscode#use-with-other-editors) for instructions. +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/rls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/rls.lua new file mode 100644 index 000000000..363b81d2a --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/rls.lua @@ -0,0 +1,42 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'rls' }, + filetypes = { 'rust' }, + root_dir = util.root_pattern 'Cargo.toml', + }, + docs = { + description = [[ +https://github.com/rust-lang/rls + +rls, a language server for Rust + +See https://github.com/rust-lang/rls#setup to setup rls itself. +See https://github.com/rust-lang/rls#configuration for rls-specific settings. +All settings listed on the rls configuration section of the readme +must be set under settings.rust as follows: + +```lua +nvim_lsp.rls.setup { + settings = { + rust = { + unstable_features = true, + build_on_save = false, + all_features = true, + }, + }, +} +``` + +If you want to use rls for a particular build, eg nightly, set cmd as follows: + +```lua +cmd = {"rustup", "run", "nightly", "rls"} +``` + ]], + default_config = { + root_dir = [[root_pattern("Cargo.toml")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/rnix.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/rnix.lua new file mode 100644 index 000000000..aa7f00ed1 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/rnix.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'rnix-lsp' }, + filetypes = { 'nix' }, + root_dir = function(fname) + return util.find_git_ancestor(fname) or vim.loop.os_homedir() + end, + settings = {}, + init_options = {}, + }, + docs = { + description = [[ +https://github.com/nix-community/rnix-lsp + +A language server for Nix providing basic completion and formatting via nixpkgs-fmt. + +To install manually, run `cargo install rnix-lsp`. If you are using nix, rnix-lsp is in nixpkgs. + +This server accepts configuration via the `settings` key. + + ]], + default_config = { + root_dir = "vim's starting directory", + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/robotframework_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/robotframework_ls.lua new file mode 100644 index 000000000..7cb772b72 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/robotframework_ls.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'robotframework_ls' }, + filetypes = { 'robot' }, + root_dir = function(fname) + return util.root_pattern('robotidy.toml', 'pyproject.toml')(fname) or util.find_git_ancestor(fname) + end, + }, + docs = { + description = [[ +https://github.com/robocorp/robotframework-lsp + +Language Server Protocol implementation for Robot Framework. +]], + default_config = { + root_dir = "util.root_pattern('robotidy.toml', 'pyproject.toml')(fname) or util.find_git_ancestor(fname)", + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/rome.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/rome.lua new file mode 100644 index 000000000..075d31ac0 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/rome.lua @@ -0,0 +1,42 @@ +local util = require 'lspconfig.util' + +local bin_name = 'rome' +local cmd = { bin_name, 'lsp' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, 'lsp' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { + 'javascript', + 'javascriptreact', + 'json', + 'typescript', + 'typescript.tsx', + 'typescriptreact', + }, + root_dir = function(fname) + return util.find_package_json_ancestor(fname) + or util.find_node_modules_ancestor(fname) + or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://rome.tools + +Language server for the Rome Frontend Toolchain. + +```sh +npm install [-g] rome +``` +]], + default_config = { + root_dir = [[root_pattern('package.json', 'node_modules', '.git')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/rust_analyzer.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/rust_analyzer.lua new file mode 100644 index 000000000..6331cf513 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/rust_analyzer.lua @@ -0,0 +1,79 @@ +local util = require 'lspconfig.util' + +local function reload_workspace(bufnr) + bufnr = util.validate_bufnr(bufnr) + vim.lsp.buf_request(bufnr, 'rust-analyzer/reloadWorkspace', nil, function(err) + if err then + error(tostring(err)) + end + vim.notify 'Cargo workspace reloaded' + end) +end + +return { + default_config = { + cmd = { 'rust-analyzer' }, + filetypes = { 'rust' }, + root_dir = function(fname) + local cargo_crate_dir = util.root_pattern 'Cargo.toml'(fname) + local cmd = { 'cargo', 'metadata', '--no-deps', '--format-version', '1' } + if cargo_crate_dir ~= nil then + cmd[#cmd + 1] = '--manifest-path' + cmd[#cmd + 1] = util.path.join(cargo_crate_dir, 'Cargo.toml') + end + local cargo_metadata = '' + local cargo_metadata_err = '' + local cm = vim.fn.jobstart(cmd, { + on_stdout = function(_, d, _) + cargo_metadata = table.concat(d, '\n') + end, + on_stderr = function(_, d, _) + cargo_metadata_err = table.concat(d, '\n') + end, + stdout_buffered = true, + stderr_buffered = true, + }) + if cm > 0 then + cm = vim.fn.jobwait({ cm })[1] + else + cm = -1 + end + local cargo_workspace_dir = nil + if cm == 0 then + cargo_workspace_dir = vim.fn.json_decode(cargo_metadata)['workspace_root'] + else + vim.notify( + string.format('[lspconfig] cmd (%q) failed:\n%s', table.concat(cmd, ' '), cargo_metadata_err), + vim.log.levels.WARN + ) + end + return cargo_workspace_dir + or cargo_crate_dir + or util.root_pattern 'rust-project.json'(fname) + or util.find_git_ancestor(fname) + end, + settings = { + ['rust-analyzer'] = {}, + }, + }, + commands = { + CargoReload = { + function() + reload_workspace(0) + end, + description = 'Reload current cargo workspace', + }, + }, + docs = { + description = [[ +https://github.com/rust-analyzer/rust-analyzer + +rust-analyzer (aka rls 2.0), a language server for Rust + +See [docs](https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/user#settings) for extra settings. + ]], + default_config = { + root_dir = [[root_pattern("Cargo.toml", "rust-project.json")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/salt_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/salt_ls.lua new file mode 100644 index 000000000..65d1d3223 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/salt_ls.lua @@ -0,0 +1,24 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'salt_lsp_server' }, + filetypes = { 'sls' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +Language server for Salt configuration files. +https://github.com/dcermak/salt-lsp + +The language server can be installed with `pip`: +```sh +pip install salt-lsp +``` + ]], + default_config = { + root_dir = [[root_pattern('.git')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/scry.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/scry.lua new file mode 100644 index 000000000..8350a439b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/scry.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'scry' }, + filetypes = { 'crystal' }, + root_dir = function(fname) + return util.root_pattern 'shard.yml'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/crystal-lang-tools/scry + +Crystal language server. +]], + default_config = { + root_dir = [[root_pattern('shard.yml', '.git')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/serve_d.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/serve_d.lua new file mode 100644 index 000000000..09d1b108c --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/serve_d.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'serve-d' }, + filetypes = { 'd' }, + root_dir = util.root_pattern('dub.json', 'dub.sdl', '.git'), + }, + docs = { + description = [[ + https://github.com/Pure-D/serve-d + + `Microsoft language server protocol implementation for D using workspace-d.` + Download a binary from https://github.com/Pure-D/serve-d/releases and put it in your $PATH. + ]], + default_config = { + root_dir = [[util.root_pattern("dub.json", "dub.sdl", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/sixtyfps.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/sixtyfps.lua new file mode 100644 index 000000000..da90fe309 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/sixtyfps.lua @@ -0,0 +1,28 @@ +return { + default_config = { + cmd = { 'sixtyfps-lsp' }, + filetypes = { 'sixtyfps' }, + single_file_support = true, + }, + docs = { + description = [=[ +https://github.com/sixtyfpsui/sixtyfps +`SixtyFPS`'s language server + +You can build and install `sixtyfps-lsp` binary with `cargo`: +```sh +cargo install sixtyfps-lsp +``` + +Vim does not have built-in syntax for the `sixtyfps` filetype currently. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.60 set filetype=sixtyfps ]] +``` + +or by installing a filetype plugin such as https://github.com/RustemB/sixtyfps-vim +]=], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/slint_lsp.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/slint_lsp.lua new file mode 100644 index 000000000..e921cb68e --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/slint_lsp.lua @@ -0,0 +1,26 @@ +return { + default_config = { + cmd = { 'slint-lsp' }, + filetypes = { 'slint' }, + single_file_support = true, + }, + docs = { + description = [=[ +https://github.com/slint-ui/slint +`Slint`'s language server + +You can build and install `slint-lsp` binary with `cargo`: +```sh +cargo install slint-lsp +``` + +Vim does not have built-in syntax for the `slint` filetype at this time. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.slint set filetype=slint ]] +``` +]=], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/solang.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/solang.lua new file mode 100644 index 000000000..be1d1ecab --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/solang.lua @@ -0,0 +1,27 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'solang', '--language-server', '--target', 'ewasm' }, + filetypes = { 'solidity' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +A language server for Solidity + +See the [documentation](https://solang.readthedocs.io/en/latest/installing.html) for installation instructions. + +The language server only provides the following capabilities: +* Syntax highlighting +* Diagnostics +* Hover + +There is currently no support for completion, goto definition, references, or other functionality. + +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/solargraph.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/solargraph.lua new file mode 100644 index 000000000..4fba4009c --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/solargraph.lua @@ -0,0 +1,38 @@ +local util = require 'lspconfig.util' + +local bin_name = 'solargraph' +local cmd = { bin_name, 'stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, 'stdio' } +end + +return { + default_config = { + cmd = cmd, + settings = { + solargraph = { + diagnostics = true, + }, + }, + init_options = { formatting = true }, + filetypes = { 'ruby' }, + root_dir = util.root_pattern('Gemfile', '.git'), + }, + docs = { + description = [[ +https://solargraph.org/ + +solargraph, a language server for Ruby + +You can install solargraph via gem install. + +```sh +gem install --user-install solargraph +``` + ]], + default_config = { + root_dir = [[root_pattern("Gemfile", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/solc.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/solc.lua new file mode 100644 index 000000000..42e44fe3f --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/solc.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'solc', '--lsp' }, + filetypes = { 'solidity' }, + root_dir = util.root_pattern '.git', + }, + docs = { + description = [[ +https://docs.soliditylang.org/en/latest/installing-solidity.html + +solc is the native language server for the Solidity language. +]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/solidity_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/solidity_ls.lua new file mode 100644 index 000000000..4d4c4902d --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/solidity_ls.lua @@ -0,0 +1,24 @@ +local util = require 'lspconfig.util' + +local bin_name = 'solidity-language-server' +if vim.fn.has 'win32' == 1 then + bin_name = bin_name .. '.cmd' +end + +return { + default_config = { + cmd = { bin_name, '--stdio' }, + filetypes = { 'solidity' }, + root_dir = util.root_pattern('.git', 'package.json'), + }, + docs = { + description = [[ +npm install -g solidity-language-server + +solidity-language-server is a language server for the solidity language ported from the vscode solidity extension +]], + default_config = { + root_dir = [[root_pattern(".git", "package.json")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/sorbet.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/sorbet.lua new file mode 100644 index 000000000..86d344360 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/sorbet.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'srb', 'tc', '--lsp' }, + filetypes = { 'ruby' }, + root_dir = util.root_pattern('Gemfile', '.git'), + }, + docs = { + description = [[ +https://sorbet.org + +Sorbet is a fast, powerful type checker designed for Ruby. + +You can install Sorbet via gem install. You might also be interested in how to set +Sorbet up for new projects: https://sorbet.org/docs/adopting. + +```sh +gem install sorbet +``` + ]], + default_config = { + root_dir = [[root_pattern("Gemfile", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/sourcekit.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/sourcekit.lua new file mode 100644 index 000000000..d90b30aeb --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/sourcekit.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'sourcekit-lsp' }, + filetypes = { 'swift', 'c', 'cpp', 'objective-c', 'objective-cpp' }, + root_dir = util.root_pattern('Package.swift', '.git'), + }, + docs = { + description = [[ +https://github.com/apple/sourcekit-lsp + +Language server for Swift and C/C++/Objective-C. + ]], + default_config = { + root_dir = [[root_pattern("Package.swift", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/sourcery.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/sourcery.lua new file mode 100644 index 000000000..9100c5a5e --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/sourcery.lua @@ -0,0 +1,55 @@ +local util = require 'lspconfig/util' + +local root_files = { + 'pyproject.toml', + 'setup.py', + 'setup.cfg', + 'requirements.txt', + 'Pipfile', + 'pyrightconfig.json', +} + +return { + default_config = { + cmd = { 'sourcery', 'lsp' }, + filetypes = { 'python' }, + init_options = { + editor_version = 'vim', + extension_version = 'vim.lsp', + token = nil, + }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + on_new_config = function(new_config, _) + if not new_config.init_options.token then + local notify = vim.notify_once or vim.notify + notify('[lspconfig] The authentication token must be provided in config.init_options', vim.log.levels.ERROR) + end + end, + docs = { + description = [[ +https://github.com/sourcery-ai/sourcery + +Refactor Python instantly using the power of AI. + +It requires the initializationOptions param to be populated as shown below and will respond with the list of ServerCapabilities that it supports. + +init_options = { + --- The Sourcery token for authenticating the user. + --- This is retrieved from the Sourcery website and must be + --- provided by each user. The extension must provide a + --- configuration option for the user to provide this value. + token = + + --- The extension's name and version as defined by the extension. + extension_version = 'vim.lsp' + + --- The editor's name and version as defined by the editor. + editor_version = 'vim' +} +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/spectral.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/spectral.lua new file mode 100644 index 000000000..e21b6cb5b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/spectral.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +local bin_name = 'spectral-language-server' + +return { + default_config = { + cmd = { bin_name, '--stdio' }, + filetypes = { 'yaml', 'json', 'yml' }, + root_dir = util.root_pattern('.spectral.yaml', '.spectral.yml', '.spectral.json', '.spectral.js'), + single_file_support = true, + settings = { + enable = true, + run = 'onType', + validateLanguages = { 'yaml', 'json', 'yml' }, + }, + }, + docs = { + description = [[ +https://github.com/luizcorreia/spectral-language-server + `A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v2 & v3.` + +`spectral-language-server` can be installed via `npm`: +```sh +npm i -g spectral-language-server +``` +See [vscode-spectral](https://github.com/stoplightio/vscode-spectral#extension-settings) for configuration options. +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/sqlls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/sqlls.lua new file mode 100644 index 000000000..434a7ce8f --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/sqlls.lua @@ -0,0 +1,18 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'sql-language-server', 'up', '--method', 'stdio' }, + filetypes = { 'sql', 'mysql' }, + root_dir = util.root_pattern '.sqllsrc.json', + settings = {}, + }, + docs = { + description = [[ +https://github.com/joe-re/sql-language-server + +This LSP can be installed via `npm`. Find further instructions on manual installation of the sql-language-server at [joe-re/sql-language-server](https://github.com/joe-re/sql-language-server). +
+ ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/sqls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/sqls.lua new file mode 100644 index 000000000..268025392 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/sqls.lua @@ -0,0 +1,25 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'sqls' }, + filetypes = { 'sql', 'mysql' }, + root_dir = util.root_pattern 'config.yml', + single_file_support = true, + settings = {}, + }, + docs = { + description = [[ +https://github.com/lighttiger2505/sqls + +```lua +require'lspconfig'.sqls.setup{ + cmd = {"path/to/command", "-config", "path/to/config.yml"}; + ... +} +``` +Sqls can be installed via `go get github.com/lighttiger2505/sqls`. Instructions for compiling Sqls from the source can be found at [lighttiger2505/sqls](https://github.com/lighttiger2505/sqls). + + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/stylelint_lsp.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/stylelint_lsp.lua new file mode 100644 index 000000000..d471d2673 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/stylelint_lsp.lua @@ -0,0 +1,54 @@ +local util = require 'lspconfig.util' + +local bin_name = 'stylelint-lsp' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { + 'css', + 'less', + 'scss', + 'sugarss', + 'vue', + 'wxss', + 'javascript', + 'javascriptreact', + 'typescript', + 'typescriptreact', + }, + root_dir = util.root_pattern('.stylelintrc', 'package.json'), + settings = {}, + }, + docs = { + description = [[ +https://github.com/bmatcuk/stylelint-lsp + +`stylelint-lsp` can be installed via `npm`: + +```sh +npm i -g stylelint-lsp +``` + +Can be configured by passing a `settings.stylelintplus` object to `stylelint_lsp.setup`: + +```lua +require'lspconfig'.stylelint_lsp.setup{ + settings = { + stylelintplus = { + -- see available options in stylelint-lsp documentation + } + } +} +``` +]], + default_config = { + root_dir = [[ root_pattern('.stylelintrc', 'package.json') ]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/sumneko_lua.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/sumneko_lua.lua new file mode 100644 index 000000000..63380957d --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/sumneko_lua.lua @@ -0,0 +1,63 @@ +local util = require 'lspconfig.util' + +local root_files = { + '.luarc.json', + '.luacheckrc', + '.stylua.toml', + 'selene.toml', +} +return { + default_config = { + cmd = { 'lua-language-server' }, + filetypes = { 'lua' }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + log_level = vim.lsp.protocol.MessageType.Warning, + settings = { Lua = { telemetry = { enable = false } } }, + }, + docs = { + description = [[ +https://github.com/sumneko/lua-language-server + +Lua language server. + +`lua-language-server` can be installed by following the instructions [here](https://github.com/sumneko/lua-language-server/wiki/Build-and-Run). The default `cmd` assumes that the `lua-language-server` binary can be found in `$PATH`. + +```lua +local runtime_path = vim.split(package.path, ';') +table.insert(runtime_path, "lua/?.lua") +table.insert(runtime_path, "lua/?/init.lua") + +require'lspconfig'.sumneko_lua.setup { + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT', + -- Setup your lua path + path = runtime_path, + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = {'vim'}, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = vim.api.nvim_get_runtime_file("", true), + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + }, + }, +} +``` +]], + default_config = { + root_dir = [[root_pattern(".luarc.json", ".luacheckrc", ".stylua.toml", "selene.toml", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/svelte.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/svelte.lua new file mode 100644 index 000000000..14db19258 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/svelte.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +local bin_name = 'svelteserver' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'svelte' }, + root_dir = util.root_pattern('package.json', '.git'), + }, + docs = { + description = [[ +https://github.com/sveltejs/language-tools/tree/master/packages/language-server + +`svelte-language-server` can be installed via `npm`: +```sh +npm install -g svelte-language-server +``` +]], + default_config = { + root_dir = [[root_pattern("package.json", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/svls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/svls.lua new file mode 100644 index 000000000..ff4d8102e --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/svls.lua @@ -0,0 +1,24 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'svls' }, + filetypes = { 'verilog', 'systemverilog' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/dalance/svls + +Language server for verilog and SystemVerilog + +`svls` can be installed via `cargo`: + ```sh + cargo install svls + ``` + ]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/tailwindcss.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/tailwindcss.lua new file mode 100644 index 000000000..5a5abc0ca --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/tailwindcss.lua @@ -0,0 +1,126 @@ +local util = require 'lspconfig.util' + +local bin_name = 'tailwindcss-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + -- filetypes copied and adjusted from tailwindcss-intellisense + filetypes = { + -- html + 'aspnetcorerazor', + 'astro', + 'astro-markdown', + 'blade', + 'django-html', + 'htmldjango', + 'edge', + 'eelixir', -- vim ft + 'ejs', + 'erb', + 'eruby', -- vim ft + 'gohtml', + 'haml', + 'handlebars', + 'hbs', + 'html', + -- 'HTML (Eex)', + -- 'HTML (EEx)', + 'html-eex', + 'heex', + 'jade', + 'leaf', + 'liquid', + 'markdown', + 'mdx', + 'mustache', + 'njk', + 'nunjucks', + 'php', + 'razor', + 'slim', + 'twig', + -- css + 'css', + 'less', + 'postcss', + 'sass', + 'scss', + 'stylus', + 'sugarss', + -- js + 'javascript', + 'javascriptreact', + 'reason', + 'rescript', + 'typescript', + 'typescriptreact', + -- mixed + 'vue', + 'svelte', + }, + init_options = { + userLanguages = { + eelixir = 'html-eex', + eruby = 'erb', + }, + }, + settings = { + tailwindCSS = { + validate = true, + lint = { + cssConflict = 'warning', + invalidApply = 'error', + invalidScreen = 'error', + invalidVariant = 'error', + invalidConfigPath = 'error', + invalidTailwindDirective = 'error', + recommendedVariantOrder = 'warning', + }, + classAttributes = { + 'class', + 'className', + 'classList', + 'ngClass', + }, + }, + }, + on_new_config = function(new_config) + if not new_config.settings then + new_config.settings = {} + end + if not new_config.settings.editor then + new_config.settings.editor = {} + end + if not new_config.settings.editor.tabSize then + -- set tab size for hover + new_config.settings.editor.tabSize = vim.lsp.util.get_effective_tabstop() + end + end, + root_dir = function(fname) + return util.root_pattern('tailwind.config.js', 'tailwind.config.ts')(fname) + or util.root_pattern('postcss.config.js', 'postcss.config.ts')(fname) + or util.find_package_json_ancestor(fname) + or util.find_node_modules_ancestor(fname) + or util.find_git_ancestor(fname) + end, + }, + docs = { + description = [[ +https://github.com/tailwindlabs/tailwindcss-intellisense + +Tailwind CSS Language Server can be installed via npm: +```sh +npm install -g @tailwindcss/language-server +``` +]], + default_config = { + root_dir = [[root_pattern('tailwind.config.js', 'tailwind.config.ts', 'postcss.config.js', 'postcss.config.ts', 'package.json', 'node_modules', '.git')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/taplo.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/taplo.lua new file mode 100644 index 000000000..320ced9ef --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/taplo.lua @@ -0,0 +1,27 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'taplo', 'lsp', 'stdio' }, + filetypes = { 'toml' }, + root_dir = function(fname) + return util.root_pattern '*.toml'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://taplo.tamasfe.dev/lsp/ + +Language server for Taplo, a TOML toolkit. + +`taplo-cli` can be installed via `cargo`: +```sh +cargo install --locked taplo-cli +``` + ]], + default_config = { + root_dir = [[root_pattern("*.toml", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/teal_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/teal_ls.lua new file mode 100644 index 000000000..b554addab --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/teal_ls.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { + 'teal-language-server', + -- use this to enable logging in /tmp/teal-language-server.log + -- "logging=on", + }, + filetypes = { + 'teal', + -- "lua", -- Also works for lua, but you may get type errors that cannot be resolved within lua itself + }, + root_dir = util.root_pattern('tlconfig.lua', '.git'), + }, + docs = { + description = [[ +https://github.com/teal-language/teal-language-server + +Install with: +``` +luarocks install --dev teal-language-server +``` +]], + default_config = { + root_dir = [[root_pattern("tlconfig.lua", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/terraform_lsp.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/terraform_lsp.lua new file mode 100644 index 000000000..48a6fc587 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/terraform_lsp.lua @@ -0,0 +1,43 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'terraform-lsp' }, + filetypes = { 'terraform', 'hcl' }, + root_dir = util.root_pattern('.terraform', '.git'), + }, + docs = { + description = [[ +https://github.com/juliosueiras/terraform-lsp + +Terraform language server +Download a released binary from +https://github.com/juliosueiras/terraform-lsp/releases. + +From https://github.com/hashicorp/terraform-ls#terraform-ls-vs-terraform-lsp: + +Both HashiCorp and the maintainer of terraform-lsp expressed interest in +collaborating on a language server and are working towards a _long-term_ +goal of a single stable and feature-complete implementation. + +For the time being both projects continue to exist, giving users the +choice: + +- `terraform-ls` providing + - overall stability (by relying only on public APIs) + - compatibility with any provider and any Terraform >=0.12.0 currently + less features + - due to project being younger and relying on public APIs which may + not offer the same functionality yet + +- `terraform-lsp` providing + - currently more features + - compatibility with a single particular Terraform (0.12.20 at time of writing) + - configs designed for other 0.12 versions may work, but interpretation may be inaccurate + - less stability (due to reliance on Terraform's own internal packages) +]], + default_config = { + root_dir = [[root_pattern(".terraform", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/terraformls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/terraformls.lua new file mode 100644 index 000000000..3eb4a1c8b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/terraformls.lua @@ -0,0 +1,42 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'terraform-ls', 'serve' }, + filetypes = { 'terraform' }, + root_dir = util.root_pattern('.terraform', '.git'), + }, + docs = { + description = [[ +https://github.com/hashicorp/terraform-ls + +Terraform language server +Download a released binary from https://github.com/hashicorp/terraform-ls/releases. + +From https://github.com/hashicorp/terraform-ls#terraform-ls-vs-terraform-lsp: + +Both HashiCorp and the maintainer of terraform-lsp expressed interest in +collaborating on a language server and are working towards a _long-term_ +goal of a single stable and feature-complete implementation. + +For the time being both projects continue to exist, giving users the +choice: + +- `terraform-ls` providing + - overall stability (by relying only on public APIs) + - compatibility with any provider and any Terraform >=0.12.0 currently + less features + - due to project being younger and relying on public APIs which may + not offer the same functionality yet + +- `terraform-lsp` providing + - currently more features + - compatibility with a single particular Terraform (0.12.20 at time of writing) + - configs designed for other 0.12 versions may work, but interpretation may be inaccurate + - less stability (due to reliance on Terraform's own internal packages) +]], + default_config = { + root_dir = [[root_pattern(".terraform", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/texlab.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/texlab.lua new file mode 100644 index 000000000..88bfa20ca --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/texlab.lua @@ -0,0 +1,126 @@ +local util = require 'lspconfig.util' + +local texlab_build_status = vim.tbl_add_reverse_lookup { + Success = 0, + Error = 1, + Failure = 2, + Cancelled = 3, +} + +local texlab_forward_status = vim.tbl_add_reverse_lookup { + Success = 0, + Error = 1, + Failure = 2, + Unconfigured = 3, +} + +local function buf_build(bufnr) + bufnr = util.validate_bufnr(bufnr) + local texlab_client = util.get_active_client_by_name(bufnr, 'texlab') + local params = { + textDocument = { uri = vim.uri_from_bufnr(bufnr) }, + } + if texlab_client then + texlab_client.request('textDocument/build', params, function(err, result) + if err then + error(tostring(err)) + end + print('Build ' .. texlab_build_status[result.status]) + end, bufnr) + else + print 'method textDocument/build is not supported by any servers active on the current buffer' + end +end + +local function buf_search(bufnr) + bufnr = util.validate_bufnr(bufnr) + local texlab_client = util.get_active_client_by_name(bufnr, 'texlab') + local params = { + textDocument = { uri = vim.uri_from_bufnr(bufnr) }, + position = { line = vim.fn.line '.' - 1, character = vim.fn.col '.' }, + } + if texlab_client then + texlab_client.request('textDocument/forwardSearch', params, function(err, result) + if err then + error(tostring(err)) + end + print('Search ' .. texlab_forward_status[result.status]) + end, bufnr) + else + print 'method textDocument/forwardSearch is not supported by any servers active on the current buffer' + end +end + +-- bufnr isn't actually required here, but we need a valid buffer in order to +-- be able to find the client for buf_request. +-- TODO find a client by looking through buffers for a valid client? +-- local function build_cancel_all(bufnr) +-- bufnr = util.validate_bufnr(bufnr) +-- local params = { token = "texlab-build-*" } +-- lsp.buf_request(bufnr, 'window/progress/cancel', params, function(err, method, result, client_id) +-- if err then error(tostring(err)) end +-- print("Cancel result", vim.inspect(result)) +-- end) +-- end + +return { + default_config = { + cmd = { 'texlab' }, + filetypes = { 'tex', 'bib' }, + root_dir = function(fname) + return util.root_pattern '.latexmkrc'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + settings = { + texlab = { + rootDirectory = nil, + build = { + executable = 'latexmk', + args = { '-pdf', '-interaction=nonstopmode', '-synctex=1', '%f' }, + onSave = false, + forwardSearchAfter = false, + }, + auxDirectory = '.', + forwardSearch = { + executable = nil, + args = {}, + }, + chktex = { + onOpenAndSave = false, + onEdit = false, + }, + diagnosticsDelay = 300, + latexFormatter = 'latexindent', + latexindent = { + ['local'] = nil, -- local is a reserved keyword + modifyLineBreaks = false, + }, + bibtexFormatter = 'texlab', + formatterLineLength = 80, + }, + }, + }, + commands = { + TexlabBuild = { + function() + buf_build(0) + end, + description = 'Build the current buffer', + }, + TexlabForward = { + function() + buf_search(0) + end, + description = 'Forward search from current position', + }, + }, + docs = { + description = [[ +https://github.com/latex-lsp/texlab + +A completion engine built from scratch for (La)TeX. + +See https://github.com/latex-lsp/texlab/blob/master/docs/options.md for configuration options. +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/tflint.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/tflint.lua new file mode 100644 index 000000000..de2a1d8ce --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/tflint.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'tflint', '--langserver' }, + filetypes = { 'terraform' }, + root_dir = util.root_pattern('.terraform', '.git', '.tflint.hcl'), + }, + docs = { + description = [[ +https://github.com/terraform-linters/tflint + +A pluggable Terraform linter that can act as lsp server. +Installation instructions can be found in https://github.com/terraform-linters/tflint#installation. +]], + default_config = { + root_dir = [[root_pattern(".terraform", ".git", ".tflint.hcl")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/theme_check.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/theme_check.lua new file mode 100644 index 000000000..94d677408 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/theme_check.lua @@ -0,0 +1,31 @@ +local util = require 'lspconfig.util' + +local bin_name = 'theme-check-language-server' + +return { + default_config = { + cmd = { bin_name, '--stdio' }, + filetypes = { 'liquid' }, + root_dir = util.root_pattern '.theme-check.yml', + settings = {}, + }, + docs = { + description = [[ +https://github.com/Shopify/shopify-cli + +`theme-check-language-server` is bundled with `shopify-cli` or it can also be installed via + +https://github.com/Shopify/theme-check#installation + +**NOTE:** +If installed via Homebrew, `cmd` must be set to 'theme-check-liquid-server' + +```lua +require lspconfig.theme_check.setup { + cmd = { 'theme-check-liquid-server' } +} +``` + +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/tsserver.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/tsserver.lua new file mode 100644 index 000000000..0f916fefc --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/tsserver.lua @@ -0,0 +1,60 @@ +local util = require 'lspconfig.util' + +local bin_name = 'typescript-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + init_options = { hostInfo = 'neovim' }, + cmd = cmd, + filetypes = { + 'javascript', + 'javascriptreact', + 'javascript.jsx', + 'typescript', + 'typescriptreact', + 'typescript.tsx', + }, + root_dir = function(fname) + return util.root_pattern 'tsconfig.json'(fname) + or util.root_pattern('package.json', 'jsconfig.json', '.git')(fname) + end, + }, + docs = { + description = [[ +https://github.com/theia-ide/typescript-language-server + +`typescript-language-server` depends on `typescript`. Both packages can be installed via `npm`: +```sh +npm install -g typescript typescript-language-server +``` + +To configure type language server, add a +[`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or +[`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to the root of your +project. + +Here's an example that disables type checking in JavaScript files. + +```json +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "checkJs": false + }, + "exclude": [ + "node_modules" + ] +} +``` +]], + default_config = { + root_dir = [[root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/typeprof.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/typeprof.lua new file mode 100644 index 000000000..ab9dc8ef9 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/typeprof.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'typeprof', '--lsp', '--stdio' }, + filetypes = { 'ruby', 'eruby' }, + root_dir = util.root_pattern('Gemfile', '.git'), + }, + docs = { + description = [[ +https://github.com/ruby/typeprof + +`typeprof` is the built-in analysis and LSP tool for Ruby 3.1+. + ]], + default_config = { + root_dir = [[root_pattern("Gemfile", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/vala_ls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/vala_ls.lua new file mode 100644 index 000000000..842c561d4 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/vala_ls.lua @@ -0,0 +1,40 @@ +local util = require 'lspconfig.util' + +local meson_matcher = function(path) + local pattern = 'meson.build' + local f = vim.fn.glob(util.path.join(path, pattern)) + if f == '' then + return nil + end + for line in io.lines(f) do + -- skip meson comments + if not line:match '^%s*#.*' then + local str = line:gsub('%s+', '') + if str ~= '' then + if str:match '^project%(' then + return path + else + break + end + end + end + end +end + +return { + default_config = { + cmd = { 'vala-language-server' }, + filetypes = { 'vala', 'genie' }, + root_dir = function(fname) + local root = util.search_ancestors(fname, meson_matcher) + return root or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = 'https://github.com/Prince781/vala-language-server', + default_config = { + root_dir = [[root_pattern("meson.build", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/vdmj.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/vdmj.lua new file mode 100644 index 000000000..9699b9360 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/vdmj.lua @@ -0,0 +1,128 @@ +local util = require 'lspconfig.util' + +local mavenrepo = util.path.join(vim.env.HOME, '.m2', 'repository', 'com', 'fujitsu') + +local function get_jar_path(config, package, version) + return util.path.join(config.options.mavenrepo, package, version, package .. '-' .. version .. '.jar') +end + +local function with_precision(version, is_high_precision) + return is_high_precision and version:gsub('([%d.]+)', '%1-P') or version +end + +local function get_latest_installed_version(repo) + local path = util.path.join(repo, 'lsp') + local sort = vim.fn.sort + + local subdirs = function(file) + local stat = vim.loop.fs_stat(util.path.join(path, file)) + return stat.type == 'directory' and 1 or 0 + end + + local candidates = vim.fn.readdir(path, subdirs) + local sorted = sort(sort(candidates, 'l'), 'N') + return sorted[#sorted] +end + +-- Special case, as vdmj store particular settings under root_dir/.vscode +local function find_vscode_ancestor(startpath) + return util.search_ancestors(startpath, function(path) + if util.path.is_dir(util.path.join(path, '.vscode')) then + return path + end + end) +end + +return { + default_config = { + cmd = { 'java' }, + filetypes = { 'vdmsl', 'vdmpp', 'vdmrt' }, + root_dir = function(fname) + return util.find_git_ancestor(fname) or find_vscode_ancestor(fname) + end, + options = { + java = vim.env.JAVA_HOME and util.path.join(vim.env.JAVA_HOME, 'bin', 'java') or 'java', + java_opts = { '-Xmx3000m', '-Xss1m' }, + annotation_paths = {}, + mavenrepo = mavenrepo, + version = get_latest_installed_version(mavenrepo), + logfile = util.path.join(vim.fn.stdpath 'cache', 'vdm-lsp.log'), + debugger_port = -1, + high_precision = false, + }, + }, + docs = { + description = [[ +https://github.com/nickbattle/vdmj + +The VDMJ language server can be installed by cloning the VDMJ repository and +running `mvn clean install`. + +Various options are provided to configure the language server (see below). In +particular: +- `annotation_paths` is a list of folders and/or jar file paths for annotations +that should be used with the language server; +- any value of `debugger_port` less than zero will disable the debugger; note +that if a non-zero value is used, only one instance of the server can be active +at a time. + +More settings for VDMJ can be changed in a file called `vdmj.properties` under +`root_dir/.vscode`. For a description of the available settings, see +[Section 7 of the VDMJ User Guide](https://raw.githubusercontent.com/nickbattle/vdmj/master/vdmj/documentation/UserGuide.pdf). + +Note: proof obligations and combinatorial testing are not currently supported +by neovim. +]], + default_config = { + cmd = 'Generated from the options given', + root_dir = 'util.find_git_ancestor(fname) or find_vscode_ancestor(fname)', + options = { + java = '$JAVA_HOME/bin/java', + java_opts = { '-Xmx3000m', '-Xss1m' }, + annotation_paths = {}, + mavenrepo = '$HOME/.m2/repository/com/fujitsu', + version = 'The latest version installed in `mavenrepo`', + logfile = "path.join(vim.fn.stdpath 'cache', 'vdm-lsp.log')", + debugger_port = -1, + high_precision = false, + }, + }, + }, + on_new_config = function(config, root_dir) + local version = with_precision( + config.options.version or get_latest_installed_version(config.options.mavenrepo), + config.options.high_precision + ) + + local classpath = table.concat({ + get_jar_path(config, 'vdmj', version), + get_jar_path(config, 'annotations', version), + get_jar_path(config, 'lsp', version), + util.path.join(root_dir, '.vscode'), + unpack(config.options.annotation_paths), + }, ':') + + local java_cmd = { + config.options.java, + config.options.java_opts, + '-Dlsp.log.filename=' .. config.options.logfile, + '-cp', + classpath, + } + + local dap = {} + + if config.options.debugger_port >= 0 then + -- TODO: LS will fail to start if port is already in use + dap = { '-dap', tostring(config.options.debugger_port) } + end + + local vdmj_cmd = { + 'lsp.LSPServerStdio', + '-' .. vim.bo.filetype, + dap, + } + + config.cmd = vim.tbl_flatten { java_cmd, vdmj_cmd } + end, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/verible.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/verible.lua new file mode 100644 index 000000000..3c4823a87 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/verible.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'verible-verilog-ls' }, + filetypes = { 'systemverilog', 'verilog' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/chipsalliance/verible + +A linter and formatter for verilog and SystemVerilog files. + +Release binaries can be downloaded from [here](https://github.com/chipsalliance/verible/releases) +and placed in a directory on PATH. + +See https://github.com/chipsalliance/verible/tree/master/verilog/tools/ls/README.md for options. + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/vimls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/vimls.lua new file mode 100644 index 000000000..4f0d1d93b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/vimls.lua @@ -0,0 +1,41 @@ +local util = require 'lspconfig.util' + +local bin_name = 'vim-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'vim' }, + root_dir = function(fname) + return util.find_git_ancestor(fname) or vim.fn.getcwd() + end, + init_options = { + iskeyword = '@,48-57,_,192-255,-#', + vimruntime = '', + runtimepath = '', + diagnostic = { enable = true }, + indexes = { + runtimepath = true, + gap = 100, + count = 3, + projectRootPatterns = { 'runtime', 'nvim', '.git', 'autoload', 'plugin' }, + }, + suggest = { fromVimruntime = true, fromRuntimepath = true }, + }, + }, + docs = { + description = [[ +https://github.com/iamcco/vim-language-server + +You can install vim-language-server via npm: +```sh +npm install -g vim-language-server +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/vls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/vls.lua new file mode 100644 index 000000000..36255c047 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/vls.lua @@ -0,0 +1,32 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'vlang' }, + root_dir = util.root_pattern('v.mod', '.git'), + }, + docs = { + description = [[ +https://github.com/vlang/vls + +V language server. + +`v-language-server` can be installed by following the instructions [here](https://github.com/vlang/vls#installation). + +**By default, v-language-server doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of your unzipped and compiled v-language-server. + +```lua +-- set the path to the vls installation; +local vls_root_path = vim.fn.stdpath('cache')..'/lspconfig/vls' +local vls_binary = vls_root_path.."/cmd/vls/vls" + +require'lspconfig'.vls.setup { + cmd = {vls_binary}, +} +``` +]], + default_config = { + root_dir = [[root_pattern("v.mod", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/volar.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/volar.lua new file mode 100644 index 000000000..77427576a --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/volar.lua @@ -0,0 +1,138 @@ +local util = require 'lspconfig.util' + +local function get_typescript_server_path(root_dir) + local project_root = util.find_node_modules_ancestor(root_dir) + return project_root and (util.path.join(project_root, 'node_modules', 'typescript', 'lib', 'tsserverlibrary.js')) + or '' +end + +-- https://github.com/johnsoncodehk/volar/blob/master/packages/shared/src/types.ts +local volar_init_options = { + typescript = { + serverPath = '', + }, + languageFeatures = { + implementation = true, + -- not supported - https://github.com/neovim/neovim/pull/14122 + semanticTokens = false, + references = true, + definition = true, + typeDefinition = true, + callHierarchy = true, + hover = true, + rename = true, + renameFileRefactoring = true, + signatureHelp = true, + codeAction = true, + completion = { + defaultTagNameCase = 'both', + defaultAttrNameCase = 'kebabCase', + }, + schemaRequestService = true, + documentHighlight = true, + documentLink = true, + codeLens = true, + diagnostics = true, + }, + documentFeatures = { + -- not supported - https://github.com/neovim/neovim/pull/13654 + documentColor = false, + selectionRange = true, + foldingRange = true, + linkedEditingRange = true, + documentSymbol = true, + documentFormatting = { + defaultPrintWidth = 100, + }, + }, +} + +local bin_name = 'vue-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end +return { + default_config = { + cmd = cmd, + filetypes = { 'vue' }, + root_dir = util.root_pattern 'package.json', + init_options = volar_init_options, + on_new_config = function(new_config, new_root_dir) + if + new_config.init_options + and new_config.init_options.typescript + and new_config.init_options.typescript.serverPath == '' + then + new_config.init_options.typescript.serverPath = get_typescript_server_path(new_root_dir) + end + end, + }, + docs = { + description = [[ +https://github.com/johnsoncodehk/volar/tree/master/packages/vue-language-server + +Volar language server for Vue + +Volar can be installed via npm: + +```sh +npm install -g @volar/vue-language-server +``` + +Volar by default supports Vue 3 projects. Vue 2 projects need [additional configuration](https://github.com/johnsoncodehk/volar/blob/master/extensions/vscode-vue-language-features/README.md?plain=1#L28-L63). + +**Take Over Mode** +Volar can serve as a language server for both Vue and TypeScript via [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471). + +To enable Take Over Mode, override the default filetypes in `setup{}` as follows: + +```lua +require'lspconfig'.volar.setup{ + filetypes = {'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue', 'json'} +} +``` + +**Overriding the default TypeScript Server used by Volar** +The default config looks for TS in the local node_modules. The alternatives are: + +- use a global TypeScript Server installation + +```lua +require'lspconfig'.volar.setup{ + init_options = { + typescript = { + serverPath = '/path/to/.npm/lib/node_modules/typescript/lib/tsserverlib.js' + } + } +} +``` + +- use a global TypeScript Server installation if a local server is not found + +```lua +local util = require 'lspconfig.util' + +local function get_typescript_server_path(root_dir) + local project_root = util.find_node_modules_ancestor(root_dir) + + local local_tsserverlib = project_root ~= nil and util.path.join(project_root, 'node_modules', 'typescript', 'lib', 'tsserverlibrary.js') + local global_tsserverlib = '/home/[yourusernamehere]/.npm/lib/node_modules/typescript/lib/tsserverlibrary.js' + + if local_tsserverlib and util.path.exists(local_tsserverlib) then + return local_tsserverlib + else + return global_tsserverlib + end +end + +require'lspconfig'.volar.setup{ + on_new_config = function(new_config, new_root_dir) + new_config.init_options.typescript.serverPath = get_typescript_server_path(new_root_dir) + end, +} +``` + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/vuels.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/vuels.lua new file mode 100644 index 000000000..d3d2d92e6 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/vuels.lua @@ -0,0 +1,68 @@ +local util = require 'lspconfig.util' + +local bin_name = 'vls' +local cmd = { bin_name } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'vue' }, + root_dir = util.root_pattern('package.json', 'vue.config.js'), + init_options = { + config = { + vetur = { + useWorkspaceDependencies = false, + validation = { + template = true, + style = true, + script = true, + }, + completion = { + autoImport = false, + useScaffoldSnippets = false, + tagCasing = 'kebab', + }, + format = { + defaultFormatter = { + js = 'none', + ts = 'none', + }, + defaultFormatterOptions = {}, + scriptInitialIndent = false, + styleInitialIndent = false, + }, + }, + css = {}, + html = { + suggest = {}, + }, + javascript = { + format = {}, + }, + typescript = { + format = {}, + }, + emmet = {}, + stylusSupremacy = {}, + }, + }, + }, + docs = { + description = [[ +https://github.com/vuejs/vetur/tree/master/server + +Vue language server(vls) +`vue-language-server` can be installed via `npm`: +```sh +npm install -g vls +``` +]], + default_config = { + root_dir = [[root_pattern("package.json", "vue.config.js")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/yamlls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/yamlls.lua new file mode 100644 index 000000000..52d8e6f6d --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/yamlls.lua @@ -0,0 +1,87 @@ +local util = require 'lspconfig.util' + +local bin_name = 'yaml-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'yaml', 'yaml.docker-compose' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + settings = { + -- https://github.com/redhat-developer/vscode-redhat-telemetry#how-to-disable-telemetry-reporting + redhat = { telemetry = { enabled = false } }, + }, + }, + docs = { + description = [[ +https://github.com/redhat-developer/yaml-language-server + +`yaml-language-server` can be installed via `yarn`: +```sh +yarn global add yaml-language-server +``` + +To use a schema for validation, there are two options: + +1. Add a modeline to the file. A modeline is a comment of the form: + +``` +# yaml-language-server: $schema= +``` + +where the relative filepath is the path relative to the open yaml file, and the absolute filepath +is the filepath relative to the filesystem root ('/' on unix systems) + +2. Associated a schema url, relative , or absolute (to root of project, not to filesystem root) path to +the a glob pattern relative to the detected project root. Check `:LspInfo` to determine the resolved project +root. + +```lua +require('lspconfig').yamlls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + ... -- other settings. note this overrides the lspconfig defaults. + schemas = { + ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*" + ["../path/relative/to/file.yml"] = "/.github/workflows/*" + ["/path/from/root/of/project"] = "/.github/workflows/*" + }, + }, + } +} +``` + +Currently, kubernetes is special-cased in yammls, see the following upstream issues: +* [#211](https://github.com/redhat-developer/yaml-language-server/issues/211). +* [#307](https://github.com/redhat-developer/yaml-language-server/issues/307). + +To override a schema to use a specific k8s schema version (for example, to use 1.18): + +```lua +require('lspconfig').yamlls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + ... -- other settings. note this overrides the lspconfig defaults. + schemas = { + ["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.18.0-standalone-strict/all.json"] = "/*.k8s.yaml", + ... -- other schemas + }, + }, + } +} +``` + +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/zeta_note.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/zeta_note.lua new file mode 100644 index 000000000..9798af9d2 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/zeta_note.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'markdown' }, + root_dir = util.root_pattern '.zeta.toml', + }, + docs = { + description = [[ +https://github.com/artempyanykh/zeta-note + +Markdown LSP server for easy note-taking with cross-references and diagnostics. + +Binaries can be downloaded from https://github.com/artempyanykh/zeta-note/releases + +**By default, zeta-note doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of your zeta-note binary. + +```lua +require'lspconfig'.zeta_note.setup{ + cmd = {'path/to/zeta-note'} +} +``` +]], + default_config = { + root_dir = [[root_pattern(".zeta.toml")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/zk.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/zk.lua new file mode 100644 index 000000000..c2890451f --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/zk.lua @@ -0,0 +1,48 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'zk', 'lsp' }, + filetypes = { 'markdown' }, + root_dir = util.root_pattern '.zk', + }, + commands = { + ZkIndex = { + function() + vim.lsp.buf.execute_command { + command = 'zk.index', + arguments = { vim.api.nvim_buf_get_name(0) }, + } + end, + description = 'Index', + }, + ZkNew = { + function(...) + vim.lsp.buf_request(0, 'workspace/executeCommand', { + command = 'zk.new', + arguments = { + vim.api.nvim_buf_get_name(0), + ..., + }, + }, function(_, result, _, _) + if not (result and result.path) then + return + end + vim.cmd('edit ' .. result.path) + end) + end, + + description = 'ZkNew', + }, + }, + docs = { + description = [[ +github.com/mickael-menu/zk + +A plain text note-taking assistant +]], + default_config = { + root_dir = [[root_pattern(".zk")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/zls.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/zls.lua new file mode 100644 index 000000000..d890fb63a --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/server_configurations/zls.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'zls' }, + filetypes = { 'zig', 'zir' }, + root_dir = util.root_pattern('zls.json', '.git'), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/zigtools/zls + +Zig LSP implementation + Zig Language Server + ]], + default_config = { + root_dir = [[util.root_pattern("zls.json", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/ui/lspinfo.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/ui/lspinfo.lua new file mode 100644 index 000000000..42a7feda2 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/ui/lspinfo.lua @@ -0,0 +1,225 @@ +local configs = require 'lspconfig.configs' +local windows = require 'lspconfig.ui.windows' +local util = require 'lspconfig.util' + +local error_messages = { + cmd_not_found = 'Unable to find executable. Please check your path and ensure the server is installed', + no_filetype_defined = 'No filetypes defined, Please define filetypes in setup()', +} + +local function trim_blankspace(cmd) + local trimmed_cmd = {} + for _, str in pairs(cmd) do + table.insert(trimmed_cmd, str:match '^%s*(.*)') + end + return trimmed_cmd +end + +local function indent_lines(lines, offset) + return vim.tbl_map(function(val) + return offset .. val + end, lines) +end + +local function remove_newlines(cmd) + cmd = trim_blankspace(cmd) + cmd = table.concat(cmd, ' ') + cmd = vim.split(cmd, '\n') + cmd = trim_blankspace(cmd) + cmd = table.concat(cmd, ' ') + return cmd +end + +local function make_config_info(config) + local config_info = {} + config_info.name = config.name + if config.cmd then + config_info.cmd = remove_newlines(config.cmd) + if vim.fn.executable(config.cmd[1]) == 1 then + config_info.cmd_is_executable = 'true' + else + config_info.cmd_is_executable = error_messages.cmd_not_found + end + else + config_info.cmd = 'cmd not defined' + config_info.cmd_is_executable = 'NA' + end + + local buffer_dir = vim.fn.expand '%:p:h' + config_info.root_dir = config.get_root_dir(buffer_dir) or 'NA' + config_info.autostart = (config.autostart and 'true') or 'false' + config_info.handlers = table.concat(vim.tbl_keys(config.handlers), ', ') + config_info.filetypes = table.concat(config.filetypes or {}, ', ') + + local lines = { + 'Config: ' .. config_info.name, + } + + local info_lines = { + 'filetypes: ' .. config_info.filetypes, + 'root directory: ' .. config_info.root_dir, + 'cmd: ' .. config_info.cmd, + 'cmd is executable: ' .. config_info.cmd_is_executable, + 'autostart: ' .. config_info.autostart, + 'custom handlers: ' .. config_info.handlers, + } + + vim.list_extend(lines, indent_lines(info_lines, '\t')) + + return lines +end + +local function make_client_info(client) + local client_info = {} + + client_info.cmd = remove_newlines(client.config.cmd) + if client.workspaceFolders then + client_info.root_dir = client.workspaceFolders[1].name + else + client_info.root_dir = 'Running in single file mode.' + end + client_info.filetypes = table.concat(client.config.filetypes or {}, ', ') + client_info.autostart = (client.config.autostart and 'true') or 'false' + client_info.attached_buffers_list = table.concat(vim.lsp.get_buffers_by_client_id(client.id), ', ') + + local lines = { + '', + 'Client: ' + .. client.name + .. ' (id: ' + .. tostring(client.id) + .. ', pid: ' + .. tostring(client.rpc.pid) + .. ', bufnr: [' + .. client_info.attached_buffers_list + .. '])', + } + + local info_lines = { + 'filetypes: ' .. client_info.filetypes, + 'autostart: ' .. client_info.autostart, + 'root directory: ' .. client_info.root_dir, + 'cmd: ' .. client_info.cmd, + } + + if client.config.lspinfo then + local server_specific_info = client.config.lspinfo(client.config) + info_lines = vim.list_extend(info_lines, server_specific_info) + end + + vim.list_extend(lines, indent_lines(info_lines, '\t')) + + return lines +end + +return function() + -- These options need to be cached before switching to the floating + -- buffer. + local buf_clients = vim.lsp.buf_get_clients() + local clients = vim.lsp.get_active_clients() + local buffer_filetype = vim.bo.filetype + + local win_info = windows.percentage_range_window(0.8, 0.7) + local bufnr, win_id = win_info.bufnr, win_info.win_id + + local buf_lines = {} + + local buf_client_names = {} + for _, client in pairs(buf_clients) do + table.insert(buf_client_names, client.name) + end + + local buf_client_ids = {} + for _, client in pairs(buf_clients) do + table.insert(buf_client_ids, client.id) + end + + local other_active_clients = {} + local client_names = {} + for _, client in pairs(clients) do + if not vim.tbl_contains(buf_client_ids, client.id) then + table.insert(other_active_clients, client) + end + table.insert(client_names, client.name) + end + + local header = { + '', + 'Language client log: ' .. (vim.lsp.get_log_path()), + 'Detected filetype: ' .. buffer_filetype, + } + vim.list_extend(buf_lines, header) + + local buffer_clients_header = { + '', + tostring(#vim.tbl_keys(buf_clients)) .. ' client(s) attached to this buffer: ', + } + + vim.list_extend(buf_lines, buffer_clients_header) + for _, client in pairs(buf_clients) do + local client_info = make_client_info(client) + vim.list_extend(buf_lines, client_info) + end + + local other_active_section_header = { + '', + tostring(#other_active_clients) .. ' active client(s) not attached to this buffer: ', + } + if not vim.tbl_isempty(other_active_clients) then + vim.list_extend(buf_lines, other_active_section_header) + end + for _, client in pairs(other_active_clients) do + local client_info = make_client_info(client) + vim.list_extend(buf_lines, client_info) + end + + local other_matching_configs_header = { + '', + 'Other clients that match the filetype: ' .. buffer_filetype, + '', + } + + local other_matching_configs = util.get_other_matching_providers(buffer_filetype) + + if not vim.tbl_isempty(other_matching_configs) then + vim.list_extend(buf_lines, other_matching_configs_header) + for _, config in pairs(other_matching_configs) do + vim.list_extend(buf_lines, make_config_info(config)) + end + end + + local matching_config_header = { + '', + 'Configured servers list: ' .. table.concat(vim.tbl_keys(configs), ', '), + } + vim.list_extend(buf_lines, matching_config_header) + + local fmt_buf_lines = indent_lines(buf_lines, ' ') + + fmt_buf_lines = vim.lsp.util._trim(fmt_buf_lines, {}) + + vim.api.nvim_buf_set_lines(bufnr, 0, -1, true, fmt_buf_lines) + vim.api.nvim_buf_set_option(bufnr, 'modifiable', false) + vim.api.nvim_buf_set_option(bufnr, 'filetype', 'lspinfo') + + vim.api.nvim_buf_set_keymap(bufnr, 'n', '', 'bd', { noremap = true }) + vim.api.nvim_command( + string.format('autocmd BufHidden,BufLeave ++once lua pcall(vim.api.nvim_win_close, %d, true)', win_id) + ) + + vim.fn.matchadd( + 'Error', + error_messages.no_filetype_defined .. '.\\|' .. 'cmd not defined\\|' .. error_messages.cmd_not_found + ) + vim.cmd 'let m=matchadd("string", "true")' + vim.cmd 'let m=matchadd("error", "false")' + for _, config in pairs(configs) do + vim.fn.matchadd('Title', '\\%(Client\\|Config\\):.*\\zs' .. config.name .. '\\ze') + vim.fn.matchadd('Visual', 'list:.*\\zs' .. config.name .. '\\ze') + if config.filetypes then + for _, ft in pairs(config.filetypes) do + vim.fn.matchadd('Type', '\\%(filetypes\\|filetype\\):.*\\zs' .. ft .. '\\ze') + end + end + end +end diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/ui/windows.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/ui/windows.lua new file mode 100644 index 000000000..8a39204d5 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/ui/windows.lua @@ -0,0 +1,117 @@ +-- The following is extracted and modified from plenary.vnim by +-- TJ Devries. It is not a stable API, and is expected to change +-- +local function apply_defaults(original, defaults) + if original == nil then + original = {} + end + + original = vim.deepcopy(original) + + for k, v in pairs(defaults) do + if original[k] == nil then + original[k] = v + end + end + + return original +end + +local win_float = {} + +win_float.default_options = { + winblend = 15, + percentage = 0.9, +} + +function win_float.default_opts(options) + options = apply_defaults(options, win_float.default_options) + + local width = math.floor(vim.o.columns * options.percentage) + local height = math.floor(vim.o.lines * options.percentage) + + local top = math.floor(((vim.o.lines - height) / 2) - 1) + local left = math.floor((vim.o.columns - width) / 2) + + local opts = { + relative = 'editor', + row = top, + col = left, + width = width, + height = height, + style = 'minimal', + border = { + { ' ', 'NormalFloat' }, + { ' ', 'NormalFloat' }, + { ' ', 'NormalFloat' }, + { ' ', 'NormalFloat' }, + { ' ', 'NormalFloat' }, + { ' ', 'NormalFloat' }, + { ' ', 'NormalFloat' }, + { ' ', 'NormalFloat' }, + }, + } + + return opts +end + +--- Create window that takes up certain percentags of the current screen. +--- +--- Works regardless of current buffers, tabs, splits, etc. +--@param col_range number | Table: +-- If number, then center the window taking up this percentage of the screen. +-- If table, first index should be start, second_index should be end +--@param row_range number | Table: +-- If number, then center the window taking up this percentage of the screen. +-- If table, first index should be start, second_index should be end +function win_float.percentage_range_window(col_range, row_range, options) + options = apply_defaults(options, win_float.default_options) + + local win_opts = win_float.default_opts(options) + win_opts.relative = 'editor' + + local height_percentage, row_start_percentage + if type(row_range) == 'number' then + assert(row_range <= 1) + assert(row_range > 0) + height_percentage = row_range + row_start_percentage = (1 - height_percentage) / 2 + elseif type(row_range) == 'table' then + height_percentage = row_range[2] - row_range[1] + row_start_percentage = row_range[1] + else + error(string.format("Invalid type for 'row_range': %p", row_range)) + end + + win_opts.height = math.ceil(vim.o.lines * height_percentage) + win_opts.row = math.ceil(vim.o.lines * row_start_percentage) + + local width_percentage, col_start_percentage + if type(col_range) == 'number' then + assert(col_range <= 1) + assert(col_range > 0) + width_percentage = col_range + col_start_percentage = (1 - width_percentage) / 2 + elseif type(col_range) == 'table' then + width_percentage = col_range[2] - col_range[1] + col_start_percentage = col_range[1] + else + error(string.format("Invalid type for 'col_range': %p", col_range)) + end + + win_opts.col = math.floor(vim.o.columns * col_start_percentage) + win_opts.width = math.floor(vim.o.columns * width_percentage) + + local bufnr = options.bufnr or vim.api.nvim_create_buf(false, true) + local win_id = vim.api.nvim_open_win(bufnr, true, win_opts) + vim.api.nvim_win_set_buf(win_id, bufnr) + + vim.cmd 'setlocal nocursorcolumn ts=2 sw=2' + + return { + bufnr = bufnr, + win_id = win_id, + } +end + +return win_float diff --git a/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/util.lua b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/util.lua new file mode 100644 index 000000000..3febafc0b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/lua/lspconfig/util.lua @@ -0,0 +1,426 @@ +local vim = vim +local validate = vim.validate +local api = vim.api +local lsp = vim.lsp +local uv = vim.loop +local fn = vim.fn + +local M = {} + +M.default_config = { + log_level = lsp.protocol.MessageType.Warning, + message_level = lsp.protocol.MessageType.Warning, + settings = vim.empty_dict(), + init_options = vim.empty_dict(), + handlers = {}, + autostart = true, +} + +-- global on_setup hook +M.on_setup = nil + +function M.bufname_valid(bufname) + if bufname and bufname ~= '' and (bufname:match '^([a-zA-Z]:).*' or bufname:match '^/') then + return true + else + return false + end +end + +function M.validate_bufnr(bufnr) + validate { + bufnr = { bufnr, 'n' }, + } + return bufnr == 0 and api.nvim_get_current_buf() or bufnr +end + +function M.add_hook_before(func, new_fn) + if func then + return function(...) + -- TODO which result? + new_fn(...) + return func(...) + end + else + return new_fn + end +end + +function M.add_hook_after(func, new_fn) + if func then + return function(...) + -- TODO which result? + func(...) + return new_fn(...) + end + else + return new_fn + end +end + +function M.create_module_commands(module_name, commands) + for command_name, def in pairs(commands) do + local parts = { 'command!' } + -- Insert attributes. + for k, v in pairs(def) do + if type(k) == 'string' and type(v) == 'boolean' and v then + table.insert(parts, '-' .. k) + elseif type(k) == 'number' and type(v) == 'string' and v:match '^%-' then + table.insert(parts, v) + end + end + table.insert(parts, command_name) + -- The command definition. + table.insert( + parts, + string.format("lua require'lspconfig'[%q].commands[%q][1]()", module_name, command_name) + ) + api.nvim_command(table.concat(parts, ' ')) + end +end + +function M.has_bins(...) + for i = 1, select('#', ...) do + if 0 == fn.executable((select(i, ...))) then + return false + end + end + return true +end + +M.script_path = function() + local str = debug.getinfo(2, 'S').source:sub(2) + return str:match '(.*[/\\])' +end + +-- Some path utilities +M.path = (function() + local is_windows = uv.os_uname().version:match 'Windows' + + local function sanitize(path) + if is_windows then + path = path:sub(1, 1):upper() .. path:sub(2) + path = path:gsub('\\', '/') + end + return path + end + + local function exists(filename) + local stat = uv.fs_stat(filename) + return stat and stat.type or false + end + + local function is_dir(filename) + return exists(filename) == 'directory' + end + + local function is_file(filename) + return exists(filename) == 'file' + end + + local function is_fs_root(path) + if is_windows then + return path:match '^%a:$' + else + return path == '/' + end + end + + local function is_absolute(filename) + if is_windows then + return filename:match '^%a:' or filename:match '^\\\\' + else + return filename:match '^/' + end + end + + local function dirname(path) + local strip_dir_pat = '/([^/]+)$' + local strip_sep_pat = '/$' + if not path or #path == 0 then + return + end + local result = path:gsub(strip_sep_pat, ''):gsub(strip_dir_pat, '') + if #result == 0 then + if is_windows then + return path:sub(1, 2):upper() + else + return '/' + end + end + return result + end + + local function path_join(...) + return table.concat(vim.tbl_flatten { ... }, '/') + end + + -- Traverse the path calling cb along the way. + local function traverse_parents(path, cb) + path = uv.fs_realpath(path) + local dir = path + -- Just in case our algo is buggy, don't infinite loop. + for _ = 1, 100 do + dir = dirname(dir) + if not dir then + return + end + -- If we can't ascend further, then stop looking. + if cb(dir, path) then + return dir, path + end + if is_fs_root(dir) then + break + end + end + end + + -- Iterate the path until we find the rootdir. + local function iterate_parents(path) + local function it(_, v) + if v and not is_fs_root(v) then + v = dirname(v) + else + return + end + if v and uv.fs_realpath(v) then + return v, path + else + return + end + end + return it, path, path + end + + local function is_descendant(root, path) + if not path then + return false + end + + local function cb(dir, _) + return dir == root + end + + local dir, _ = traverse_parents(path, cb) + + return dir == root + end + + return { + is_dir = is_dir, + is_file = is_file, + is_absolute = is_absolute, + exists = exists, + dirname = dirname, + join = path_join, + sanitize = sanitize, + traverse_parents = traverse_parents, + iterate_parents = iterate_parents, + is_descendant = is_descendant, + } +end)() + +-- Returns a function(root_dir), which, when called with a root_dir it hasn't +-- seen before, will call make_config(root_dir) and start a new client. +function M.server_per_root_dir_manager(make_config) + local clients = {} + local single_file_clients = {} + local manager = {} + + function manager.add(root_dir, single_file) + local client_id + -- This is technically unnecessary, as lspconfig's path utilities should be hermetic, + -- however users are free to return strings in custom root resolvers. + root_dir = M.path.sanitize(root_dir) + if single_file then + client_id = single_file_clients[root_dir] + elseif root_dir and M.path.is_dir(root_dir) then + client_id = clients[root_dir] + else + return + end + + -- Check if we have a client already or start and store it. + if not client_id then + local new_config = make_config(root_dir) + -- do nothing if the client is not enabled + if new_config.enabled == false then + return + end + if not new_config.cmd then + vim.notify( + string.format( + '[lspconfig] cmd not defined for %q. Manually set cmd in the setup {} call according to server_configurations.md, see :help lspconfig-index.', + new_config.name + ), + vim.log.levels.ERROR + ) + return + end + new_config.on_exit = M.add_hook_before(new_config.on_exit, function() + clients[root_dir] = nil + single_file_clients[root_dir] = nil + end) + + -- Launch the server in the root directory used internally by lspconfig, if otherwise unset + -- also check that the path exist + if not new_config.cmd_cwd and uv.fs_realpath(root_dir) then + new_config.cmd_cwd = root_dir + end + + -- Sending rootDirectory and workspaceFolders as null is not explicitly + -- codified in the spec. Certain servers crash if initialized with a NULL + -- root directory. + if single_file then + new_config.root_dir = nil + new_config.workspace_folders = nil + end + client_id = lsp.start_client(new_config) + + -- Handle failures in start_client + if not client_id then + return + end + + if single_file then + single_file_clients[root_dir] = client_id + else + clients[root_dir] = client_id + end + end + return client_id + end + + function manager.clients() + local res = {} + for _, id in pairs(clients) do + local client = lsp.get_client_by_id(id) + if client then + table.insert(res, client) + end + end + return res + end + + return manager +end + +function M.search_ancestors(startpath, func) + validate { func = { func, 'f' } } + if func(startpath) then + return startpath + end + local guard = 100 + for path in M.path.iterate_parents(startpath) do + -- Prevent infinite recursion if our algorithm breaks + guard = guard - 1 + if guard == 0 then + return + end + + if func(path) then + return path + end + end +end + +function M.root_pattern(...) + local patterns = vim.tbl_flatten { ... } + local function matcher(path) + for _, pattern in ipairs(patterns) do + for _, p in ipairs(vim.fn.glob(M.path.join(path, pattern), true, true)) do + if M.path.exists(p) then + return path + end + end + end + end + return function(startpath) + return M.search_ancestors(startpath, matcher) + end +end +function M.find_git_ancestor(startpath) + return M.search_ancestors(startpath, function(path) + -- Support git directories and git files (worktrees) + if M.path.is_dir(M.path.join(path, '.git')) or M.path.is_file(M.path.join(path, '.git')) then + return path + end + end) +end +function M.find_node_modules_ancestor(startpath) + return M.search_ancestors(startpath, function(path) + if M.path.is_dir(M.path.join(path, 'node_modules')) then + return path + end + end) +end +function M.find_package_json_ancestor(startpath) + return M.search_ancestors(startpath, function(path) + if M.path.is_file(M.path.join(path, 'package.json')) then + return path + end + end) +end + +function M.get_active_clients_list_by_ft(filetype) + local clients = vim.lsp.get_active_clients() + local clients_list = {} + for _, client in pairs(clients) do + local filetypes = client.config.filetypes or {} + for _, ft in pairs(filetypes) do + if ft == filetype then + table.insert(clients_list, client.name) + end + end + end + return clients_list +end + +function M.get_other_matching_providers(filetype) + local configs = require 'lspconfig.configs' + local active_clients_list = M.get_active_clients_list_by_ft(filetype) + local other_matching_configs = {} + for _, config in pairs(configs) do + if not vim.tbl_contains(active_clients_list, config.name) then + local filetypes = config.filetypes or {} + for _, ft in pairs(filetypes) do + if ft == filetype then + table.insert(other_matching_configs, config) + end + end + end + end + return other_matching_configs +end + +function M.get_clients_from_cmd_args(arg) + local result = {} + for id in (arg or ''):gmatch '(%d+)' do + result[id] = vim.lsp.get_client_by_id(tonumber(id)) + end + if vim.tbl_isempty(result) then + return M.get_managed_clients() + end + return vim.tbl_values(result) +end + +function M.get_active_client_by_name(bufnr, servername) + for _, client in pairs(vim.lsp.buf_get_clients(bufnr)) do + if client.name == servername then + return client + end + end +end + +function M.get_managed_clients() + local configs = require 'lspconfig.configs' + local clients = {} + for _, config in pairs(configs) do + if config.manager then + vim.list_extend(clients, config.manager.clients()) + end + end + return clients +end + +return M diff --git a/bundle/nvim-lspconfig-0.1.3/neovim.toml b/bundle/nvim-lspconfig-0.1.3/neovim.toml new file mode 100644 index 000000000..26ba92206 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/neovim.toml @@ -0,0 +1,31 @@ +[selene] +base = "lua51" +name = "neovim" + +[vim] +any = true + +[[assert.args]] +type = "bool" + +[[assert.args]] +type = "string" +required = false + +[[after_each.args]] +type = "function" + +[[before_each.args]] +type = "function" + +[[describe.args]] +type = "string" + +[[describe.args]] +type = "function" + +[[it.args]] +type = "string" + +[[it.args]] +type = "function" diff --git a/bundle/nvim-lspconfig-0.1.3/plugin/lspconfig.vim b/bundle/nvim-lspconfig-0.1.3/plugin/lspconfig.vim new file mode 100644 index 000000000..5c52d4e19 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/plugin/lspconfig.vim @@ -0,0 +1,16 @@ +if exists('g:lspconfig') + finish +endif +let g:lspconfig = 1 + +lua << EOF +lsp_complete_configured_servers = function() + return table.concat(require'lspconfig'.available_servers(), '\n') +end +lsp_get_active_client_ids = function() + return vim.tbl_map(function(client) + return ("%d (%s)"):format(client.id, client.name) + end, require'lspconfig.util'.get_managed_clients()) +end +require'lspconfig'._root._setup() +EOF diff --git a/bundle/nvim-lspconfig-0.1.3/scripts/README_template.md b/bundle/nvim-lspconfig-0.1.3/scripts/README_template.md new file mode 100644 index 000000000..3a9baeaab --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/scripts/README_template.md @@ -0,0 +1,11 @@ +# Configurations + + +The following LSP configs are included. This documentation is autogenerated from the lua files. Follow a link to find documentation for +that config. This file is accessible in neovim via `:help lspconfig-server-configurations` + +{{implemented_servers_list}} + +{{lsp_server_details}} + +vim:ft=markdown diff --git a/bundle/nvim-lspconfig-0.1.3/scripts/docgen.lua b/bundle/nvim-lspconfig-0.1.3/scripts/docgen.lua new file mode 100644 index 000000000..375c5bd47 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/scripts/docgen.lua @@ -0,0 +1,272 @@ +require 'lspconfig' +local configs = require 'lspconfig.configs' +local util = require 'lspconfig.util' +local inspect = vim.inspect +local uv = vim.loop +local fn = vim.fn +local tbl_flatten = vim.tbl_flatten + +local function template(s, params) + return (s:gsub('{{([^{}]+)}}', params)) +end + +local function map_list(t, func) + local res = {} + for i, v in ipairs(t) do + local x = func(v, i) + if x ~= nil then + table.insert(res, x) + end + end + return res +end + +local function indent(n, s) + local prefix + if type(n) == 'number' then + if n <= 0 then + return s + end + prefix = string.rep(' ', n) + else + assert(type(n) == 'string', 'n must be number or string') + prefix = n + end + local lines = vim.split(s, '\n', true) + for i, line in ipairs(lines) do + lines[i] = prefix .. line + end + return table.concat(lines, '\n') +end + +local function make_parts(fns) + return tbl_flatten(map_list(fns, function(v) + if type(v) == 'function' then + v = v() + end + return { v } + end)) +end + +local function make_section(indentlvl, sep, parts) + return indent(indentlvl, table.concat(make_parts(parts), sep)) +end + +local function readfile(path) + assert(util.path.is_file(path)) + return io.open(path):read '*a' +end + +local function sorted_map_table(t, func) + local keys = vim.tbl_keys(t) + table.sort(keys) + return map_list(keys, function(k) + return func(k, t[k]) + end) +end + +local lsp_section_template = [[ +## {{template_name}} + +{{preamble}} + +**Snippet to enable the language server:** +```lua +require'lspconfig'.{{template_name}}.setup{} +``` +{{commands}} + +**Default values:** +{{default_values}} + +]] + +local function require_all_configs() + -- Configs are lazy-loaded, tickle them to populate the `configs` singleton. + for _, v in ipairs(vim.fn.glob('lua/lspconfig/server_configurations/*.lua', 1, 1)) do + local module_name = v:gsub('.*/', ''):gsub('%.lua$', '') + configs[module_name] = require('lspconfig.server_configurations.' .. module_name) + end +end + +local function make_lsp_sections() + return make_section( + 0, + '\n', + sorted_map_table(configs, function(template_name, template_object) + local template_def = template_object.document_config + local docs = template_def.docs + + local params = { + template_name = template_name, + preamble = '', + commands = '', + default_values = '', + } + + params.commands = make_section(0, '\n\n', { + function() + if not template_def.commands or #vim.tbl_keys(template_def.commands) == 0 then + return + end + return '**Commands:**\n' + .. make_section(0, '\n', { + sorted_map_table(template_def.commands, function(name, def) + if def.description then + return string.format('- %s: %s', name, def.description) + end + return string.format('- %s', name) + end), + }) + end, + }) + + params.default_values = make_section(2, '\n\n', { + function() + if not template_def.default_config then + return + end + return make_section(0, '\n', { + sorted_map_table(template_def.default_config, function(k, v) + local description = ((docs or {}).default_config or {})[k] + if description and type(description) ~= 'string' then + description = inspect(description) + elseif not description and type(v) == 'function' then + description = 'see source file' + end + return string.format('- `%s` : \n```lua\n%s\n```', k, description or inspect(v)) + end), + }) + end, + }) + + if docs then + local tempdir = os.getenv 'DOCGEN_TEMPDIR' or uv.fs_mkdtemp '/tmp/nvim-lsp.XXXXXX' + local preamble_parts = make_parts { + function() + if docs.description and #docs.description > 0 then + return docs.description + end + end, + function() + local package_json_name = util.path.join(tempdir, template_name .. '.package.json') + if docs.package_json then + if not util.path.is_file(package_json_name) then + os.execute(string.format('curl -v -L -o %q %q', package_json_name, docs.package_json)) + end + if not util.path.is_file(package_json_name) then + print(string.format('Failed to download package.json for %q at %q', template_name, docs.package_json)) + os.exit(1) + return + end + local data = fn.json_decode(readfile(package_json_name)) + -- The entire autogenerated section. + return make_section(0, '\n', { + -- The default settings section + function() + local default_settings = (data.contributes or {}).configuration + if not default_settings.properties then + return + end + -- The outer section. + return make_section(0, '\n', { + 'This server accepts configuration via the `settings` key.', + '
Available settings:', + '', + -- The list of properties. + make_section( + 0, + '\n\n', + sorted_map_table(default_settings.properties, function(k, v) + local function tick(s) + return string.format('`%s`', s) + end + local function bold(s) + return string.format('**%s**', s) + end + + -- https://github.github.com/gfm/#backslash-escapes + local function excape_markdown_punctuations(str) + local pattern = + '\\(\\*\\|\\.\\|?\\|!\\|"\\|#\\|\\$\\|%\\|\'\\|(\\|)\\|,\\|-\\|\\/\\|:\\|;\\|<\\|=\\|>\\|@\\|\\[\\|\\\\\\|\\]\\|\\^\\|_\\|`\\|{\\|\\\\|\\|}\\)' + return fn.substitute(str, pattern, '\\\\\\0', 'g') + end + + -- local function pre(s) return string.format("
%s
", s) end + -- local function code(s) return string.format("%s", s) end + if not (type(v) == 'table') then + return + end + return make_section(0, '\n', { + '- ' .. make_section(0, ': ', { + bold(tick(k)), + function() + if v.enum then + return tick('enum ' .. inspect(v.enum)) + end + if v.type then + return tick(table.concat(tbl_flatten { v.type }, '|')) + end + end, + }), + '', + make_section(2, '\n\n', { + { v.default and 'Default: ' .. tick(inspect(v.default, { newline = '', indent = '' })) }, + { v.items and 'Array items: ' .. tick(inspect(v.items, { newline = '', indent = '' })) }, + { excape_markdown_punctuations(v.description) }, + }), + }) + end) + ), + '', + '
', + }) + end, + }) + end + end, + } + if not os.getenv 'DOCGEN_TEMPDIR' then + os.execute('rm -rf ' .. tempdir) + end + -- Insert a newline after the preamble if it exists. + if #preamble_parts > 0 then + table.insert(preamble_parts, '') + end + params.preamble = table.concat(preamble_parts, '\n') + end + + return template(lsp_section_template, params) + end) + ) +end + +local function make_implemented_servers_list() + return make_section( + 0, + '\n', + sorted_map_table(configs, function(k) + return template('- [{{server}}](#{{server}})', { server = k }) + end) + ) +end + +local function generate_readme(template_file, params) + vim.validate { + lsp_server_details = { params.lsp_server_details, 's' }, + implemented_servers_list = { params.implemented_servers_list, 's' }, + } + local input_template = readfile(template_file) + local readme_data = template(input_template, params) + + local writer = io.open('doc/server_configurations.md', 'w') + writer:write(readme_data) + writer:close() + uv.fs_copyfile('doc/server_configurations.md', 'doc/server_configurations.txt') +end + +require_all_configs() +generate_readme('scripts/README_template.md', { + implemented_servers_list = make_implemented_servers_list(), + lsp_server_details = make_lsp_sections(), +}) diff --git a/bundle/nvim-lspconfig-0.1.3/scripts/docgen.sh b/bundle/nvim-lspconfig-0.1.3/scripts/docgen.sh new file mode 100644 index 000000000..288465430 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/scripts/docgen.sh @@ -0,0 +1,2 @@ +#!/bin/sh +exec nvim -u NONE -E -R --headless +'set rtp+=$PWD' +'luafile scripts/docgen.lua' +q diff --git a/bundle/nvim-lspconfig-0.1.3/scripts/run_test.sh b/bundle/nvim-lspconfig-0.1.3/scripts/run_test.sh new file mode 100644 index 000000000..7221ef80f --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/scripts/run_test.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +PJ_ROOT=$(pwd) + +if [ ! -d ./neovim ]; then + git clone --depth 1 https://github.com/neovim/neovim +fi + +cd ./neovim + +make functionaltest \ + BUSTED_ARGS="--lpath=$PJ_ROOT/?.lua --lpath=$PJ_ROOT/lua/?.lua --lpath=$PJ_ROOT/lua/lspconfig/?.lua" \ + TEST_FILE="../test/lspconfig_spec.lua" diff --git a/bundle/nvim-lspconfig-0.1.3/selene.toml b/bundle/nvim-lspconfig-0.1.3/selene.toml new file mode 100644 index 000000000..c85e792c2 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/selene.toml @@ -0,0 +1,5 @@ +std = "neovim" + +[rules] +global_usage = "allow" +multiple_statements = "allow" diff --git a/bundle/nvim-lspconfig-0.1.3/test/lspconfig_spec.lua b/bundle/nvim-lspconfig-0.1.3/test/lspconfig_spec.lua new file mode 100644 index 000000000..cef8aa46d --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/test/lspconfig_spec.lua @@ -0,0 +1,194 @@ +local helpers = require 'test.functional.helpers'(after_each) +local clear = helpers.clear +local exec_lua = helpers.exec_lua +local eq = helpers.eq +local ok = helpers.ok + +before_each(function() + clear() + -- add plugin module path to package.path in Lua runtime in Nvim + exec_lua( + [[ + package.path = ... + ]], + package.path + ) +end) + +describe('lspconfig', function() + describe('util', function() + describe('path', function() + describe('exists', function() + it('is present directory', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + local cwd = vim.fn.getcwd() + return not (lspconfig.util.path.exists(cwd) == false) + ]]) + end) + + it('is not present directory', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + local not_exist_dir = vim.fn.getcwd().."/not/exsts" + return lspconfig.util.path.exists(not_exist_dir) == false + ]]) + end) + + it('is present file', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + -- change the working directory to test directory + vim.api.nvim_command("cd ../test/test_dir/") + local file = vim.fn.getcwd().."/root_marker.txt" + + return not (lspconfig.util.path.exists(file) == false) + ]]) + end) + + it('is not present file', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + -- change the working directory to test directory + vim.api.nvim_command("cd ../test/test_dir/") + local file = vim.fn.getcwd().."/not_exists.txt" + + return lspconfig.util.path.exists(file) == false + ]]) + end) + end) + + describe('is_dir', function() + it('is directory', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + local cwd = vim.fn.getcwd() + return lspconfig.util.path.is_dir(cwd) + ]]) + end) + + it('is not present directory', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + local not_exist_dir = vim.fn.getcwd().."/not/exsts" + return not lspconfig.util.path.is_dir(not_exist_dir) + ]]) + end) + + it('is file', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + -- change the working directory to test directory + vim.api.nvim_command("cd ../test/test_dir/") + local file = vim.fn.getcwd().."/root_marker.txt" + + return not lspconfig.util.path.is_dir(file) + ]]) + end) + end) + + describe('is_file', function() + it('is file', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + -- change the working directory to test directory + vim.api.nvim_command("cd ../test/test_dir/") + local file = vim.fn.getcwd().."/root_marker.txt" + + return lspconfig.util.path.is_file(file) + ]]) + end) + + it('is not present file', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + -- change the working directory to test directory + vim.api.nvim_command("cd ../test/test_dir/") + local file = vim.fn.getcwd().."/not_exists.txt" + + return not lspconfig.util.path.is_file(file) + ]]) + end) + + it('is directory', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + local cwd = vim.fn.getcwd() + return not lspconfig.util.path.is_file(cwd) + ]]) + end) + end) + + describe('is_absolute', function() + it('is absolute', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + return not (lspconfig.util.path.is_absolute("/foo/bar") == nil) + ]]) + end) + + it('is not absolute', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + return lspconfig.util.path.is_absolute("foo/bar") == nil + ]]) + + ok(exec_lua [[ + local lspconfig = require("lspconfig") + return lspconfig.util.path.is_absolute("../foo/bar") == nil + ]]) + end) + end) + + describe('join', function() + it('', function() + eq( + exec_lua [[ + local lspconfig = require("lspconfig") + return lspconfig.util.path.join("foo", "bar", "baz") + ]], + 'foo/bar/baz' + ) + end) + end) + end) + + describe('root_pattern', function() + it('resolves to a_marker.txt', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + -- change the working directory to test directory + vim.api.nvim_command("cd ../test/test_dir/a") + local cwd = vim.fn.getcwd() + return cwd == lspconfig.util.root_pattern({"root_marker.txt", "a_marker.txt"})(cwd) + ]]) + end) + + it('resolves to root_marker.txt', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + -- change the working directory to test directory + vim.api.nvim_command("cd ../test/test_dir/a") + + local cwd = vim.fn.getcwd() + local resolved = lspconfig.util.root_pattern({"root_marker.txt"})(cwd) + vim.api.nvim_command("cd ..") + + return vim.fn.getcwd() == resolved + ]]) + end) + end) + end) +end) diff --git a/bundle/nvim-lspconfig-0.1.3/test/minimal_init.lua b/bundle/nvim-lspconfig-0.1.3/test/minimal_init.lua new file mode 100644 index 000000000..6b579ee24 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.3/test/minimal_init.lua @@ -0,0 +1,95 @@ +local on_windows = vim.loop.os_uname().version:match 'Windows' + +local function join_paths(...) + local path_sep = on_windows and '\\' or '/' + local result = table.concat({ ... }, path_sep) + return result +end + +vim.cmd [[set runtimepath=$VIMRUNTIME]] + +local temp_dir = vim.loop.os_getenv 'TEMP' or '/tmp' + +vim.cmd('set packpath=' .. join_paths(temp_dir, 'nvim', 'site')) + +local package_root = join_paths(temp_dir, 'nvim', 'site', 'pack') +local install_path = join_paths(package_root, 'packer', 'start', 'packer.nvim') +local compile_path = join_paths(install_path, 'plugin', 'packer_compiled.lua') + +local function load_plugins() + require('packer').startup { + { + 'wbthomason/packer.nvim', + 'neovim/nvim-lspconfig', + }, + config = { + package_root = package_root, + compile_path = compile_path, + }, + } +end + +_G.load_config = function() + vim.lsp.set_log_level 'trace' + if vim.fn.has 'nvim-0.5.1' == 1 then + require('vim.lsp.log').set_format_func(vim.inspect) + end + local nvim_lsp = require 'lspconfig' + local on_attach = function(_, bufnr) + local function buf_set_keymap(...) + vim.api.nvim_buf_set_keymap(bufnr, ...) + end + local function buf_set_option(...) + vim.api.nvim_buf_set_option(bufnr, ...) + end + + buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') + + -- Mappings. + local opts = { noremap = true, silent = true } + buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) + buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) + buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) + buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) + buf_set_keymap('n', '', 'lua vim.lsp.buf.signature_help()', opts) + buf_set_keymap('n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) + buf_set_keymap('n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) + buf_set_keymap('n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) + buf_set_keymap('n', 'D', 'lua vim.lsp.buf.type_definition()', opts) + buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) + buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) + buf_set_keymap('n', 'e', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) + buf_set_keymap('n', '[d', 'lua vim.lsp.diagnostic.goto_prev()', opts) + buf_set_keymap('n', ']d', 'lua vim.lsp.diagnostic.goto_next()', opts) + buf_set_keymap('n', 'q', 'lua vim.lsp.diagnostic.set_loclist()', opts) + end + + -- Add the server that troubles you here + local name = 'pyright' + local cmd = { 'pyright-langserver', '--stdio' } -- needed for elixirls, omnisharp, sumneko_lua + if not name then + print 'You have not defined a server name, please edit minimal_init.lua' + end + if not nvim_lsp[name].document_config.default_config.cmd and not cmd then + print [[You have not defined a server default cmd for a server + that requires it please edit minimal_init.lua]] + end + + nvim_lsp[name].setup { + cmd = cmd, + on_attach = on_attach, + } + + print [[You can find your log at $HOME/.cache/nvim/lsp.log. Please paste in a github issue under a details tag as described in the issue template.]] +end + +if vim.fn.isdirectory(install_path) == 0 then + vim.fn.system { 'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path } + load_plugins() + require('packer').sync() + vim.cmd [[autocmd User PackerComplete ++once lua load_config()]] +else + load_plugins() + require('packer').sync() + _G.load_config() +end diff --git a/bundle/nvim-lspconfig-0.1.3/test/test_dir/a/a_marker.txt b/bundle/nvim-lspconfig-0.1.3/test/test_dir/a/a_marker.txt new file mode 100644 index 000000000..e69de29bb diff --git a/bundle/nvim-lspconfig-0.1.3/test/test_dir/root_marker.txt b/bundle/nvim-lspconfig-0.1.3/test/test_dir/root_marker.txt new file mode 100644 index 000000000..e69de29bb diff --git a/bundle/nvim-lspconfig-0.1.4/.codespellignorewords b/bundle/nvim-lspconfig-0.1.4/.codespellignorewords new file mode 100644 index 000000000..266689282 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/.codespellignorewords @@ -0,0 +1,3 @@ +als +edn +esy diff --git a/bundle/nvim-lspconfig-0.1.4/.editorconfig b/bundle/nvim-lspconfig-0.1.4/.editorconfig new file mode 100644 index 000000000..489c20c0b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/.editorconfig @@ -0,0 +1,17 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +tab_width = 8 +end_of_line = lf +insert_final_newline = true +charset = utf-8 + +[*.lua] +indent_style = space +indent_size = 2 + +[{Makefile,**/Makefile,runtime/doc/*.txt}] +indent_style = tab +indent_size = 8 diff --git a/bundle/nvim-lspconfig-0.1.4/.github/ISSUE_TEMPLATE/bug_report.yml b/bundle/nvim-lspconfig-0.1.4/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000..0fe9c1f61 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,77 @@ +name: Bug report +description: Report a problem in nvim-lspconfig +labels: [bug] +body: + - type: markdown + attributes: + value: | + Before reporting: search existing issues and ensure you are running the latest nightly of neovim and the latest version of nvim-lspconfig. Note that this repository implements configuration and initialization of language servers. Implementation of the language server spec itself is located in the neovim core repository. + - type: textarea + attributes: + label: "Description" + description: "A short description of the problem you are reporting." + validations: + required: true + - type: textarea + attributes: + label: "Neovim version" + description: "Output of `nvim --version`" + placeholder: | + NVIM v0.6.0-dev+209-g0603eba6e + Build type: Release + LuaJIT 2.1.0-beta3 + validations: + required: true + - type: input + attributes: + label: "Nvim-lspconfig version" + description: "Commit hash" + placeholder: 1344a859864d4e6d23d3f3adf56d49e6386ec0d2 + - type: input + attributes: + label: "Operating system and version" + placeholder: "macOS 11.5" + validations: + required: true + - type: input + attributes: + label: "Affected language servers" + description: "If this issue is specific to one or more language servers, list them here. If not, write 'all'." + placeholder: "clangd" + validations: + required: true + - type: textarea + attributes: + label: "Steps to reproduce" + description: "Steps to reproduce using the minimal config provided below." + placeholder: | + 1. `nvim -nu minimal.lua` + 2. ... + validations: + required: true + - type: textarea + attributes: + label: "Actual behavior" + description: "Observed behavior." + validations: + required: true + - type: textarea + attributes: + label: "Expected behavior" + description: "A description of the behavior you expected." + - type: textarea + attributes: + label: "Minimal config" + render: Lua + description: "You can download a minimal_init.lua via `curl -fLO https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/test/minimal_init.lua`. Then edit it to include your language server and add necessary configuration and paste it here." + validations: + required: true + - type: input + attributes: + label: "LSP log" + description: "If not using the `minimal_init.lua`, add `vim.lsp.set_log_level('debug')` to your LSP setup, upload the log file at `$HOME/.cache/nvim/lsp.log` to https://gist.github.com, and paste the link here." + validations: + required: true + + + diff --git a/bundle/nvim-lspconfig-0.1.4/.github/ISSUE_TEMPLATE/config.yml b/bundle/nvim-lspconfig-0.1.4/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..a8893d75b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,6 @@ +blank_issues_enabled: false +contact_links: + - name: Question + url: https://neovim.discourse.group/c/language-server-protocol-lsp/7 + about: Usage questions and support requests are answered in the Neovim Discourse + diff --git a/bundle/nvim-lspconfig-0.1.4/.github/ISSUE_TEMPLATE/feature_request.yml b/bundle/nvim-lspconfig-0.1.4/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 000000000..31f66c72e --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,24 @@ +name: Feature request +description: Request a feature in nvim-lspconfig +labels: [enhancement] +body: + - type: markdown + attributes: + value: | + Before requesting a new feature, search existing issues. Implementation of the language server protocol itself is located in the neovim core repository, and general feature requests may be better suited for core. + - type: input + attributes: + label: "Language server" + description: "Is the feature specific to a language server? If so, which one(s)?" + placeholder: "clangd" + - type: textarea + attributes: + label: "Requested feature" + validations: + required: true + - type: input + attributes: + label: "Other clients which have this feature" + description: "Is the feature already implemented in another LSP client for (Neo)Vim? If so, which one(s)?" + placeholder: "vim-lsp" + diff --git a/bundle/nvim-lspconfig-0.1.4/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/bundle/nvim-lspconfig-0.1.4/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md new file mode 100644 index 000000000..efb4f2b55 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -0,0 +1,5 @@ +--- +name: Pull Request +about: Submit a pull request +title: '' +--- diff --git a/bundle/nvim-lspconfig-0.1.4/.github/ci/run_sanitizer.sh b/bundle/nvim-lspconfig-0.1.4/.github/ci/run_sanitizer.sh new file mode 100644 index 000000000..4098d8a79 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/.github/ci/run_sanitizer.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -e + +REF_BRANCH="$1" +PR_BRANCH="$2" + +# checks for added lines that contain search pattern and prints them +SEARCH_PATTERN="(dirname|fn\.cwd)" + +if git diff --pickaxe-all -U0 -G "${SEARCH_PATTERN}" "${REF_BRANCH}" "${PR_BRANCH}" -- '*.lua' | grep -Ev '(configs|utils)\.lua$' | grep -E "^\+.*${SEARCH_PATTERN}" ; then + echo + echo 'String "dirname" found. There is a high risk that this might contradict the directive:' + echo '"Do not add vim.fn.cwd or util.path.dirname in root_dir".' + echo "see: https://github.com/neovim/nvim-lspconfig/blob/master/CONTRIBUTING.md#adding-a-server-to-lspconfig." + exit 1 +fi diff --git a/bundle/nvim-lspconfig-0.1.4/.github/workflows/codespell.yml b/bundle/nvim-lspconfig-0.1.4/.github/workflows/codespell.yml new file mode 100644 index 000000000..961f15b4b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/.github/workflows/codespell.yml @@ -0,0 +1,11 @@ +name: codespell +on: [pull_request] +jobs: + codespell: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install codespell + run: pip install codespell + - name: Use codespell + run: codespell --quiet-level=2 --check-hidden --skip=./doc/server_configurations.md,./doc/server_configurations.txt --ignore-words=.codespellignorewords diff --git a/bundle/nvim-lspconfig-0.1.4/.github/workflows/comment-config-changes.yml b/bundle/nvim-lspconfig-0.1.4/.github/workflows/comment-config-changes.yml new file mode 100644 index 000000000..b1fdc17e6 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/.github/workflows/comment-config-changes.yml @@ -0,0 +1,20 @@ +name: "Check changes to config" +on: [pull_request_target] +jobs: + close-changes: + runs-on: ubuntu-latest + permissions: + pull-requests: write + env: + PR_NUMBER: ${{ github.event.pull_request.number }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + - run: | + if ! git diff origin/$GITHUB_BASE_REF...$(git branch --show-current) --exit-code -- doc/server_configurations.md doc/server_configurations.txt; then + gh pr comment $PR_NUMBER --body "Do not change `server_configurations.md` directly. Edit the lua source file instead. See https://github.com/neovim/nvim-lspconfig/blob/master/CONTRIBUTING.md#generating-docs" + exit 1 + fi diff --git a/bundle/nvim-lspconfig-0.1.4/.github/workflows/commit_lint.yml b/bundle/nvim-lspconfig-0.1.4/.github/workflows/commit_lint.yml new file mode 100644 index 000000000..32d96375a --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/.github/workflows/commit_lint.yml @@ -0,0 +1,12 @@ +on: [pull_request] +jobs: + lint-commits: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - run: npm install --save-dev @commitlint/{cli,config-conventional} + - run: | + echo "module.exports = { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js + - run: npx commitlint --from HEAD~1 --to HEAD --verbose diff --git a/bundle/nvim-lspconfig-0.1.4/.github/workflows/docgen.yml b/bundle/nvim-lspconfig-0.1.4/.github/workflows/docgen.yml new file mode 100644 index 000000000..0cd56e42e --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/.github/workflows/docgen.yml @@ -0,0 +1,32 @@ +name: docgen + +on: + push: + branches: + - master + +jobs: + docgen: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + - uses: rhysd/action-setup-vim@v1 + with: + neovim: true + version: nightly + - name: Run docgen + run: | + scripts/docgen.sh + - name: Commit changes + env: + COMMIT_MSG: | + docs: update server_configurations.md + skip-checks: true + run: | + git config user.name github-actions + git config user.email github-actions@github.com + git add doc/server_configurations.md doc/server_configurations.txt + # Only commit and push if we have changes + git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push) diff --git a/bundle/nvim-lspconfig-0.1.4/.github/workflows/lint.yml b/bundle/nvim-lspconfig-0.1.4/.github/workflows/lint.yml new file mode 100644 index 000000000..78f511bde --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/.github/workflows/lint.yml @@ -0,0 +1,37 @@ +name: lint + +on: + pull_request: + branches: + - master + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Run luacheck + uses: lunarmodules/luacheck@v1 + with: + args: lua/* test/* + + - name: Run selene + uses: NTBBloodbath/selene-action@v1.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --display-style=quiet . + + style-lint: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Lint with stylua + uses: JohnnyMorganz/stylua-action@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: latest + args: --check . diff --git a/bundle/nvim-lspconfig-0.1.4/.github/workflows/problem_matchers/selene.json b/bundle/nvim-lspconfig-0.1.4/.github/workflows/problem_matchers/selene.json new file mode 100644 index 000000000..4bbf24f30 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/.github/workflows/problem_matchers/selene.json @@ -0,0 +1,30 @@ +{ + "problemMatcher": [ + { + "owner": "selene-error", + "severity": "error", + "pattern": [ + { + "regexp": "^([^:]+):(\\d+):(\\d+):\\serror(.*)$", + "file": 1, + "line": 2, + "column": 3, + "message": 4 + } + ] + }, + { + "owner": "selene-warning", + "severity": "warning", + "pattern": [ + { + "regexp": "^([^:]+):(\\d+):(\\d+):\\swarning(.*)$", + "file": 1, + "line": 2, + "column": 3, + "message": 4 + } + ] + } + ] +} diff --git a/bundle/nvim-lspconfig-0.1.4/.github/workflows/sanitizer.yml b/bundle/nvim-lspconfig-0.1.4/.github/workflows/sanitizer.yml new file mode 100644 index 000000000..d3a30c7ca --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/.github/workflows/sanitizer.yml @@ -0,0 +1,15 @@ +name: "Dirname Checker" +on: [pull_request] +jobs: + disallowed-root-checker: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - run: | + if ! bash .github/ci/run_sanitizer.sh ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}; then + exit 1 + fi diff --git a/bundle/nvim-lspconfig-0.1.4/.github/workflows/test.yml b/bundle/nvim-lspconfig-0.1.4/.github/workflows/test.yml new file mode 100644 index 000000000..aaec37bf9 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/.github/workflows/test.yml @@ -0,0 +1,53 @@ +name: test + +on: + pull_request: + branches: + - master + +jobs: + ubuntu: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + - name: Setup build dependencies + run: | + sudo apt update && + sudo apt install -y ninja-build \ + gettext \ + libtool \ + libtool-bin \ + autoconf \ + automake \ + cmake \ + g++ \ + pkg-config \ + unzip \ + gperf \ + libluajit-5.1-dev \ + libunibilium-dev \ + libmsgpack-dev \ + libtermkey-dev \ + libvterm-dev \ + libjemalloc-dev \ + lua5.1 \ + lua-lpeg \ + lua-mpack \ + lua-bitop + - name: Run test with building Nvim + run: | + make test + macos: + runs-on: macos-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + - name: Setup build dependencies + run: | + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" && + brew install ninja libtool automake pkg-config gettext + - name: Run test with building Nvim + run: | + make test + diff --git a/bundle/nvim-lspconfig-0.1.4/.gitignore b/bundle/nvim-lspconfig-0.1.4/.gitignore new file mode 100644 index 000000000..a928eeda5 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/.gitignore @@ -0,0 +1,3 @@ +.luacheckcache +neovim +doc/tags diff --git a/bundle/nvim-lspconfig-0.1.4/.luacheckrc b/bundle/nvim-lspconfig-0.1.4/.luacheckrc new file mode 100644 index 000000000..ac6af1486 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/.luacheckrc @@ -0,0 +1,15 @@ +-- vim: ft=lua tw=80 + +-- Rerun tests only if their modification time changed. +cache = true + +ignore = { + "122", -- Setting a read-only field of a global variable. + "212", -- Unused argument, In the case of callback function, _arg_name is easier to understand than _, so this option is set to off. + "631", -- max_line_length, vscode pkg URL is too long +} + +-- Global objects defined by the C code +read_globals = { + "vim", +} diff --git a/bundle/nvim-lspconfig-0.1.4/.stylua.toml b/bundle/nvim-lspconfig-0.1.4/.stylua.toml new file mode 100644 index 000000000..78c5507c3 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/.stylua.toml @@ -0,0 +1,6 @@ +column_width = 120 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferSingle" +call_parentheses = "None" diff --git a/bundle/nvim-lspconfig-0.1.4/CONTRIBUTING.md b/bundle/nvim-lspconfig-0.1.4/CONTRIBUTING.md new file mode 100644 index 000000000..e97d6591b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/CONTRIBUTING.md @@ -0,0 +1,133 @@ +## Requirements + +- [Neovim](https://neovim.io/) 0.6 or later +- Lint task requires [luacheck](https://github.com/luarocks/luacheck#installation) and [stylua](https://github.com/JohnnyMorganz/StyLua). If using nix, you can use `nix develop` to install these to a local nix shell. +- Documentation is generated by `scripts/docgen.lua`. + - Only works on linux and macOS + +## Scope of lspconfig + +The point of lspconfig is to provide the minimal configuration necessary for a server to act in compliance with the language server protocol. In general, if a server requires custom client-side commands or off-spec handlers, then the server configuration should be added *without* those in lspconfig and receive a dedicated plugin such as nvim-jdtls, nvim-metals, etc. + +## Pull requests (PRs) + +- To avoid duplicate work, create a draft pull request. +- Avoid cosmetic changes to unrelated files in the same commit. +- Use a [feature branch](https://www.atlassian.com/git/tutorials/comparing-workflows) instead of the master branch. +- Use a **rebase workflow** for small PRs. + - After addressing review comments, it's fine to rebase and force-push. + +## Adding a server to lspconfig + +The general form of adding a new language server is to start with a minimal skeleton. This includes populated the `config` table with a `default_config` and `docs` table. + +When choosing a server name, convert all dashes (`-`) to underscores (`_`) If the name of the server is a unique name (`pyright`, `clangd`) or a commonly used abbreviation (`zls`), prefer this as the server name. If the server instead follows the pattern x-language-server, prefer the convention `x_ls` (`jsonnet_ls`). + +`default_config` should include, at minimum the following: +* `cmd`: a list which includes the executable name as the first entry, with arguments constituting subsequent list elements (`--stdio` is common). +Note that Windows has a limitation when it comes to directly invoking a server that's installed by `npm` or `gem`, so it requires additional handling. + +```lua +local bin_name = 'typescript-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end +``` + +* `filetypes`: a list for filetypes a +* `root_dir`: a function (or function handle) which returns the root of the project used to determine if lspconfig should launch a new language server, or attach a previously launched server when you open a new buffer matching the filetype of the server. Note, lspconfig does not offer a dedicated single file mode (this is not codified in the spec). Do not add `vim.fn.cwd` or `util.path.dirname` in `root_dir`. A future version of lspconfig will provide emulation of a single file mode until this is formally codified in the specification. A good fallback is `util.find_git_ancestor`, see other configurations for examples. + +Additionally, the following options are often added: + +* `init_options`: a table sent during initialization, corresponding to initializationOptions sent in [initializeParams](https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#initializeParams) as part of the first request sent from client to server during startup. +* `settings`: a table sent during [`workspace/didChangeConfiguration`](https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#didChangeConfigurationParams) shortly after server initialization. This is an undocumented convention for most language servers. There is often some duplication with initOptions. + +An example for adding a new language server is shown below for `pyright`, a python language server included in lspconfig: + +```lua +local util = require 'lspconfig.util' + +local bin_name = 'pyright-langserver' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +local root_files = { + 'pyproject.toml', + 'setup.py', + 'setup.cfg', + 'requirements.txt', + 'Pipfile', + 'pyrightconfig.json', +} + +local function organize_imports() + local params = { + command = 'pyright.organizeimports', + arguments = { vim.uri_from_bufnr(0) }, + } + vim.lsp.buf.execute_command(params) +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'python' }, + root_dir = util.root_pattern(unpack(root_files)), + single_file_support = true, + settings = { + python = { + analysis = { + autoSearchPaths = true, + useLibraryCodeForTypes = true, + diagnosticMode = 'workspace', + }, + }, + }, + }, + commands = { + PyrightOrganizeImports = { + organize_imports, + description = 'Organize Imports', + }, + }, + docs = { + description = [[ +https://github.com/microsoft/pyright + +`pyright`, a static type checker and language server for python +]], + }, +} +``` + +## Commit style + +lspconfig, like neovim core, follows the [conventional commit style](https://www.conventionalcommits.org/en/v1.0.0-beta.2/) please submit your commits accordingly. Generally commits will be of the form: + +``` +feat: add lua-language-server support +fix(lua-language-server): update root directory pattern +docs: update README.md +``` + +with the commit body containing additional details. + +## Lint + +PRs are checked with [luacheck](https://github.com/mpeterv/luacheck), [StyLua](https://github.com/JohnnyMorganz/StyLua) and [selene](https://github.com/Kampfkarren/selene). Please run the linter locally before submitting a PR: + + make lint + +## Generating docs + +Github Actions automatically generates `server_configurations.md`. Only modify `scripts/README_template.md` or the `docs` table in the server config Lua file. Do not modify `server_configurations.md` directly. + +To preview the generated `server_configurations.md` locally, run `scripts/docgen.lua` from +`nvim` (from the project root): + + nvim -R -Es +'set rtp+=$PWD' +'luafile scripts/docgen.lua' diff --git a/bundle/nvim-lspconfig-0.1.4/LICENSE.md b/bundle/nvim-lspconfig-0.1.4/LICENSE.md new file mode 100644 index 000000000..04c0a3d54 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/LICENSE.md @@ -0,0 +1,183 @@ +Copyright Neovim contributors. All rights reserved. + +nvim-lspconfig is licensed under the terms of the Apache 2.0 license. + +nvim-lspconfig's license follows: + +==== + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/bundle/nvim-lspconfig-0.1.4/Makefile b/bundle/nvim-lspconfig-0.1.4/Makefile new file mode 100644 index 000000000..15aa212cf --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/Makefile @@ -0,0 +1,12 @@ +test: + sh ./scripts/run_test.sh + +lint: + @printf "\nRunning luacheck\n" + luacheck lua/* test/* + @printf "\nRunning selene\n" + selene --display-style=quiet . + @printf "\nRunning stylua\n" + stylua --check . + +.PHONY: test lint diff --git a/bundle/nvim-lspconfig-0.1.4/README.md b/bundle/nvim-lspconfig-0.1.4/README.md new file mode 100644 index 000000000..5aa5b0a9e --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/README.md @@ -0,0 +1,158 @@ +# nvim-lspconfig + +[Configs](doc/server_configurations.md) for the [Nvim LSP client](https://neovim.io/doc/user/lsp.html) (`:help lsp`). + +* **Do not file Nvim LSP client issues here.** The Nvim LSP client does not live here. This is only a collection of LSP configs. +* If you found a bug in the Nvim LSP client, [report it at the Nvim core repo](https://github.com/neovim/neovim/issues/new?assignees=&labels=bug%2Clsp&template=lsp_bug_report.yml). +* These configs are **best-effort and unsupported.** See [contributions](#contributions). + +See also `:help lsp-config`. + +## Install + +* Requires neovim version 0.7 above. Update Nvim and nvim-lspconfig before reporting an issue. +* Install nvim-lspconfig like any other Vim plugin, e.g. with [packer.nvim](https://github.com/wbthomason/packer.nvim): + ```lua + local use = require('packer').use + require('packer').startup(function() + use 'wbthomason/packer.nvim' -- Package manager + use 'neovim/nvim-lspconfig' -- Configurations for Nvim LSP + end) + ``` + +## Quickstart + +1. Install a language server, e.g. [pyright](doc/server_configurations.md#pyright) + ```bash + npm i -g pyright + ``` +2. Add the language server setup to your init.lua. + ```lua + require'lspconfig'.pyright.setup{} + ``` +3. Launch Nvim, the language server will attach and provide diagnostics. + ``` + nvim main.py + ``` +4. Run `:LspInfo` to see the status or to troubleshoot. +5. See [Suggested configuration](#Suggested-configuration) to setup common mappings and omnifunc completion. + +See [server_configurations.md](doc/server_configurations.md) (`:help lspconfig-all` from Nvim) for the full list of configs, including installation instructions and additional, optional, customization suggestions for each language server. For servers that are not on your system path (e.g., `jdtls`, `elixirls`), you must manually add `cmd` to the `setup` parameter. Most language servers can be installed in less than a minute. + +## Suggested configuration + +nvim-lspconfig does not set keybindings or enable completion by default. The following example configuration provides suggested keymaps for the most commonly used language server functions, and manually triggered completion with omnifunc (\\). + +Note: you must pass the defined `on_attach` as an argument to **every `setup {}` call** and the keybindings in `on_attach` **only take effect on buffers with an active language server**. + +```lua +-- Mappings. +-- See `:help vim.diagnostic.*` for documentation on any of the below functions +local opts = { noremap=true, silent=true } +vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) +vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) +vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) +vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) + +-- Use an on_attach function to only map the following keys +-- after the language server attaches to the current buffer +local on_attach = function(client, bufnr) + -- Enable completion triggered by + vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + + -- Mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + local bufopts = { noremap=true, silent=true, buffer=bufnr } + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) + vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) + vim.keymap.set('n', '', vim.lsp.buf.signature_help, bufopts) + vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, bufopts) + vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, bufopts) + vim.keymap.set('n', 'wl', function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, bufopts) + vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, bufopts) + vim.keymap.set('n', 'rn', vim.lsp.buf.rename, bufopts) + vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, bufopts) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) + vim.keymap.set('n', 'f', function() vim.lsp.buf.format { async = true } end, bufopts) +end + +local lsp_flags = { + -- This is the default in Nvim 0.7+ + debounce_text_changes = 150, +} +require('lspconfig')['pyright'].setup{ + on_attach = on_attach, + flags = lsp_flags, +} +require('lspconfig')['tsserver'].setup{ + on_attach = on_attach, + flags = lsp_flags, +} +require('lspconfig')['rust_analyzer'].setup{ + on_attach = on_attach, + flags = lsp_flags, + -- Server-specific settings... + settings = { + ["rust-analyzer"] = {} + } +} +``` + +Manual, triggered completion is provided by Nvim's builtin omnifunc. For *auto*completion, a general purpose [autocompletion plugin](https://github.com/neovim/nvim-lspconfig/wiki/Autocompletion) is required. + +## Troubleshooting + +If you have an issue, the first step is to reproduce with a [minimal configuration](https://github.com/neovim/nvim-lspconfig/blob/master/test/minimal_init.lua). + +The most common reasons a language server does not start or attach are: + +1. The language server is not installed. nvim-lspconfig does not install language servers for you. You should be able to run the `cmd` defined in each server's Lua module from the command line and see that the language server starts. If the `cmd` is an executable name instead of an absolute path to the executable, ensure it is on your path. +2. Missing filetype plugins. Certain languages are not detecting by vim/neovim because they have not yet been added to the filetype detection system. Ensure `:set ft?` shows the filetype and not an empty value. +3. Not triggering root detection. **Some** language servers will only start if it is opened in a directory, or child directory, containing a file which signals the *root* of the project. Most of the time, this is a `.git` folder, but each server defines the root config in the lua file. See [server_configurations.md](doc/server_configurations.md) or the source for the list of root directories. +4. You must pass `on_attach` and `capabilities` for **each** `setup {}` if you want these to take effect. +5. **Do not call `setup {}` twice for the same server**. The second call to `setup {}` will overwrite the first. + +Before reporting a bug, check your logs and the output of `:LspInfo`. Add the following to your init.vim to enable logging: + +```lua +vim.lsp.set_log_level("debug") +``` + +Attempt to run the language server, and open the log with: + +``` +:LspLog +``` +Most of the time, the reason for failure is present in the logs. + +## Commands + +* `:LspInfo` shows the status of active and configured language servers. +* `:LspStart ` Start the requested server name. Will only successfully start if the command detects a root directory matching the current config. Pass `autostart = false` to your `.setup{}` call for a language server if you would like to launch clients solely with this command. Defaults to all servers matching current buffer filetype. +* `:LspStop ` Defaults to stopping all buffer clients. +* `:LspRestart ` Defaults to restarting all buffer clients. + +## Wiki + +See the [wiki](https://github.com/neovim/nvim-lspconfig/wiki) for additional topics, including: + +* [Automatic server installation](https://github.com/neovim/nvim-lspconfig/wiki/Installing-language-servers#automatically) +* [Snippets support](https://github.com/neovim/nvim-lspconfig/wiki/Snippets) +* [Project local settings](https://github.com/neovim/nvim-lspconfig/wiki/Project-local-settings) +* [Recommended plugins for enhanced language server features](https://github.com/neovim/nvim-lspconfig/wiki/Language-specific-plugins) + +## Contributions + +If you are missing a language server on the list in [server_configurations.md](doc/server_configurations.md), contributing +a new configuration for it helps others, especially if the server requires special setup. Follow these steps: + +1. Read [CONTRIBUTING.md](CONTRIBUTING.md). +2. Create a new file at `lua/lspconfig/server_configurations/SERVER_NAME.lua`. + - Copy an [existing config](https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/) + to get started. Most configs are simple. For an extensive example see + [texlab.lua](https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/texlab.lua). +3. Ask questions on our [Discourse](https://neovim.discourse.group/c/7-category/7) or in the [Neovim Matrix room](https://app.element.io/#/room/#neovim:matrix.org). diff --git a/bundle/nvim-lspconfig-0.1.4/doc/lspconfig.txt b/bundle/nvim-lspconfig-0.1.4/doc/lspconfig.txt new file mode 100644 index 000000000..9e91d1b37 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/doc/lspconfig.txt @@ -0,0 +1,651 @@ +*lspconfig.txt* For Nvim version 0.7+ + +nvim-lspconfig provides user-contributed configs for the Nvim |lsp| client. + + Type |gO| to see the table of contents. + +============================================================================== +INTRODUCTION *lspconfig* + +nvim-lspconfig is a collection of community-contributed configurations for the +built-in language server client in Nvim core. This plugin provides four +primary functionalities: + + - default launch commands, initialization options, and settings for each + server + - a root directory resolver which attempts to detect the root of your project + - an autocommand mapping that either launches a new language server or + attempts to attach a language server to each opened buffer if it falls + under a tracked project + - utility commands such as LspInfo, LspStart, LspStop, and LspRestart for + managing language server instances + +nvim-lspconfig is not required to use the builtin Nvim |lsp| client, it is +just a convenience layer. + +See |lspconfig-all| for the complete list of language server configurations. + +============================================================================== +QUICKSTART *lspconfig-quickstart* + +- ensure the server is installed and executable from the command line + +- enable the server in your Neovim configuration (Lua example): +> + require'lspconfig'.clangd.setup{} +< +- create a new project, ensure that it contains a root marker which matches the + server requirements specified in |lspconfig-all|. + +- open a file within that project, such as `main.c`. + +- If you need more information about a server configuration, read the corresponding + entry in |lspconfig-all|. + +============================================================================== +THE SETUP METAMETHOD *lspconfig-setup* + +`lspconfig` consists of a collection of language server configurations. Each +configuration exposes a `setup {}` metamethod which makes it easy to directly +use the default configuration or selectively override the defaults. +`setup {}` is the primary interface by which users interact with `lspconfig`. + +Using the default configuration for a server is simple: +> + require'lspconfig'.clangd.setup{} +< +The available server names are listed in |lspconfig-all| and match the server +name in `config.SERVER_NAME` defined in each configuration's source file. + +The purpose of `setup{}` is to wrap the call to Nvim's built-in +`vim.lsp.start_client()` with an autocommand that automatically launch a +language server. + +This autocommand calls `start_client()` or `vim.lsp.buf_attach_client()` +depending on whether the current file belongs to a project with a currently +running client. See |lspconfig-root-detection| for more details. + +The `setup{}` function takes a table which contains a superset of the keys +listed in `:help vim.lsp.start_client()` with the following unique entries: + +- {root_dir} + + `function(filename, bufnr)` + + Returns either a filepath (string) or nil. The language server will only + start if the function returns a filepath. + + If a root directory (string) is returned which is unique from any + previously returned root_dir, a new server will be spawned with that + root directory. See |lspconfig-root-detection| for more details + +- {name} + + `string` + + Defaults to the server's name (`clangd`, `pyright`, etc.). + +- {filetypes} + + `list[string] | nil` + + Set of filetypes for which to attempt to resolve {root_dir}. + + May be empty, or server may specify a default value. + +- {autostart} + + `bool` (default: true) + + Controls if the `FileType` autocommand that launches a language server is + created. If `false`, allows for deferring language servers until manually + launched with `:LspStart` (|lspconfig-commands|). + +- {single_file_support} + + `bool` (default: nil) + + Determines if a server is started without a matching root directory. + See |lspconfig-single-file-support|. + +- {on_new_config} + + `function(new_config, new_root_dir)` + + Function executed after a root directory is detected. This is used to + modify the server configuration (including `cmd` itself). Most commonly, + this is used to inject additional arguments into `cmd`. + + If overriding `on_new_config`, ensure that you read the + `on_new_config` defined in the source file of the default configuration + in `lspconfig`. The original `on_new_config` snippet for a given server + should likely be included in your new override. Some configurations + use `on_new_config` to dynamically set or modify `cmd`. + +Note: all entries passed to `setup {}` override the entry in the default +configuration. There is no composition. + +All `config` elements described in `:help vim.lsp.start_client()` can +additionally be overridden via the `setup {}` call. The most commonly +passed overrides to `setup {}` are: + +- {capabilities} `table ` + + a table which represents the neovim client capabilities. Useful for + broadcasting to the server additional functionality (snippets, off-protocol + features) provided by plugins. + +- {cmd} `list[string]` + + a list where each entry corresponds to the blankspace delimited part of + the command that launches the server. The first entry is the binary used + to run the language server. Additional entries are passed as arguments. + + The equivalent `cmd` for: +> + foo --bar baz +< + is: +> + {'foo', '--bar', 'baz'} +< +- {handlers} `list[functions]` + + a list of handlers which override the function used to process a response + from a given language server. Applied only to the server referenced by + setup. See |lsp-handler|. + +- {init_options} `table ` + + a table passed during the initialization notification after launching + a language server. Equivalent to the `initializationOptions` field found + in `InitializeParams` in the LSP specification. + + See upstream server documentation for available initialization + options. + +- {on_attach} `function(client, bufnr)` + + Callback invoked by Nvim's built-in client when attaching a buffer to a + language server. Often used to set Nvim (buffer or global) options or to + override the Nvim client properties (`resolved_capabilities`) after a + language server attaches. Most commonly used for settings buffer + local keybindings. See |lspconfig-keybindings| for a usage example. + +- {settings} `table ` + + The `settings` table is sent in `on_init` via a + `workspace/didChangeConfiguration` notification from the Nvim client to + the language server. These settings allow a user to change optional runtime + settings of the language server. + + As an example, to set the following settings found in the pyright + documentation: + + `pyright.disableLanguageServices`: `boolean` + `pyright.disableOrganizeImports`: `boolean` + + Nested keys need to be translated into a nested table and passed to + the settings field in `setup {}` as follows: +> + require('lspconfig').pyright.setup{ + settings = { + pyright = { + disableLanguageServices = true, + disableOrganizeImports = true, + } + } + } +< +============================================================================== +OVERRIDING GLOBAL DEFAULTS *lspconfig-global-defaults* + +The global defaults for all servers can be overridden by extending the +`default_config` table. + +> + local lspconfig = require'lspconfig' + lspconfig.util.default_config = vim.tbl_extend( + "force", + lspconfig.util.default_config, + { + autostart = false, + handlers = { + ["window/logMessage"] = function(err, method, params, client_id) + if params and params.type <= vim.lsp.protocol.MessageType.Log then + vim.lsp.handlers["window/logMessage"](err, method, params, client_id) + end + end, + ["window/showMessage"] = function(err, method, params, client_id) + if params and params.type <= vim.lsp.protocol.MessageType.Warning.Error then + vim.lsp.handlers["window/showMessage"](err, method, params, client_id) + end + end, + } + } + ) +< +`setup {}` can additionally override these defaults in subsequent calls. + +============================================================================== +SETUP HOOK *lspconfig-setup-hook* + +`lspconfig` will execute the `on_setup` hook for each setup call to a server after +validating its configuration, and before attempting to launch the server +itself. One typical usage is to allow ad-hoc substitution for any +configuration entry, such as `cmd`. + +> + local lspconfig = require 'lspconfig' + lspconfig.util.on_setup = util.add_hook_before(lspconfig.util.on_setup, function(config) + if some_condition and config.name == "clangd" then + local custom_server_prefix = "/my/custom/server/prefix" + config.cmd = { custom_server_prefix .. "/bin/clangd" } + end + end) + + +Note: This is primarily targeted at plugins developers, so make sure to use +`util.add_hook_before()` as a wrapper instead of overriding the original function +completely, to void breaking external integrations with lspconfig. + +============================================================================== +SERVER CONFIGURATIONS *lspconfig-configurations* + +See |lspconfig-all| for the complete list of language server configurations. + +While the `setup {}` function is the primary interface to `lspconfig`, for +servers for which there is not a configuration, it is necessary to define a +configuration directly. This can be useful if there is an outstanding PR that +is in review, or when developing a language server that is unavailable +publicly. This can be done through the `configs` module. + +The `configs` module is a singleton where configs are defined. The schema for +validating using `vim.validate` is: +> + configs.SERVER_NAME = { + default_config = {'t'}, + on_new_config = {'f', true}, + on_attach = {'f', true}, + commands = {'t', true}, + docs = {'t', true}, + } +< +where the structure of the docs table is as follows: +> + docs = { + description = {'s', true}, + default_config = {'t', true}, + } +< +`commands` is a map of `name:definition` key:value pairs, where `definition` +is a list whose first value is a function implementing the command, and the +rest are either array values which will be formed into flags for the command, +or special keys like `description`. + +Warning: Commands is deprecated and will be removed in future releases. +It is recommended to use `vim.api.nvim_create_user_command()` instead in an `on_attach` function. + +Example: +> + local function organize_imports() + local params = { + command = 'pyright.organizeimports', + arguments = { vim.uri_from_bufnr(0) }, + } + vim.lsp.buf.execute_command(params) + end + + local on_attach = function(client, bufnr) + if client.name == "pyright" then + vim.api.nvim_create_user_command("PyrightOrganizeImports", organize_imports, {desc = 'Organize Imports'}) + end + end + + require("lspconfig")['pyright'].setup({ + on_attach = on_attach + }) +< + +The `configs.__newindex` metamethod consumes the config definition and returns +an object with a `setup()` method, to be invoked by users: +> + require'lspconfig'.SERVER_NAME.setup{} + +After you set `configs.SERVER_NAME` you can add arbitrary language-specific +functions to it if necessary. + +Example: +> + configs.texlab.buf_build = buf_build +< + +============================================================================== +ADDING NEW SERVERS *lspconfig-new* + +The steps for adding and enabling a new server configuration are: + +1. load the `lspconfig` module (note that this is a stylistic choice) > + local lspconfig = require 'lspconfig' +< +2. define the configuration > + local configs = require 'lspconfig.configs' + + -- Check if the config is already defined (useful when reloading this file) + if not configs.foo_lsp then + configs.foo_lsp = { + default_config = { + cmd = {'/home/neovim/lua-language-server/run.sh'}, + filetypes = {'lua'}, + root_dir = function(fname) + return lspconfig.util.find_git_ancestor(fname) + end, + settings = {}, + }, + } + end + +3. call `setup()` to enable the FileType autocmd > + lspconfig.foo_lsp.setup{} +< +============================================================================== +ROOT DETECTION *lspconfig-root-detection* + *lspconfig-root-dir* + +A project's `root_dir` is used by `lspconfig` to determine whether `lspconfig` +should start a new server, or attach a previous one, to the current file. + +`lspconfig` automatically launches language servers by defining a filetype +autocommand based on the `filetypes` specified in the default configuration of +each server, optionally overridable by the `filetypes` table passed to +`setup`. + +This autocommand triggers a search from the current file position in the +filesystem hierarchy up to the top level directory of your filesystem. The +`root_dir` entry of each configuration is a function that returns true if the +current directory in this traversal matches a given root pattern. + +The following utility functions are provided by `lspconfig`. Each function call +below returns a function that takes as its argument the current buffer path. + +- `util.root_pattern`: function which takes multiple arguments, each + corresponding to a different root pattern against which the contents of the + current directory are matched using |vim.fin.glob()| while traversing up the + filesystem. +> + root_dir = util.root_pattern('pyproject.toml', 'requirements.txt') +< +- `util.find_git_ancestor`: a function that locates the first parent directory + containing a `.git` directory. +> + root_dir = util.find_git_ancestor + +- `util.find_node_modules_ancestor`: a function that locates the first parent + directory containing a `node_modules` directory. +> + root_dir = util.find_node_modules_ancestor +< + +- `util.find_package_json_ancestor`: a function that locates the first parent + directory containing a `package.json`. +> + root_dir = util.find_json_ancestor +< +Note: On Windows, `lspconfig` always assumes forward slash normalized paths with +capitalized drive letters. + +============================================================================== +ADVANCED ROOT DIRECTORY DETECTION *lspconfig-root-advanced* + *lspconfig-root-composition* + +The `root_dir` key in `config` and `setup` can hold any function of the form +> + function custom_root_dir(filename, bufnr) + returns nil | string +> +This allows for rich composition of root directory patterns which is necessary +for some project structures. Example (for Kotlin): +> + local root_files = { + 'settings.gradle', -- Gradle (multi-project) + 'settings.gradle.kts', -- Gradle (multi-project) + 'build.xml', -- Ant + 'pom.xml', -- Maven + } + + local fallback_root_files = { + 'build.gradle', -- Gradle + 'build.gradle.kts', -- Gradle + } + root_dir = function(fname) + local primary = util.root_pattern(unpack(root_files))(fname) + local fallback = util.root_pattern(unpack(fallback_root_files))(fname) + return primary or fallback + end +< +Browsing the source of the default configurations is recommended. + +============================================================================== +SINGLE FILE SUPPORT *lspconfig-single-file-support* + +Language servers require each project to have a `root` in order to provide +features that require cross-file indexing. + +Some servers support not passing a root directory as a proxy for single file +mode under which cross-file features may be degraded. + +`lspconfig` offers limited support for an implicit single-file mode by: + +- first trying to resolve the root directory pattern +- then, if `single_file_support` is enabled for a given language server + configuration, starting the server without sending `rootDirectory` or + `workspaceFolders` during initialization. +- attaching subsequent files in the parent directory to the same server + instance, depending on filetype. +- also supports unnamed buffer if filetype matches the server filetype + settings. + +Cross-file features (navigation, hover) may or may not work depending on the +language server. For a full feature-set, consider moving your files to a +directory with a project structure `lspconfig` can infer. + +Note that in the event that the LSP specification is extended to support a +standard for single-file mode, lspconfig will adopt that standard. + +============================================================================== +COMMANDS *lspconfig-commands* + +- `:LspInfo` shows the status of active and configured language servers. Note + that client id refers to the Nvim RPC instance connected to a given + language server. + +The following commands support tab-completion for all arguments. All commands +that require a client id can either leverage tab-completion or the info +contained in `:LspInfo`: + +- `:LspStart ` launches the requested (configured) client, but only + if it successfully resolves a root directory. Note: Defaults to all + configured servers matching the current buffer filetype. +- `:LspStop ` stops the server with the given client id. Defaults to + stopping all servers active on the current buffer. if you want to force stop + a language server you can do it like `:LspStop ++force` +- `:LspRestart ` restarts the client with the given client id, and + will attempt to reattach to all previously attached buffers. + +============================================================================== +EXAMPLE KEYBINDINGS *lspconfig-keybindings* + +`lspconfig`, and the core client, do not map any keybindings by default. The +following is an example Lua block which demonstrates how to leverage +`on-attach` to selectively apply keybindings after a language servers has +attached to a given buffer. +> +> + -- Mappings. + -- See `:help vim.diagnostic.*` for documentation on any of the below functions + local opts = { noremap=true, silent=true } + vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) + vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) + vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) + vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) + + -- Use an on_attach function to only map the following keys + -- after the language server attaches to the current buffer + local on_attach = function(client, bufnr) + -- Enable completion triggered by + vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + + -- Mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + local bufopts = { noremap=true, silent=true, buffer=bufnr } + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) + vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) + vim.keymap.set('n', '', vim.lsp.buf.signature_help, bufopts) + vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, bufopts) + vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, bufopts) + vim.keymap.set('n', 'wl', function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, bufopts) + vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, bufopts) + vim.keymap.set('n', 'rn', vim.lsp.buf.rename, bufopts) + vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, bufopts) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) + vim.keymap.set('n', 'f', function() vim.lsp.buf.format { async = true } end, bufopts) + end + + local lsp_flags = { + -- This is the default in Nvim 0.7+ + debounce_text_changes = 150, + } + require('lspconfig')['pyright'].setup{ + on_attach = on_attach, + flags = lsp_flags, + } + require('lspconfig')['tsserver'].setup{ + on_attach = on_attach, + flags = lsp_flags, + } + require('lspconfig')['rust_analyzer'].setup{ + on_attach = on_attach, + flags = lsp_flags, + -- Server-specific settings... + settings = { + ["rust-analyzer"] = {} + } + } + +============================================================================== +COMPLETION SUPPORT *lspconfig-completion* + +Manually triggered completion can be provided by Nvim's built-in omnifunc. +See |lsp-config|. + +For autocompletion, Nvim does not provide built-in functionality. Consult the +nvim-lspconfig wiki, which provides configuration examples for using +a completion plugin with the built-in client + +============================================================================== +DEBUGGING *lspconfig-debugging* + +While using language servers should be easy, debugging issues can be +challenging. First, it is important to identify the source of the issue, which +is typically (in rough order): + +- the language server itself +- a plugin +- overrides in a user configuration +- the built-in client in Nvim core +- nvim-lspconfig + +The first step in debugging is to test with a minimal configuration (such as +`../test/minimal_init.lua`). Historically, many users problems are due to +plugins or misconfiguration. + +Should that fail, identifying which component is the culprit is challenging. +The following are the only categories of bugs that pertain to nvim-lspconfig. + +- The root directory inferred for your project is wrong, or it should be + detected but is not due to a bug in the nvim-lspconfig path utilities. +- The server is launching, but you believe that the default settings, + initialization options, or command arguments are suboptimal and should be + replaced based on your understanding of the server documentation. + +All bugs Nvim's built-in client should be reported to the Nvim core issue +tracker. All bugs pertaining to plugins should be reported to the respective +plugin. All missing features in a language server should be reported to the +upstream language server issue tracker. + +For debugging nvim-lspconfig issues, the most common hurdles users face are: + + - The language server is not installed or is otherwise not executable. + nvim-lspconfig does not install language servers for you. Ensure the `cmd` + defined in `server_configurations.md` is executable from the command + line. If the absolute path to the binary is not supplied in `cmd`, ensure + it is on your PATH. + - No root detected. nvim-lspconfig is built around the concept of projects. See + |lspconfig-root-detection| for more details. Most of the time, + initializing a git repo will suffice. + - Misconfiguration. Often users will override `cmd`, `on_init`, or + `handlers`. Ensure that you debug by using a stock configuration to ensure + your customizations are not introducing issues. + +|LspInfo| provides an overview of your active and configured language servers +which can be useful for debugging. + +Note that it will not report any configuration changes applied in +`on_new_config`. + +============================================================================== +LOGGING *lspconfig-logging* + +When debugging language servers, it is helpful to enable additional logging in +the built-in client, specifically considering the RPC logs. Example: +> + vim.lsp.set_log_level 'trace' + if vim.fn.has 'nvim-0.5.1' == 1 then + require('vim.lsp.log').set_format_func(vim.inspect) + end +< +Attempt to run the language server, and open the log with: + +> + :LspLog +< +Note that `ERROR` messages containing `stderr` only indicate that the log was +sent to `stderr`. Many servers counter-intuitively send harmless messages +via stderr. + +============================================================================== +SCOPE *lspconfig-scope* + +`lspconfig` is a community effort to create default configurations that fit +within the scope of an official plugin for Nvim. All features that are not +strictly providing default configurations for language servers will be removed +from `lspconfig` in time. The power of the Neovim LSP ecosystem is in the +composability and flexibility of integrating multiple plugins which maximizes +user choice and freedom. + +`lspconfig` also opts to adhere strictly to the LSP specification, with some +small allowances when small modifications to a server configuration are +necessary to enable features critical to its usability. For more featureful +options, the `lspconfig` wiki lists community created plugins that build upon +the built-in client to provide functionality tailored to specific language +servers. + +============================================================================== +Highlights *lspconfig-highlight* + +LspInfoTitle Client name +LspInfoList Server name list +LspInfoFiletype `filetypes` area +LspInfoTip Tip +LspInfoBorder Window border + To set the border use: > + require('lspconfig.ui.windows').default_options.border = 'single' +< Accepts the same values as the `border` option to |nvim_open_win()| + +============================================================================== + +vim:tw=78:ts=8:ft=help:norl: diff --git a/bundle/nvim-lspconfig-0.1.4/doc/server_configurations.md b/bundle/nvim-lspconfig-0.1.4/doc/server_configurations.md new file mode 100644 index 000000000..da7dc4fbd --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/doc/server_configurations.md @@ -0,0 +1,8503 @@ +# Configurations + + +LSP configs provided by nvim-lspconfig are listed below. This documentation is +autogenerated from the Lua files. You can view this file in Nvim by running +`:help lspconfig-all`. + +- [als](#als) +- [anakin_language_server](#anakin_language_server) +- [angularls](#angularls) +- [ansiblels](#ansiblels) +- [antlersls](#antlersls) +- [apex_ls](#apex_ls) +- [arduino_language_server](#arduino_language_server) +- [asm_lsp](#asm_lsp) +- [astro](#astro) +- [awk_ls](#awk_ls) +- [bashls](#bashls) +- [beancount](#beancount) +- [bicep](#bicep) +- [blueprint_ls](#blueprint_ls) +- [bsl_ls](#bsl_ls) +- [bufls](#bufls) +- [ccls](#ccls) +- [clangd](#clangd) +- [clarity_lsp](#clarity_lsp) +- [clojure_lsp](#clojure_lsp) +- [cmake](#cmake) +- [codeqlls](#codeqlls) +- [crystalline](#crystalline) +- [csharp_ls](#csharp_ls) +- [cssls](#cssls) +- [cssmodules_ls](#cssmodules_ls) +- [cucumber_language_server](#cucumber_language_server) +- [dafny](#dafny) +- [dagger](#dagger) +- [dartls](#dartls) +- [denols](#denols) +- [dhall_lsp_server](#dhall_lsp_server) +- [diagnosticls](#diagnosticls) +- [dockerls](#dockerls) +- [dolmenls](#dolmenls) +- [dotls](#dotls) +- [efm](#efm) +- [elixirls](#elixirls) +- [elmls](#elmls) +- [ember](#ember) +- [emmet_ls](#emmet_ls) +- [erg_language_server](#erg_language_server) +- [erlangls](#erlangls) +- [esbonio](#esbonio) +- [eslint](#eslint) +- [fennel-ls](#fennel-ls) +- [flow](#flow) +- [flux_lsp](#flux_lsp) +- [foam_ls](#foam_ls) +- [fortls](#fortls) +- [fsautocomplete](#fsautocomplete) +- [fsharp_language_server](#fsharp_language_server) +- [fstar](#fstar) +- [gdscript](#gdscript) +- [ghcide](#ghcide) +- [ghdl_ls](#ghdl_ls) +- [gleam](#gleam) +- [glint](#glint) +- [glslls](#glslls) +- [golangci_lint_ls](#golangci_lint_ls) +- [gopls](#gopls) +- [gradle_ls](#gradle_ls) +- [grammarly](#grammarly) +- [graphql](#graphql) +- [groovyls](#groovyls) +- [haxe_language_server](#haxe_language_server) +- [hdl_checker](#hdl_checker) +- [hhvm](#hhvm) +- [hie](#hie) +- [hls](#hls) +- [hoon_ls](#hoon_ls) +- [html](#html) +- [idris2_lsp](#idris2_lsp) +- [intelephense](#intelephense) +- [java_language_server](#java_language_server) +- [jdtls](#jdtls) +- [jedi_language_server](#jedi_language_server) +- [jsonls](#jsonls) +- [jsonnet_ls](#jsonnet_ls) +- [julials](#julials) +- [kotlin_language_server](#kotlin_language_server) +- [lean3ls](#lean3ls) +- [leanls](#leanls) +- [lelwel_ls](#lelwel_ls) +- [lemminx](#lemminx) +- [ltex](#ltex) +- [luau_lsp](#luau_lsp) +- [m68k](#m68k) +- [marksman](#marksman) +- [metals](#metals) +- [millet](#millet) +- [mint](#mint) +- [mlir_lsp_server](#mlir_lsp_server) +- [mlir_pdll_lsp_server](#mlir_pdll_lsp_server) +- [mm0_ls](#mm0_ls) +- [move_analyzer](#move_analyzer) +- [neocmake](#neocmake) +- [nickel_ls](#nickel_ls) +- [nil_ls](#nil_ls) +- [nimls](#nimls) +- [ntt](#ntt) +- [nxls](#nxls) +- [ocamlls](#ocamlls) +- [ocamllsp](#ocamllsp) +- [ols](#ols) +- [omnisharp](#omnisharp) +- [opencl_ls](#opencl_ls) +- [openscad_ls](#openscad_ls) +- [pasls](#pasls) +- [perlls](#perlls) +- [perlnavigator](#perlnavigator) +- [perlpls](#perlpls) +- [phan](#phan) +- [phpactor](#phpactor) +- [please](#please) +- [powershell_es](#powershell_es) +- [prismals](#prismals) +- [prolog_ls](#prolog_ls) +- [prosemd_lsp](#prosemd_lsp) +- [psalm](#psalm) +- [puppet](#puppet) +- [purescriptls](#purescriptls) +- [pylsp](#pylsp) +- [pyre](#pyre) +- [pyright](#pyright) +- [qml_lsp](#qml_lsp) +- [qmlls](#qmlls) +- [quick_lint_js](#quick_lint_js) +- [r_language_server](#r_language_server) +- [racket_langserver](#racket_langserver) +- [reason_ls](#reason_ls) +- [relay_lsp](#relay_lsp) +- [remark_ls](#remark_ls) +- [rescriptls](#rescriptls) +- [rls](#rls) +- [rnix](#rnix) +- [robotframework_ls](#robotframework_ls) +- [rome](#rome) +- [ruby_ls](#ruby_ls) +- [rust_analyzer](#rust_analyzer) +- [salt_ls](#salt_ls) +- [scheme_langserver](#scheme_langserver) +- [scry](#scry) +- [serve_d](#serve_d) +- [sixtyfps](#sixtyfps) +- [slint_lsp](#slint_lsp) +- [smarty_ls](#smarty_ls) +- [solang](#solang) +- [solargraph](#solargraph) +- [solc](#solc) +- [solidity](#solidity) +- [solidity_ls](#solidity_ls) +- [sorbet](#sorbet) +- [sourcekit](#sourcekit) +- [sourcery](#sourcery) +- [spectral](#spectral) +- [sqlls](#sqlls) +- [sqls](#sqls) +- [starlark-rust](#starlark-rust) +- [steep](#steep) +- [stylelint_lsp](#stylelint_lsp) +- [sumneko_lua](#sumneko_lua) +- [svelte](#svelte) +- [svlangserver](#svlangserver) +- [svls](#svls) +- [syntax_tree](#syntax_tree) +- [tailwindcss](#tailwindcss) +- [taplo](#taplo) +- [tblgen_lsp_server](#tblgen_lsp_server) +- [teal_ls](#teal_ls) +- [terraform_lsp](#terraform_lsp) +- [terraformls](#terraformls) +- [texlab](#texlab) +- [tflint](#tflint) +- [theme_check](#theme_check) +- [tilt_ls](#tilt_ls) +- [tsserver](#tsserver) +- [turtle_ls](#turtle_ls) +- [typeprof](#typeprof) +- [unison](#unison) +- [vala_ls](#vala_ls) +- [vdmj](#vdmj) +- [verible](#verible) +- [veridian](#veridian) +- [vimls](#vimls) +- [visualforce_ls](#visualforce_ls) +- [vls](#vls) +- [volar](#volar) +- [vuels](#vuels) +- [wgsl_analyzer](#wgsl_analyzer) +- [yamlls](#yamlls) +- [zk](#zk) +- [zls](#zls) + +## als + +https://github.com/AdaCore/ada_language_server + +Installation instructions can be found [here](https://github.com/AdaCore/ada_language_server#Install). + +Can be configured by passing a "settings" object to `als.setup{}`: + +```lua +require('lspconfig').als.setup{ + settings = { + ada = { + projectFile = "project.gpr"; + scenarioVariables = { ... }; + } + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.als.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ada_language_server" } + ``` + - `filetypes` : + ```lua + { "ada" } + ``` + - `root_dir` : + ```lua + util.root_pattern("Makefile", ".git", "*.gpr", "*.adc") + ``` + + +## anakin_language_server + +https://pypi.org/project/anakin-language-server/ + +`anakin-language-server` is yet another Jedi Python language server. + +Available options: + +* Initialization: https://github.com/muffinmad/anakin-language-server#initialization-option +* Configuration: https://github.com/muffinmad/anakin-language-server#configuration-options + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.anakin_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "anakinls" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + anakinls = { + pyflakes_errors = { "ImportStarNotPermitted", "UndefinedExport", "UndefinedLocal", "UndefinedName", "DuplicateArgument", "MultiValueRepeatedKeyLiteral", "MultiValueRepeatedKeyVariable", "FutureFeatureNotDefined", "LateFutureImport", "ReturnOutsideFunction", "YieldOutsideFunction", "ContinueOutsideLoop", "BreakOutsideLoop", "TwoStarredExpressions", "TooManyExpressionsInStarredAssignment", "ForwardAnnotationSyntaxError", "RaiseNotImplemented", "StringDotFormatExtraPositionalArguments", "StringDotFormatExtraNamedArguments", "StringDotFormatMissingArgument", "StringDotFormatMixingAutomatic", "StringDotFormatInvalidFormat", "PercentFormatInvalidFormat", "PercentFormatMixedPositionalAndNamed", "PercentFormatUnsupportedFormat", "PercentFormatPositionalCountMismatch", "PercentFormatExtraNamedArguments", "PercentFormatMissingArgument", "PercentFormatExpectedMapping", "PercentFormatExpectedSequence", "PercentFormatStarRequiresSequence" } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## angularls + +https://github.com/angular/vscode-ng-language-service + +`angular-language-server` can be installed via npm `npm install -g @angular/language-server`. + +Note, that if you override the default `cmd`, you must also update `on_new_config` to set `new_config.cmd` during startup. + +```lua +local project_library_path = "/path/to/project/lib" +local cmd = {"ngserver", "--stdio", "--tsProbeLocations", project_library_path , "--ngProbeLocations", project_library_path} + +require'lspconfig'.angularls.setup{ + cmd = cmd, + on_new_config = function(new_config,new_root_dir) + new_config.cmd = cmd + end, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.angularls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ngserver", "--stdio", "--tsProbeLocations", "", "--ngProbeLocations", "" } + ``` + - `filetypes` : + ```lua + { "typescript", "html", "typescriptreact", "typescript.tsx" } + ``` + - `root_dir` : + ```lua + root_pattern("angular.json") + ``` + + +## ansiblels + +https://github.com/ansible/ansible-language-server + +Language server for the ansible configuration management tool. + +`ansible-language-server` can be installed via `npm`: + +```sh +npm install -g @ansible/ansible-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ansiblels.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ansible-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml.ansible" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + ansible = { + ansible = { + path = "ansible" + }, + executionEnvironment = { + enabled = false + }, + python = { + interpreterPath = "python" + }, + validation = { + enabled = true, + lint = { + enabled = true, + path = "ansible-lint" + } + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## antlersls + +https://www.npmjs.com/package/antlers-language-server + +`antlersls` can be installed via `npm`: +```sh +npm install -g antlers-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.antlersls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "antlersls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "html", "antlers" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## apex_ls + +https://github.com/forcedotcom/salesforcedx-vscode + +Language server for Apex. + +For manual installation, download the JAR file from the [VSCode +extension](https://github.com/forcedotcom/salesforcedx-vscode/tree/develop/packages/salesforcedx-vscode-apex). + +```lua +require'lspconfig'.apex_ls.setup { + apex_jar_path = '/path/to/apex-jorje-lsp.jar', + apex_enable_semantic_errors = false, -- Whether to allow Apex Language Server to surface semantic errors + apex_enable_completion_statistics = false, -- Whether to allow Apex Language Server to collect telemetry on code completion usage +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.apex_ls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "apexcode" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern('sfdx-project.json') + ``` + + +## arduino_language_server + +https://github.com/arduino/arduino-language-server + +Language server for Arduino + +The `arduino-language-server` can be installed by running: + +``` +go install github.com/arduino/arduino-language-server@latest +``` + +The `arduino-cli` tool must also be installed. Follow [these +installation instructions](https://arduino.github.io/arduino-cli/latest/installation/) for +your platform. + +After installing `arduino-cli`, follow [these +instructions](https://arduino.github.io/arduino-cli/latest/getting-started/#create-a-configuration-file) +for generating a configuration file if you haven't done so already, and make +sure you [install any relevant platforms +libraries](https://arduino.github.io/arduino-cli/latest/getting-started/#install-the-core-for-your-board). +Make sure to save the full path to the created `arduino-cli.yaml` file for later. + +The language server also requires `clangd` to be installed. Follow [these +installation instructions](https://clangd.llvm.org/installation) for your +platform. + +Next, you will need to decide which FQBN to use. +To identify the available FQBNs for boards you currently have connected, you may use the `arduino-cli` command, like so: + +```sh +$ arduino-cli board list +Port Protocol Type Board Name FQBN Core +/dev/ttyACM0 serial Serial Port (USB) Arduino Uno arduino:avr:uno arduino:avr + ^^^^^^^^^^^^^^^ +``` + +After all dependencies are installed you'll need to set the command for the +language server in your setup: + +```lua +require'lspconfig'.arduino_language_server.setup { + cmd = { + "arduino-language-server", + "-cli-config", "/path/to/arduino-cli.yaml", + "-fqbn", "arduino:avr:uno", + "-cli", "arduino-cli", + "-clangd", "clangd" + } +} +``` + +For further instruction about configuration options, run `arduino-language-server --help`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.arduino_language_server.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "arduino" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## asm_lsp + +https://github.com/bergercookie/asm-lsp + +Language Server for GAS/GO Assembly + +`asm-lsp` can be installed via cargo: +cargo install asm-lsp + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.asm_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "asm-lsp" } + ``` + - `filetypes` : + ```lua + { "asm", "vmasm" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## astro + +https://github.com/withastro/language-tools/tree/main/packages/language-server + +`astro-ls` can be installed via `npm`: +```sh +npm install -g @astrojs/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.astro.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "astro-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "astro" } + ``` + - `init_options` : + ```lua + { + configuration = {}, + typescript = { + serverPath = "" + } + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git") + ``` + + +## awk_ls + +https://github.com/Beaglefoot/awk-language-server/ + +`awk-language-server` can be installed via `npm`: +```sh +npm install -g awk-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.awk_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "awk-language-server" } + ``` + - `filetypes` : + ```lua + { "awk" } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bashls + +https://github.com/mads-hartmann/bash-language-server + +`bash-language-server` can be installed via `npm`: +```sh +npm i -g bash-language-server +``` + +Language server for bash, written using tree sitter in typescript. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bashls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "bash-language-server", "start" } + ``` + - `cmd_env` : + ```lua + { + GLOB_PATTERN = "*@(.sh|.inc|.bash|.command)" + } + ``` + - `filetypes` : + ```lua + { "sh" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## beancount + +https://github.com/polarmutex/beancount-language-server#installation + +See https://github.com/polarmutex/beancount-language-server#configuration for configuration options + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.beancount.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "beancount-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "beancount", "bean" } + ``` + - `init_options` : + ```lua + { + journalFile = "" + } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bicep + +https://github.com/azure/bicep +Bicep language server + +Bicep language server can be installed by downloading and extracting a release of bicep-langserver.zip from [Bicep GitHub releases](https://github.com/Azure/bicep/releases). + +Bicep language server requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +Neovim does not have built-in support for the bicep filetype which is required for lspconfig to automatically launch the language server. + +Filetype detection can be added via an autocmd: +```lua +vim.cmd [[ autocmd BufNewFile,BufRead *.bicep set filetype=bicep ]] +``` + +**By default, bicep language server does not have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. + +```lua +local bicep_lsp_bin = "/path/to/bicep-langserver/Bicep.LangServer.dll" +require'lspconfig'.bicep.setup{ + cmd = { "dotnet", bicep_lsp_bin }; + ... +} +``` + +To download the latest release and place in /usr/local/bin/bicep-langserver: +```bash +(cd $(mktemp -d) \ + && curl -fLO https://github.com/Azure/bicep/releases/latest/download/bicep-langserver.zip \ + && rm -rf /usr/local/bin/bicep-langserver \ + && unzip -d /usr/local/bin/bicep-langserver bicep-langserver.zip) +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bicep.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "bicep" } + ``` + - `init_options` : + ```lua + {} + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## blueprint_ls + +https://gitlab.gnome.org/jwestman/blueprint-compiler + +`blueprint-compiler` can be installed via your system package manager. + +Language server for the blurprint markup language, written in python and part +of the blueprint-compiler. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.blueprint_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "blueprint-compiler", "lsp" } + ``` + - `cmd_env` : + ```lua + { + GLOB_PATTERN = "*@(.blp)" + } + ``` + - `filetypes` : + ```lua + { "blueprint" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bsl_ls + + https://github.com/1c-syntax/bsl-language-server + + Language Server Protocol implementation for 1C (BSL) - 1C:Enterprise 8 and OneScript languages. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bsl_ls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "bsl", "os" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## bufls + +https://github.com/bufbuild/buf-language-server + +`buf-language-server` can be installed via `go install`: +```sh +go install github.com/bufbuild/buf-language-server/cmd/bufls@latest +``` + +bufls is a Protobuf language server compatible with Buf modules and workspaces + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bufls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "bufls", "serve" } + ``` + - `filetypes` : + ```lua + { "proto" } + ``` + - `root_dir` : + ```lua + root_pattern("buf.work.yaml", ".git") + ``` + + +## ccls + +https://github.com/MaskRay/ccls/wiki + +ccls relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) specified +as compile_commands.json or, for simpler projects, a .ccls. +For details on how to automatically generate one using CMake look [here](https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html). Alternatively, you can use [Bear](https://github.com/rizsotto/Bear). + +Customization options are passed to ccls at initialization time via init_options, a list of available options can be found [here](https://github.com/MaskRay/ccls/wiki/Customization#initialization-options). For example: + +```lua +local lspconfig = require'lspconfig' +lspconfig.ccls.setup { + init_options = { + compilationDatabaseDirectory = "build"; + index = { + threads = 0; + }; + clang = { + excludeArgs = { "-frounding-math"} ; + }; + } +} + +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ccls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ccls" } + ``` + - `filetypes` : + ```lua + { "c", "cpp", "objc", "objcpp" } + ``` + - `offset_encoding` : + ```lua + "utf-32" + ``` + - `root_dir` : + ```lua + root_pattern('compile_commands.json', '.ccls', '.git') + ``` + - `single_file_support` : + ```lua + false + ``` + + +## clangd + +https://clangd.llvm.org/installation.html + +- **NOTE:** Clang >= 11 is recommended! See [#23](https://github.com/neovim/nvim-lsp/issues/23). +- If `compile_commands.json` lives in a build directory, you should + symlink it to the root of your source tree. + ``` + ln -s /path/to/myproject/build/compile_commands.json /path/to/myproject/ + ``` +- clangd relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) + specified as compile_commands.json, see https://clangd.llvm.org/installation#compile_commandsjson + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.clangd.setup{} +``` +**Commands:** +- ClangdSwitchSourceHeader: Switch between source/header + +**Default values:** + - `capabilities` : + ```lua + default capabilities, with offsetEncoding utf-8 + ``` + - `cmd` : + ```lua + { "clangd" } + ``` + - `filetypes` : + ```lua + { "c", "cpp", "objc", "objcpp", "cuda", "proto" } + ``` + - `root_dir` : + ```lua + root_pattern( + '.clangd', + '.clang-tidy', + '.clang-format', + 'compile_commands.json', + 'compile_flags.txt', + 'configure.ac', + '.git' + ) + + ``` + - `single_file_support` : + ```lua + true + ``` + + +## clarity_lsp + +`clarity-lsp` is a language server for the Clarity language. Clarity is a decidable smart contract language that optimizes for predictability and security. Smart contracts allow developers to encode essential business logic on a blockchain. + +To learn how to configure the clarity language server, see the [clarity-lsp documentation](https://github.com/hirosystems/clarity-lsp). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.clarity_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "clarity-lsp" } + ``` + - `filetypes` : + ```lua + { "clar", "clarity" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## clojure_lsp + +https://github.com/clojure-lsp/clojure-lsp + +Clojure Language Server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.clojure_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "clojure-lsp" } + ``` + - `filetypes` : + ```lua + { "clojure", "edn" } + ``` + - `root_dir` : + ```lua + root_pattern("project.clj", "deps.edn", "build.boot", "shadow-cljs.edn", ".git") + ``` + + +## cmake + +https://github.com/regen100/cmake-language-server + +CMake LSP Implementation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cmake.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cmake-language-server" } + ``` + - `filetypes` : + ```lua + { "cmake" } + ``` + - `init_options` : + ```lua + { + buildDirectory = "build" + } + ``` + - `root_dir` : + ```lua + root_pattern('CMakePresets.json', 'CTestConfig.cmake', '.git', 'build', 'cmake') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## codeqlls + +Reference: +https://codeql.github.com/docs/codeql-cli/ + +Binaries: +https://github.com/github/codeql-cli-binaries + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.codeqlls.setup{} +``` + + +**Default values:** + - `before_init` : + ```lua + see source file + ``` + - `cmd` : + ```lua + { "codeql", "execute", "language-server", "--check-errors", "ON_CHANGE", "-q" } + ``` + - `filetypes` : + ```lua + { "ql" } + ``` + - `log_level` : + ```lua + 2 + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + search_path = "list containing all search paths, eg: '~/codeql-home/codeql-repo'" + } + ``` + + +## crystalline + +https://github.com/elbywan/crystalline + +Crystal language server. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.crystalline.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "crystalline" } + ``` + - `filetypes` : + ```lua + { "crystal" } + ``` + - `root_dir` : + ```lua + root_pattern('shard.yml', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## csharp_ls + +https://github.com/razzmatazz/csharp-language-server + +Language Server for C#. + +csharp-ls requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +The preferred way to install csharp-ls is with `dotnet tool install --global csharp-ls`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.csharp_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "csharp-ls" } + ``` + - `filetypes` : + ```lua + { "cs" } + ``` + - `init_options` : + ```lua + { + AutomaticWorkspaceInit = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## cssls + + +https://github.com/hrsh7th/vscode-langservers-extracted + +`css-languageserver` can be installed via `npm`: + +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-css-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.cssls.setup { + capabilities = capabilities, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cssls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vscode-css-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "css", "scss", "less" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") or bufdir + ``` + - `settings` : + ```lua + { + css = { + validate = true + }, + less = { + validate = true + }, + scss = { + validate = true + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## cssmodules_ls + +https://github.com/antonk52/cssmodules-language-server + +Language server for autocompletion and go-to-definition functionality for CSS modules. + +You can install cssmodules-language-server via npm: +```sh +npm install -g cssmodules-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cssmodules_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cssmodules-language-server" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "typescript", "typescriptreact" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json") + ``` + + +## cucumber_language_server + +https://cucumber.io +https://github.com/cucumber/common +https://www.npmjs.com/package/@cucumber/language-server + +Language server for Cucumber. + +`cucumber-language-server` can be installed via `npm`: +```sh +npm install -g @cucumber/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cucumber_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cucumber-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "cucumber" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## dafny + + NeoVim support for the Dafny language server. + Please follow the instructions and compile the language server from source: + https://github.com/dafny-lang/language-server-csharp + + Note that there is no default cmd set. You must set it yourself. The recommended way is to use `{"dotnet", ""}`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dafny.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "dfy", "dafny" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dagger + +https://github.com/dagger/cuelsp + +Dagger's lsp server for cuelang. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dagger.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cuelsp" } + ``` + - `filetypes` : + ```lua + { "cue" } + ``` + - `root_dir` : + ```lua + root_pattern("cue.mod", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dartls + +https://github.com/dart-lang/sdk/tree/master/pkg/analysis_server/tool/lsp_spec + +Language server for dart. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dartls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dart", "language-server", "--protocol=lsp" } + ``` + - `filetypes` : + ```lua + { "dart" } + ``` + - `init_options` : + ```lua + { + closingLabels = true, + flutterOutline = true, + onlyAnalyzeProjectsWithOpenFiles = true, + outline = true, + suggestFromUnimportedLibraries = true + } + ``` + - `root_dir` : + ```lua + root_pattern("pubspec.yaml") + ``` + - `settings` : + ```lua + { + dart = { + completeFunctionCalls = true, + showTodos = true + } + } + ``` + + +## denols + +https://github.com/denoland/deno + +Deno's built-in language server + +To appropriately highlight codefences returned from denols, you will need to augment vim.g.markdown_fenced languages + in your init.lua. Example: + +```lua +vim.g.markdown_fenced_languages = { + "ts=typescript" +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.denols.setup{} +``` +**Commands:** +- DenolsCache: Cache a module and all of its dependencies. + +**Default values:** + - `cmd` : + ```lua + { "deno", "lsp" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" } + ``` + - `handlers` : + ```lua + { + ["textDocument/definition"] = , + ["textDocument/references"] = , + ["workspace/executeCommand"] = + } + ``` + - `init_options` : + ```lua + { + enable = true, + unstable = false + } + ``` + - `root_dir` : + ```lua + root_pattern("deno.json", "deno.jsonc", ".git") + ``` + + +## dhall_lsp_server + +https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-lsp-server + +language server for dhall + +`dhall-lsp-server` can be installed via cabal: +```sh +cabal install dhall-lsp-server +``` +prebuilt binaries can be found [here](https://github.com/dhall-lang/dhall-haskell/releases). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dhall_lsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dhall-lsp-server" } + ``` + - `filetypes` : + ```lua + { "dhall" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## diagnosticls + +https://github.com/iamcco/diagnostic-languageserver + +Diagnostic language server integrate with linters. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.diagnosticls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "diagnostic-languageserver", "--stdio" } + ``` + - `filetypes` : + ```lua + Empty by default, override to add filetypes + ``` + - `root_dir` : + ```lua + Vim's starting directory + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dockerls + +https://github.com/rcjsuen/dockerfile-language-server-nodejs + +`docker-langserver` can be installed via `npm`: +```sh +npm install -g dockerfile-language-server-nodejs +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dockerls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "docker-langserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "dockerfile" } + ``` + - `root_dir` : + ```lua + root_pattern("Dockerfile") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dolmenls + +https://github.com/Gbury/dolmen/blob/master/doc/lsp.md + +`dolmenls` can be installed via `opam` +```sh +opam install dolmen_lsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dolmenls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dolmenls" } + ``` + - `filetypes` : + ```lua + { "smt2", "tptp", "p", "cnf", "icnf", "zf" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dotls + +https://github.com/nikeee/dot-language-server + +`dot-language-server` can be installed via `npm`: +```sh +npm install -g dot-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dotls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dot-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "dot" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## efm + +https://github.com/mattn/efm-langserver + +General purpose Language Server that can use specified error message format generated from specified command. + +Requires at minimum EFM version [v0.0.38](https://github.com/mattn/efm-langserver/releases/tag/v0.0.38) to support +launching the language server on single files. If on an older version of EFM, disable single file support: + +```lua +require('lspconfig')['efm'].setup{ + settings = ..., -- You must populate this according to the EFM readme + filetypes = ..., -- Populate this according to the note below + single_file_support = false, -- This is the important line for supporting older version of EFM +} +``` + +Note: In order for neovim's built-in language server client to send the appropriate `languageId` to EFM, **you must +specify `filetypes` in your call to `setup{}`**. Otherwise `lspconfig` will launch EFM on the `BufEnter` instead +of the `FileType` autocommand, and the `filetype` variable used to populate the `languageId` will not yet be set. + +```lua +require('lspconfig')['efm'].setup{ + settings = ..., -- You must populate this according to the EFM readme + filetypes = { 'python','cpp','lua' } +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.efm.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "efm-langserver" } + ``` + - `root_dir` : + ```lua + util.root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## elixirls + +https://github.com/elixir-lsp/elixir-ls + +`elixir-ls` can be installed by following the instructions [here](https://github.com/elixir-lsp/elixir-ls#building-and-running). + +```bash +curl -fLO https://github.com/elixir-lsp/elixir-ls/releases/latest/download/elixir-ls.zip +unzip elixir-ls.zip -d /path/to/elixir-ls +# Unix +chmod +x /path/to/elixir-ls/language_server.sh +``` + +**By default, elixir-ls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of your unzipped elixir-ls. + +```lua +require'lspconfig'.elixirls.setup{ + -- Unix + cmd = { "/path/to/elixir-ls/language_server.sh" }; + -- Windows + cmd = { "/path/to/elixir-ls/language_server.bat" }; + ... +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.elixirls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "elixir", "eelixir", "heex", "surface" } + ``` + - `root_dir` : + ```lua + root_pattern("mix.exs", ".git") or vim.loop.os_homedir() + ``` + + +## elmls + +https://github.com/elm-tooling/elm-language-server#installation + +If you don't want to use Nvim to install it, then you can use: +```sh +npm install -g elm elm-test elm-format @elm-tooling/elm-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.elmls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "elm-language-server" } + ``` + - `filetypes` : + ```lua + { "elm" } + ``` + - `init_options` : + ```lua + { + elmAnalyseTrigger = "change" + } + ``` + - `root_dir` : + ```lua + root_pattern("elm.json") + ``` + + +## ember + +https://github.com/lifeart/ember-language-server + +`ember-language-server` can be installed via `npm`: + +```sh +npm install -g @lifeart/ember-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ember.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ember-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "handlebars", "typescript", "javascript" } + ``` + - `root_dir` : + ```lua + root_pattern("ember-cli-build.js", ".git") + ``` + + +## emmet_ls + +https://github.com/aca/emmet-ls + +Package can be installed via `npm`: +```sh +npm install -g emmet-ls +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.emmet_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "emmet-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "eruby" } + ``` + - `root_dir` : + ```lua + git root + ``` + - `single_file_support` : + ```lua + true + ``` + + +## erg_language_server + +https://github.com/erg-lang/erg-language-server + +ELS (erg-language-server) is a language server for the Erg programming language. + +`els` can be installed via `cargo`: + ```sh + cargo install els + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.erg_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "els" } + ``` + - `filetypes` : + ```lua + { "erg" } + ``` + - `root_dir` : + ```lua + root_pattern("package.er") or find_git_ancestor + ``` + + +## erlangls + +https://erlang-ls.github.io + +Language Server for Erlang. + +Clone [erlang_ls](https://github.com/erlang-ls/erlang_ls) +Compile the project with `make` and copy resulting binaries somewhere in your $PATH eg. `cp _build/*/bin/* ~/local/bin` + +Installation instruction can be found [here](https://github.com/erlang-ls/erlang_ls). + +Installation requirements: + - [Erlang OTP 21+](https://github.com/erlang/otp) + - [rebar3 3.9.1+](https://github.com/erlang/rebar3) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.erlangls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "erlang_ls" } + ``` + - `filetypes` : + ```lua + { "erlang" } + ``` + - `root_dir` : + ```lua + root_pattern('rebar.config', 'erlang.mk', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## esbonio + +https://github.com/swyddfa/esbonio + +Esbonio is a language server for [Sphinx](https://www.sphinx-doc.org/en/master/) documentation projects. +The language server can be installed via pip + +``` +pip install esbonio +``` + +Since Sphinx is highly extensible you will get best results if you install the language server in the same +Python environment as the one used to build your documentation. To ensure that the correct Python environment +is picked up, you can either launch `nvim` with the correct environment activated. + +``` +source env/bin/activate +nvim +``` + +Or you can modify the default `cmd` to include the full path to the Python interpreter. + +```lua +require'lspconfig'.esbonio.setup { + cmd = { '/path/to/virtualenv/bin/python', '-m', 'esbonio' } +} +``` + +Esbonio supports a number of config values passed as `init_options` on startup, for example. + +```lua +require'lspconfig'.esbonio.setup { + init_options = { + server = { + logLevel = "debug" + }, + sphinx = { + confDir = "/path/to/docs", + srcDir = "${confDir}/../docs-src" + } +} +``` + +A full list and explanation of the available options can be found [here](https://swyddfa.github.io/esbonio/docs/latest/en/lsp/getting-started.html#configuration) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.esbonio.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "python3", "-m", "esbonio" } + ``` + - `filetypes` : + ```lua + { "rst" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## eslint + +https://github.com/hrsh7th/vscode-langservers-extracted + +`vscode-eslint-language-server` is a linting engine for JavaScript / Typescript. +It can be installed via `npm`: + +```sh +npm i -g vscode-langservers-extracted +``` + +`vscode-eslint-language-server` provides an `EslintFixAll` command that can be used to format a document on save: +```vim +autocmd BufWritePre *.tsx,*.ts,*.jsx,*.js EslintFixAll +``` + +See [vscode-eslint](https://github.com/microsoft/vscode-eslint/blob/55871979d7af184bf09af491b6ea35ebd56822cf/server/src/eslintServer.ts#L216-L229) for configuration options. + +Messages handled in lspconfig: `eslint/openDoc`, `eslint/confirmESLintExecution`, `eslint/probeFailed`, `eslint/noLibrary` + +Additional messages you can handle: `eslint/noConfig` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.eslint.setup{} +``` +**Commands:** +- EslintFixAll: Fix all eslint problems for this buffer + +**Default values:** + - `cmd` : + ```lua + { "vscode-eslint-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx", "vue", "svelte", "astro" } + ``` + - `handlers` : + ```lua + { + ["eslint/confirmESLintExecution"] = , + ["eslint/noLibrary"] = , + ["eslint/openDoc"] = , + ["eslint/probeFailed"] = + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + codeAction = { + disableRuleComment = { + enable = true, + location = "separateLine" + }, + showDocumentation = { + enable = true + } + }, + codeActionOnSave = { + enable = false, + mode = "all" + }, + experimental = { + useFlatConfig = false + }, + format = true, + nodePath = "", + onIgnoredFiles = "off", + packageManager = "npm", + problems = { + shortenToSingleLine = false + }, + quiet = false, + rulesCustomizations = {}, + run = "onType", + useESLintClass = false, + validate = "on", + workingDirectory = { + mode = "location" + } + } + ``` + + +## fennel-ls + +https://sr.ht/~xerool/fennel-ls/ + +A language server for fennel. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fennel-ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fennel-ls" } + ``` + - `filetypes` : + ```lua + { "fennel" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## flow + +https://flow.org/ +https://github.com/facebook/flow + +See below for how to setup Flow itself. +https://flow.org/en/docs/install/ + +See below for lsp command options. + +```sh +npx flow lsp --help +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.flow.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "npx", "--no-install", "flow", "lsp" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx" } + ``` + - `root_dir` : + ```lua + root_pattern(".flowconfig") + ``` + + +## flux_lsp + +https://github.com/influxdata/flux-lsp +`flux-lsp` can be installed via `cargo`: +```sh +cargo install --git https://github.com/influxdata/flux-lsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.flux_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "flux-lsp" } + ``` + - `filetypes` : + ```lua + { "flux" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## foam_ls + +https://github.com/FoamScience/foam-language-server + +`foam-language-server` can be installed via `npm` +```sh +npm install -g foam-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.foam_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "foam-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "foam", "OpenFOAM" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## fortls + +https://github.com/gnikit/fortls + +fortls is a Fortran Language Server, the server can be installed via pip + +```sh +pip install fortls +``` + +Settings to the server can be passed either through the `cmd` option or through +a local configuration file e.g. `.fortls`. For more information +see the `fortls` [documentation](https://gnikit.github.io/fortls/options.html). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fortls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fortls", "--notify_init", "--hover_signature", "--hover_language=fortran", "--use_signature_help" } + ``` + - `filetypes` : + ```lua + { "fortran" } + ``` + - `root_dir` : + ```lua + root_pattern(".fortls") + ``` + - `settings` : + ```lua + {} + ``` + + +## fsautocomplete + +https://github.com/fsharp/FsAutoComplete + +Language Server for F# provided by FsAutoComplete (FSAC). + +FsAutoComplete requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +The preferred way to install FsAutoComplete is with `dotnet tool install --global fsautocomplete`. + +Instructions to compile from source are found on the main [repository](https://github.com/fsharp/FsAutoComplete). + +You may also need to configure the filetype as Vim defaults to Forth for `*.fs` files: + +`autocmd BufNewFile,BufRead *.fs,*.fsx,*.fsi set filetype=fsharp` + +This is automatically done by plugins such as [PhilT/vim-fsharp](https://github.com/PhilT/vim-fsharp), [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp), and [adelarsq/neofsharp.vim](https://github.com/adelarsq/neofsharp.vim). + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fsautocomplete.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fsautocomplete", "--adaptive-lsp-server-enabled" } + ``` + - `filetypes` : + ```lua + { "fsharp" } + ``` + - `init_options` : + ```lua + { + AutomaticWorkspaceInit = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## fsharp_language_server + +F# Language Server +https://github.com/faldor20/fsharp-language-server + +An implementation of the language server protocol using the F# Compiler Service. + +Build the project from source and override the command path to location of DLL. + +If filetype determination is not already performed by an available plugin ([PhilT/vim-fsharp](https://github.com/PhilT/vim-fsharp), [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp), and [adelarsq/neofsharp.vim](https://github.com/adelarsq/neofsharp.vim). +), then the following must be added to initialization configuration: + + +`autocmd BufNewFile,BufRead *.fs,*.fsx,*.fsi set filetype=fsharp` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fsharp_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dotnet", "FSharpLanguageServer.dll" } + ``` + - `filetypes` : + ```lua + { "fsharp" } + ``` + - `init_options` : + ```lua + { + AutomaticWorkspaceInit = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## fstar + +https://github.com/FStarLang/FStar + +LSP support is included in FStar. Make sure `fstar.exe` is in your PATH. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fstar.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fstar.exe", "--lsp" } + ``` + - `filetypes` : + ```lua + { "fstar" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## gdscript + +https://github.com/godotengine/godot + +Language server for GDScript, used by Godot Engine. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gdscript.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + see source file + ``` + - `filetypes` : + ```lua + { "gd", "gdscript", "gdscript3" } + ``` + - `root_dir` : + ```lua + util.root_pattern("project.godot", ".git") + ``` + + +## ghcide + +https://github.com/digital-asset/ghcide + +A library for building Haskell IDE tooling. +"ghcide" isn't for end users now. Use "haskell-language-server" instead of "ghcide". + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ghcide.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ghcide", "--lsp" } + ``` + - `filetypes` : + ```lua + { "haskell", "lhaskell" } + ``` + - `root_dir` : + ```lua + root_pattern("stack.yaml", "hie-bios", "BUILD.bazel", "cabal.config", "package.yaml") + ``` + + +## ghdl_ls + +https://github.com/ghdl/ghdl-language-server + +A language server for VHDL, using ghdl as its backend. + +`ghdl-ls` is part of pyghdl, for installation instructions see +[the upstream README](https://github.com/ghdl/ghdl/tree/master/pyGHDL/lsp). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ghdl_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ghdl-ls" } + ``` + - `filetypes` : + ```lua + { "vhdl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## gleam + +https://github.com/gleam-lang/gleam + +A language server for Gleam Programming Language. +[Installation](https://gleam.run/getting-started/installing/) + +It can be i + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gleam.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "gleam", "lsp" } + ``` + - `filetypes` : + ```lua + { "gleam" } + ``` + - `root_dir` : + ```lua + root_pattern("gleam.toml", ".git") + ``` + + +## glint + + https://github.com/typed-ember/glint + + https://typed-ember.gitbook.io/glint/ + + `glint-language-server` is installed when adding `@glint/core` to your project's devDependencies: + + ```sh + npm install @glint/core --save-dev + ``` + + or + + ```sh + yarn add -D @glint/core + ``` + + or + + ```sh + pnpm add -D @glint/core + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.glint.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "glint-language-server" } + ``` + - `filetypes` : + ```lua + { "html.handlebars", "handlebars", "typescript", "typescript.glimmer", "javascript", "javascript.glimmer" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## glslls + +https://github.com/svenstaro/glsl-language-server + +Language server implementation for GLSL + +`glslls` can be compiled and installed manually, or, if your distribution has access to the AUR, +via the `glsl-language-server` AUR package + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.glslls.setup{} +``` + + +**Default values:** + - `capabilities` : + ```lua + { + offsetEncoding = { "utf-8", "utf-16" }, + textDocument = { + completion = { + editsNearCursor = true + } + } + } + ``` + - `cmd` : + ```lua + { "glslls", "--stdin" } + ``` + - `filetypes` : + ```lua + { "glsl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## golangci_lint_ls + +Combination of both lint server and client + +https://github.com/nametake/golangci-lint-langserver +https://github.com/golangci/golangci-lint + + +Installation of binaries needed is done via + +``` +go install github.com/nametake/golangci-lint-langserver@latest +go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.golangci_lint_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "golangci-lint-langserver" } + ``` + - `filetypes` : + ```lua + { "go", "gomod" } + ``` + - `init_options` : + ```lua + { + command = { "golangci-lint", "run", "--out-format", "json" } + } + ``` + - `root_dir` : + ```lua + root_pattern('go.work') or root_pattern('go.mod', '.golangci.yaml', '.git') + ``` + + +## gopls + +https://github.com/golang/tools/tree/master/gopls + +Google's lsp server for golang. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gopls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "gopls" } + ``` + - `filetypes` : + ```lua + { "go", "gomod", "gowork", "gotmpl" } + ``` + - `root_dir` : + ```lua + root_pattern("go.mod", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## gradle_ls + +https://github.com/microsoft/vscode-gradle + +Microsoft's lsp server for gradle files + +If you're setting this up manually, build vscode-gradle using `./gradlew installDist` and point `cmd` to the `gradle-language-server` generated in the build directory + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gradle_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "gradle-language-server" } + ``` + - `filetypes` : + ```lua + { "groovy" } + ``` + - `init_options` : + ```lua + { + settings = { + gradleWrapperEnabled = true + } + } + ``` + - `root_dir` : + ```lua + root_pattern("settings.gradle") + ``` + + +## grammarly + +https://github.com/znck/grammarly + +`grammarly-languageserver` can be installed via `npm`: + +```sh +npm i -g grammarly-languageserver +``` + +WARNING: Since this language server uses Grammarly's API, any document you open with it running is shared with them. Please evaluate their [privacy policy](https://www.grammarly.com/privacy-policy) before using this. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.grammarly.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "grammarly-languageserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `handlers` : + ```lua + { + ["$/updateDocumentState"] = + } + ``` + - `init_options` : + ```lua + { + clientId = "client_BaDkMgx4X19X9UxxYRCXZo" + } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## graphql + +https://github.com/graphql/graphiql/tree/main/packages/graphql-language-service-cli + +`graphql-lsp` can be installed via `npm`: + +```sh +npm install -g graphql-language-service-cli +``` + +Note that you must also have [the graphql package](https://github.com/graphql/graphql-js) installed and create a [GraphQL config file](https://www.graphql-config.com/docs/user/user-introduction). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.graphql.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "graphql-lsp", "server", "-m", "stream" } + ``` + - `filetypes` : + ```lua + { "graphql", "typescriptreact", "javascriptreact" } + ``` + - `root_dir` : + ```lua + util.root_pattern('.git', '.graphqlrc*', '.graphql.config.*', 'graphql.config.*') + ``` + + +## groovyls + +https://github.com/prominic/groovy-language-server.git + +Requirements: + - Linux/macOS (for now) + - Java 11+ + +`groovyls` can be installed by following the instructions [here](https://github.com/prominic/groovy-language-server.git#build). + +If you have installed groovy language server, you can set the `cmd` custom path as follow: + +```lua +require'lspconfig'.groovyls.setup{ + -- Unix + cmd = { "java", "-jar", "path/to/groovyls/groovy-language-server-all.jar" }, + ... +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.groovyls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "java", "-jar", "groovy-language-server-all.jar" } + ``` + - `filetypes` : + ```lua + { "groovy" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## haxe_language_server + +https://github.com/vshaxe/haxe-language-server + +The Haxe language server can be built by running the following commands from +the project's root directory: + + npm install + npx lix run vshaxe-build -t language-server + +This will create `bin/server.js`. Note that the server requires Haxe 3.4.0 or +higher. + +After building the language server, set the `cmd` setting in your setup +function: + +```lua +lspconfig.haxe_language_server.setup({ + cmd = {"node", "path/to/bin/server.js"}, +}) +``` + +By default, an HXML compiler arguments file named `build.hxml` is expected in +your project's root directory. If your file is named something different, +specify it using the `init_options.displayArguments` setting. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.haxe_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "haxe-language-server" } + ``` + - `filetypes` : + ```lua + { "haxe" } + ``` + - `init_options` : + ```lua + { + displayArguments = { "build.hxml" } + } + ``` + - `root_dir` : + ```lua + root_pattern("*.hxml") + ``` + - `settings` : + ```lua + { + haxe = { + executable = "haxe" + } + } + ``` + + +## hdl_checker + +https://github.com/suoto/hdl_checker +Language server for hdl-checker. +Install using: `pip install hdl-checker --upgrade` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hdl_checker.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hdl_checker", "--lsp" } + ``` + - `filetypes` : + ```lua + { "vhdl", "verilog", "systemverilog" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## hhvm + +Language server for programs written in Hack +https://hhvm.com/ +https://github.com/facebook/hhvm +See below for how to setup HHVM & typechecker: +https://docs.hhvm.com/hhvm/getting-started/getting-started + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hhvm.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hh_client", "lsp" } + ``` + - `filetypes` : + ```lua + { "php", "hack" } + ``` + - `root_dir` : + ```lua + root_pattern(".hhconfig") + ``` + + +## hie + +https://github.com/haskell/haskell-ide-engine + +the following init_options are supported (see https://github.com/haskell/haskell-ide-engine#configuration): +```lua +init_options = { + languageServerHaskell = { + hlintOn = bool; + maxNumberOfProblems = number; + diagnosticsDebounceDuration = number; + liquidOn = bool (default false); + completionSnippetsOn = bool (default true); + formatOnImportOn = bool (default true); + formattingProvider = string (default "brittany", alternate "floskell"); + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hie.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hie-wrapper", "--lsp" } + ``` + - `filetypes` : + ```lua + { "haskell" } + ``` + - `root_dir` : + ```lua + root_pattern("stack.yaml", "package.yaml", ".git") + ``` + + +## hls + +https://github.com/haskell/haskell-language-server + +Haskell Language Server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "haskell-language-server-wrapper", "--lsp" } + ``` + - `filetypes` : + ```lua + { "haskell", "lhaskell" } + ``` + - `lspinfo` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + function (filepath) + return ( + util.root_pattern('hie.yaml', 'stack.yaml', 'cabal.project')(filepath) + or util.root_pattern('*.cabal', 'package.yaml')(filepath) + ) + end + + ``` + - `settings` : + ```lua + { + haskell = { + formattingProvider = "ormolu" + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## hoon_ls + +https://github.com/urbit/hoon-language-server + +A language server for Hoon. + +The language server can be installed via `npm install -g @hoon-language-server` + +Start a fake ~zod with `urbit -F zod`. +Start the language server at the Urbit Dojo prompt with: `|start %language-server` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hoon_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hoon-language-server" } + ``` + - `filetypes` : + ```lua + { "hoon" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## html + +https://github.com/hrsh7th/vscode-langservers-extracted + +`vscode-html-language-server` can be installed via `npm`: +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-html-language-server` only provides completions when snippet support is enabled. +To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +The code-formatting feature of the lsp can be controlled with the `provideFormatter` option. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.html.setup { + capabilities = capabilities, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.html.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vscode-html-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "html" } + ``` + - `init_options` : + ```lua + { + configurationSection = { "html", "css", "javascript" }, + embeddedLanguages = { + css = true, + javascript = true + }, + provideFormatter = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## idris2_lsp + +https://github.com/idris-community/idris2-lsp + +The Idris 2 language server. + +Plugins for the Idris 2 filetype include +[Idris2-Vim](https://github.com/edwinb/idris2-vim) (fewer features, stable) and +[Nvim-Idris2](https://github.com/ShinKage/nvim-idris2) (cutting-edge, +experimental). + +Idris2-Lsp requires a build of Idris 2 that includes the "Idris 2 API" package. +Package managers with known support for this build include the +[AUR](https://aur.archlinux.org/packages/idris2/) and +[Homebrew](https://formulae.brew.sh/formula/idris2#default). + +If your package manager does not support the Idris 2 API, you will need to build +Idris 2 from source. Refer to the +[the Idris 2 installation instructions](https://github.com/idris-lang/Idris2/blob/main/INSTALL.md) +for details. Steps 5 and 8 are listed as "optional" in that guide, but they are +necessary in order to make the Idris 2 API available. + +You need to install a version of Idris2-Lsp that is compatible with your +version of Idris 2. There should be a branch corresponding to every released +Idris 2 version after v0.4.0. Use the latest commit on that branch. For example, +if you have Idris v0.5.1, you should use the v0.5.1 branch of Idris2-Lsp. + +If your Idris 2 version is newer than the newest Idris2-Lsp branch, use the +latest commit on the `master` branch, and set a reminder to check the Idris2-Lsp +repo for the release of a compatible versioned branch. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.idris2_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "idris2-lsp" } + ``` + - `filetypes` : + ```lua + { "idris2" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## intelephense + +https://intelephense.com/ + +`intelephense` can be installed via `npm`: +```sh +npm install -g intelephense +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.intelephense.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "intelephense", "--stdio" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("composer.json", ".git") + ``` + + +## java_language_server + +https://github.com/georgewfraser/java-language-server + +Java language server + +Point `cmd` to `lang_server_linux.sh` or the equivalent script for macOS/Windows provided by java-language-server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.java_language_server.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "java" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## jdtls + +https://projects.eclipse.org/projects/eclipse.jdt.ls + +Language server for Java. + +IMPORTANT: If you want all the features jdtls has to offer, [nvim-jdtls](https://github.com/mfussenegger/nvim-jdtls) +is highly recommended. If all you need is diagnostics, completion, imports, gotos and formatting and some code actions +you can keep reading here. + +For manual installation you can download precompiled binaries from the +[official downloads site](http://download.eclipse.org/jdtls/snapshots/?d) +and ensure that the `PATH` variable contains the `bin` directory of the extracted archive. + +```lua + -- init.lua + require'lspconfig'.jdtls.setup{} +``` + +You can also pass extra custom jvm arguments with the JDTLS_JVM_ARGS environment variable as a space separated list of arguments, +that will be converted to multiple --jvm-arg= args when passed to the jdtls script. This will allow for example tweaking +the jvm arguments or integration with external tools like lombok: + +```sh +export JDTLS_JVM_ARGS="-javaagent:$HOME/.local/share/java/lombok.jar" +``` + +For automatic installation you can use the following unofficial installers/launchers under your own risk: + - [jdtls-launcher](https://github.com/eruizc-dev/jdtls-launcher) (Includes lombok support by default) + ```lua + -- init.lua + require'lspconfig'.jdtls.setup{ cmd = { 'jdtls' } } + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jdtls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "jdtls", "-configuration", "/home/runner/.cache/jdtls/config", "-data", "/home/runner/.cache/jdtls/workspace" } + ``` + - `filetypes` : + ```lua + { "java" } + ``` + - `handlers` : + ```lua + { + ["$/progress"] = , + ["language/status"] = , + ["textDocument/codeAction"] = , + ["textDocument/rename"] = , + ["workspace/applyEdit"] = + } + ``` + - `init_options` : + ```lua + { + jvm_args = {}, + workspace = "/home/runner/.cache/jdtls/workspace" + } + ``` + - `root_dir` : + ```lua + { + -- Single-module projects + { + 'build.xml', -- Ant + 'pom.xml', -- Maven + 'settings.gradle', -- Gradle + 'settings.gradle.kts', -- Gradle + }, + -- Multi-module projects + { 'build.gradle', 'build.gradle.kts' }, + } or vim.fn.getcwd() + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jedi_language_server + +https://github.com/pappasam/jedi-language-server + +`jedi-language-server`, a language server for Python, built on top of jedi + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jedi_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "jedi-language-server" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + vim's starting directory + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jsonls + +https://github.com/hrsh7th/vscode-langservers-extracted + +vscode-json-language-server, a language server for JSON and JSON schema + +`vscode-json-language-server` can be installed via `npm`: +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-json-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.jsonls.setup { + capabilities = capabilities, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jsonls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vscode-json-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "json", "jsonc" } + ``` + - `init_options` : + ```lua + { + provideFormatter = true + } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jsonnet_ls + +https://github.com/grafana/jsonnet-language-server + +A Language Server Protocol (LSP) server for Jsonnet. + +The language server can be installed with `go`: +```sh +go install github.com/grafana/jsonnet-language-server@latest +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jsonnet_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "jsonnet-language-server" } + ``` + - `filetypes` : + ```lua + { "jsonnet", "libsonnet" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("jsonnetfile.json") + ``` + + +## julials + +https://github.com/julia-vscode/julia-vscode + +LanguageServer.jl can be installed with `julia` and `Pkg`: +```sh +julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.add("LanguageServer")' +``` +where `~/.julia/environments/nvim-lspconfig` is the location where +the default configuration expects LanguageServer.jl to be installed. + +To update an existing install, use the following command: +```sh +julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.update()' +``` + +Note: In order to have LanguageServer.jl pick up installed packages or dependencies in a +Julia project, you must make sure that the project is instantiated: +```sh +julia --project=/path/to/my/project -e 'using Pkg; Pkg.instantiate()' +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.julials.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "julia", "--startup-file=no", "--history-file=no", "-e", ' # Load LanguageServer.jl: attempt to load from ~/.julia/environments/nvim-lspconfig\n # with the regular load path as a fallback\n ls_install_path = joinpath(\n get(DEPOT_PATH, 1, joinpath(homedir(), ".julia")),\n "environments", "nvim-lspconfig"\n )\n pushfirst!(LOAD_PATH, ls_install_path)\n using LanguageServer\n popfirst!(LOAD_PATH)\n depot_path = get(ENV, "JULIA_DEPOT_PATH", "")\n project_path = let\n dirname(something(\n ## 1. Finds an explicitly set project (JULIA_PROJECT)\n Base.load_path_expand((\n p = get(ENV, "JULIA_PROJECT", nothing);\n p === nothing ? nothing : isempty(p) ? nothing : p\n )),\n ## 2. Look for a Project.toml file in the current working directory,\n ## or parent directories, with $HOME as an upper boundary\n Base.current_project(),\n ## 3. First entry in the load path\n get(Base.load_path(), 1, nothing),\n ## 4. Fallback to default global environment,\n ## this is more or less unreachable\n Base.load_path_expand("@v#.#"),\n ))\n end\n @info "Running language server" VERSION pwd() project_path depot_path\n server = LanguageServer.LanguageServerInstance(stdin, stdout, project_path, depot_path)\n server.runlinter = true\n run(server)\n ' } + ``` + - `filetypes` : + ```lua + { "julia" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## kotlin_language_server + + A kotlin language server which was developed for internal usage and + released afterwards. Maintaining is not done by the original author, + but by fwcd. + + It is built via gradle and developed on github. + Source and additional description: + https://github.com/fwcd/kotlin-language-server + + This server requires vim to be aware of the kotlin-filetype. + You could refer for this capability to: + https://github.com/udalov/kotlin-vim (recommended) + Note that there is no LICENSE specified yet. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.kotlin_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "kotlin-language-server" } + ``` + - `filetypes` : + ```lua + { "kotlin" } + ``` + - `root_dir` : + ```lua + root_pattern("settings.gradle") + ``` + + +## lean3ls + +https://github.com/leanprover/lean-client-js/tree/master/lean-language-server + +Lean installation instructions can be found +[here](https://leanprover-community.github.io/get_started.html#regular-install). + +Once Lean is installed, you can install the Lean 3 language server by running +```sh +npm install -g lean-language-server +``` + +Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim), +that plugin fully handles the setup of the Lean language server, +and you shouldn't set up `lean3ls` both with it and `lspconfig`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lean3ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lean-language-server", "--stdio", "--", "-M", "4096", "-T", "100000" } + ``` + - `filetypes` : + ```lua + { "lean3" } + ``` + - `offset_encoding` : + ```lua + "utf-32" + ``` + - `root_dir` : + ```lua + root_pattern("leanpkg.toml") or root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## leanls + +https://github.com/leanprover/lean4 + +Lean installation instructions can be found +[here](https://leanprover-community.github.io/get_started.html#regular-install). + +The Lean 4 language server is built-in with a Lean 4 install +(and can be manually run with, e.g., `lean --server`). + +Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim), +that plugin fully handles the setup of the Lean language server, +and you shouldn't set up `leanls` both with it and `lspconfig`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.leanls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lake", "serve", "--" } + ``` + - `filetypes` : + ```lua + { "lean" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `options` : + ```lua + { + no_lake_lsp_cmd = { "lean", "--server" } + } + ``` + - `root_dir` : + ```lua + root_pattern("lakefile.lean", "lean-toolchain", "leanpkg.toml", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## lelwel_ls + +https://github.com/0x2a-42/lelwel + +Language server for lelwel grammars. + +You can install `lelwel-ls` via cargo: +```sh +cargo install --features="lsp" lelwel +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lelwel_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lelwel-ls" } + ``` + - `filetypes` : + ```lua + { "llw" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## lemminx + +https://github.com/eclipse/lemminx + +The easiest way to install the server is to get a binary from https://github.com/redhat-developer/vscode-xml/releases and place it on your PATH. + +NOTE to macOS users: Binaries from unidentified developers are blocked by default. If you trust the downloaded binary, run it once, cancel the prompt, then remove the binary from Gatekeeper quarantine with `xattr -d com.apple.quarantine lemminx`. It should now run without being blocked. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lemminx.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lemminx" } + ``` + - `filetypes` : + ```lua + { "xml", "xsd", "xsl", "xslt", "svg" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ltex + +https://github.com/valentjn/ltex-ls + +LTeX Language Server: LSP language server for LanguageTool 🔍✔️ with support for LaTeX 🎓, Markdown 📝, and others + +To install, download the latest [release](https://github.com/valentjn/ltex-ls/releases) and ensure `ltex-ls` is on your path. + +To support org files or R sweave, users can define a custom filetype autocommand (or use a plugin which defines these filetypes): + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.org set filetype=org ]] +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ltex.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ltex-ls" } + ``` + - `filetypes` : + ```lua + { "bib", "gitcommit", "markdown", "org", "plaintex", "rst", "rnoweb", "tex" } + ``` + - `get_language_id` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## luau_lsp + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.luau_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "luau-lsp", "lsp" } + ``` + - `filetypes` : + ```lua + { "luau" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## m68k + +https://github.com/grahambates/m68k-lsp + +Language server for Motorola 68000 family assembly + +`m68k-lsp-server` can be installed via `npm`: + +```sh +npm install -g m68k-lsp-server +``` + +Ensure you are using the 68k asm syntax variant in Neovim. + +```lua +vim.g.asmsyntax = 'asm68k' +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.m68k.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "m68k-lsp-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "asm68k" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## marksman + +https://github.com/artempyanykh/marksman + +Marksman is a Markdown LSP server providing completion, cross-references, diagnostics, and more. + +Marksman works on MacOS, Linux, and Windows and is distributed as a self-contained binary for each OS. + +Pre-built binaries can be downloaded from https://github.com/artempyanykh/marksman/releases + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.marksman.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "marksman", "server" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + root_pattern(".git", ".marksman.toml") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## metals + +https://scalameta.org/metals/ + +Scala language server with rich IDE features. + +See full instructions in the Metals documentation: + +https://scalameta.org/metals/docs/editors/vim#using-an-alternative-lsp-client + +Note: that if you're using [nvim-metals](https://github.com/scalameta/nvim-metals), that plugin fully handles the setup and installation of Metals, and you shouldn't set up Metals both with it and `lspconfig`. + +To install Metals, make sure to have [coursier](https://get-coursier.io/docs/cli-installation) installed, and once you do you can install the latest Metals with `cs install metals`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.metals.setup{} +``` + + +**Default values:** + - `capabilities` : + ```lua + { + workspace = { + configuration = false + } + } + ``` + - `cmd` : + ```lua + { "metals" } + ``` + - `filetypes` : + ```lua + { "scala" } + ``` + - `init_options` : + ```lua + { + compilerOptions = { + snippetAutoIndent = false + }, + isHttpEnabled = true, + statusBarProvider = "show-message" + } + ``` + - `message_level` : + ```lua + 4 + ``` + - `root_dir` : + ```lua + util.root_pattern("build.sbt", "build.sc", "build.gradle", "pom.xml") + ``` + + +## millet + +https://github.com/azdavis/millet + +Millet, a language server for Standard ML + +To use with nvim: + +1. Install a Rust toolchain: https://rustup.rs +2. Clone the repo +3. Run `cargo build --release --bin lang-srv` +4. Move `target/release/lang-srv` to somewhere on your $PATH as `millet` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.millet.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "millet" } + ``` + - `filetypes` : + ```lua + { "sml" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## mint + +https://www.mint-lang.com + +Install Mint using the [instructions](https://www.mint-lang.com/install). +The language server is included since version 0.12.0. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mint.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mint", "ls" } + ``` + - `filetypes` : + ```lua + { "mint" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## mlir_lsp_server + +https://mlir.llvm.org/docs/Tools/MLIRLSP/#mlir-lsp-language-server--mlir-lsp-server= + +The Language Server for the LLVM MLIR language + +`mlir-lsp-server` can be installed at the llvm-project repository (https://github.com/llvm/llvm-project) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mlir_lsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mlir-lsp-server" } + ``` + - `filetypes` : + ```lua + { "mlir" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## mlir_pdll_lsp_server + +https://mlir.llvm.org/docs/Tools/MLIRLSP/#pdll-lsp-language-server--mlir-pdll-lsp-server + +The Language Server for the LLVM PDLL language + +`mlir-pdll-lsp-server` can be installed at the llvm-project repository (https://github.com/llvm/llvm-project) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mlir_pdll_lsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mlir-pdll-lsp-server" } + ``` + - `filetypes` : + ```lua + { "pdll" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## mm0_ls + +https://github.com/digama0/mm0 + +Language Server for the metamath-zero theorem prover. + +Requires [mm0-rs](https://github.com/digama0/mm0/tree/master/mm0-rs) to be installed +and available on the `PATH`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mm0_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mm0-rs", "server" } + ``` + - `filetypes` : + ```lua + { "metamath-zero" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## move_analyzer + +https://github.com/move-language/move/tree/main/language/move-analyzer + +Language server for Move + +The `move-analyzer` can be installed by running: + +``` +cargo install --git https://github.com/move-language/move move-analyzer +``` + +See [`move-analyzer`'s doc](https://github.com/move-language/move/blob/1b258a06e3c7d2bc9174578aac92cca3ac19de71/language/move-analyzer/editors/code/README.md#how-to-install) for details. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.move_analyzer.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "move-analyzer" } + ``` + - `filetypes` : + ```lua + { "move" } + ``` + - `root_dir` : + ```lua + root_pattern("Move.toml") + ``` + + +## neocmake + +https://github.com/Decodetalkers/neocmakelsp + +CMake LSP Implementation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.neocmake.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "neocmakelsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "cmake" } + ``` + - `root_dir` : + ```lua + root_pattern('.git', 'cmake') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nickel_ls + +Nickel Language Server + +https://github.com/tweag/nickel + +`nls` can be installed with nix, or cargo, from the Nickel repository. +```sh +git clone https://github.com/tweag/nickel.git +``` + +Nix: +```sh +cd nickel +nix-env -f . -i +``` + +cargo: +```sh +cd nickel/lsp/nls +cargo install --path . +``` + +In order to have lspconfig detect Nickel filetypes (a prerequisite for autostarting a server), +install the [Nickel vim plugin](https://github.com/nickel-lang/vim-nickel). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nickel_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nls" } + ``` + - `filetypes` : + ```lua + { "ncl", "nickel" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## nil_ls + +https://github.com/oxalica/nil + +A new language server for Nix Expression Language. + +If you are using Nix with Flakes support, run `nix profile install github:oxalica/nil` to install. +Check the repository README for more information. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nil_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nil" } + ``` + - `filetypes` : + ```lua + { "nix" } + ``` + - `root_dir` : + ```lua + root_pattern("flake.nix", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nimls + +https://github.com/PMunch/nimlsp + +`nimlsp` can be installed via the `nimble` package manager: + +```sh +nimble install nimlsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nimls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nimlsp" } + ``` + - `filetypes` : + ```lua + { "nim" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ntt + +https://github.com/nokia/ntt +Installation instructions can be found [here](https://github.com/nokia/ntt#Install). +Can be configured by passing a "settings" object to `ntt.setup{}`: +```lua +require('lspconfig').ntt.setup{ + settings = { + ntt = { + } + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ntt.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ntt", "langserver" } + ``` + - `filetypes` : + ```lua + { "ttcn" } + ``` + - `root_dir` : + ```lua + util.root_pattern(".git") + ``` + + +## nxls + +https://github.com/nrwl/nx-console/tree/master/apps/nxls + +nxls, a language server for Nx Workspaces + +`nxls` can be installed via `npm`: +```sh +npm i -g nxls +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nxls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nxls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "json", "jsonc" } + ``` + - `root_dir` : + ```lua + util.root_pattern + ``` + + +## ocamlls + +https://github.com/ocaml-lsp/ocaml-language-server + +`ocaml-language-server` can be installed via `npm` +```sh +npm install -g ocaml-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ocamlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ocaml-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "ocaml", "reason" } + ``` + - `root_dir` : + ```lua + root_pattern("*.opam", "esy.json", "package.json") + ``` + + +## ocamllsp + +https://github.com/ocaml/ocaml-lsp + +`ocaml-lsp` can be installed as described in [installation guide](https://github.com/ocaml/ocaml-lsp#installation). + +To install the lsp server in a particular opam switch: +```sh +opam install ocaml-lsp-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ocamllsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ocamllsp" } + ``` + - `filetypes` : + ```lua + { "ocaml", "ocaml.menhir", "ocaml.interface", "ocaml.ocamllex", "reason", "dune" } + ``` + - `get_language_id` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("*.opam", "esy.json", "package.json", ".git", "dune-project", "dune-workspace") + ``` + + +## ols + + https://github.com/DanielGavin/ols + + `Odin Language Server`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ols.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ols" } + ``` + - `filetypes` : + ```lua + { "odin" } + ``` + - `root_dir` : + ```lua + util.root_pattern("ols.json", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## omnisharp + +https://github.com/omnisharp/omnisharp-roslyn +OmniSharp server based on Roslyn workspaces + +`omnisharp-roslyn` can be installed by downloading and extracting a release from [here](https://github.com/OmniSharp/omnisharp-roslyn/releases). +OmniSharp can also be built from source by following the instructions [here](https://github.com/omnisharp/omnisharp-roslyn#downloading-omnisharp). + +OmniSharp requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +**By default, omnisharp-roslyn doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. + +```lua +require'lspconfig'.omnisharp.setup { + cmd = { "dotnet", "/path/to/omnisharp/OmniSharp.dll" }, + + -- Enables support for reading code style, naming convention and analyzer + -- settings from .editorconfig. + enable_editorconfig_support = true, + + -- If true, MSBuild project system will only load projects for files that + -- were opened in the editor. This setting is useful for big C# codebases + -- and allows for faster initialization of code navigation features only + -- for projects that are relevant to code that is being edited. With this + -- setting enabled OmniSharp may load fewer projects and may thus display + -- incomplete reference lists for symbols. + enable_ms_build_load_projects_on_demand = false, + + -- Enables support for roslyn analyzers, code fixes and rulesets. + enable_roslyn_analyzers = false, + + -- Specifies whether 'using' directives should be grouped and sorted during + -- document formatting. + organize_imports_on_format = false, + + -- Enables support for showing unimported types and unimported extension + -- methods in completion lists. When committed, the appropriate using + -- directive will be added at the top of the current file. This option can + -- have a negative impact on initial completion responsiveness, + -- particularly for the first few completion sessions after opening a + -- solution. + enable_import_completion = false, + + -- Specifies whether to include preview versions of the .NET SDK when + -- determining which version to use for project loading. + sdk_include_prereleases = true, + + -- Only run analyzers against open files when 'enableRoslynAnalyzers' is + -- true + analyze_open_documents_only = false, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.omnisharp.setup{} +``` + + +**Default values:** + - `analyze_open_documents_only` : + ```lua + false + ``` + - `enable_editorconfig_support` : + ```lua + true + ``` + - `enable_import_completion` : + ```lua + false + ``` + - `enable_ms_build_load_projects_on_demand` : + ```lua + false + ``` + - `enable_roslyn_analyzers` : + ```lua + false + ``` + - `filetypes` : + ```lua + { "cs", "vb" } + ``` + - `init_options` : + ```lua + {} + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `organize_imports_on_format` : + ```lua + false + ``` + - `root_dir` : + ```lua + root_pattern(".sln") or root_pattern(".csproj") + ``` + - `sdk_include_prereleases` : + ```lua + true + ``` + + +## opencl_ls + +https://github.com/Galarius/opencl-language-server + +Build instructions can be found [here](https://github.com/Galarius/opencl-language-server/blob/main/_dev/build.md). + +Prebuilt binaries are available for Linux, macOS and Windows [here](https://github.com/Galarius/opencl-language-server/releases). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.opencl_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "opencl-language-server" } + ``` + - `filetypes` : + ```lua + { "opencl" } + ``` + - `root_dir` : + ```lua + util.root_pattern(".git") + ``` + + +## openscad_ls + +https://github.com/dzhu/openscad-language-server + +A Language Server Protocol server for OpenSCAD + +You can build and install `openscad-language-server` binary with `cargo`: +```sh +cargo install openscad-language-server +``` + +Vim does not have built-in syntax for the `openscad` filetype currently. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.scad set filetype=openscad ]] +``` + +or by installing a filetype plugin such as https://github.com/sirtaj/vim-openscad + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.openscad_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "openscad-language-server" } + ``` + - `filetypes` : + ```lua + { "openscad" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## pasls + +https://github.com/genericptr/pascal-language-server + +An LSP server implementation for Pascal variants that are supported by Free Pascal, including Object Pascal. It uses CodeTools from Lazarus as backend. + +First set `cmd` to the Pascal lsp binary. + +Customization options are passed to pasls as environment variables for example in your `.bashrc`: +```bash +export FPCDIR='/usr/lib/fpc/src' # FPC source directory (This is the only required option for the server to work). +export PP='/usr/lib/fpc/3.2.2/ppcx64' # Path to the Free Pascal compiler executable. +export LAZARUSDIR='/usr/lib/lazarus' # Path to the Lazarus sources. +export FPCTARGET='' # Target operating system for cross compiling. +export FPCTARGETCPU='x86_64' # Target CPU for cross compiling. +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pasls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pasls" } + ``` + - `filetypes` : + ```lua + { "pascal" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## perlls + +https://github.com/richterger/Perl-LanguageServer/tree/master/clients/vscode/perl + +`Perl-LanguageServer`, a language server for Perl. + +To use the language server, ensure that you have Perl::LanguageServer installed and perl command is on your path. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.perlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "perl", "-MPerl::LanguageServer", "-e", "Perl::LanguageServer::run", "--", "--port 13603", "--nostdio 0", "--version 2.1.0" } + ``` + - `filetypes` : + ```lua + { "perl" } + ``` + - `root_dir` : + ```lua + vim's starting directory + ``` + - `settings` : + ```lua + { + perl = { + fileFilter = { ".pm", ".pl" }, + ignoreDirs = ".git", + perlCmd = "perl", + perlInc = " " + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## perlnavigator + +https://github.com/bscan/PerlNavigator + +A Perl language server + +**By default, perlnavigator doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. +You have to install the language server manually. + +Clone the PerlNavigator repo, install based on the [instructions](https://github.com/bscan/PerlNavigator#installation-for-other-editors), +and point `cmd` to `server.js` inside the `server/out` directory: + +```lua +cmd = {'node', '/server/out/server.js', '--stdio'} +``` + +At minimum, you will need `perl` in your path. If you want to use a non-standard `perl` you will need to set your configuration like so: +```lua +settings = { + perlnavigator = { + perlPath = '/some/odd/location/my-perl' + } +} +``` + +The `contributes.configuration.properties` section of `perlnavigator`'s `package.json` has all available configuration settings. All +settings have a reasonable default, but, at minimum, you may want to point `perlnavigator` at your `perltidy` and `perlcritic` configurations. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.perlnavigator.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + {} + ``` + - `filetypes` : + ```lua + { "perl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## perlpls + +https://github.com/FractalBoy/perl-language-server +https://metacpan.org/pod/PLS + +`PLS`, another language server for Perl. + +To use the language server, ensure that you have PLS installed and that it is in your path + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.perlpls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pls" } + ``` + - `filetypes` : + ```lua + { "perl" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `settings` : + ```lua + { + perl = { + perlcritic = { + enabled = false + }, + syntax = { + enabled = true + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## phan + +https://github.com/phan/phan + +Installation: https://github.com/phan/phan#getting-started + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.phan.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "phan", "-m", "json", "--no-color", "--no-progress-bar", "-x", "-u", "-S", "--language-server-on-stdin", "--allow-polyfill-parser" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("composer.json", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## phpactor + +https://github.com/phpactor/phpactor + +Installation: https://phpactor.readthedocs.io/en/master/usage/standalone.html#global-installation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.phpactor.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "phpactor", "language-server" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("composer.json", ".git") + ``` + + +## please + +https://github.com/thought-machine/please + +High-performance extensible build system for reproducible multi-language builds. + +The `plz` binary will automatically install the LSP for you on first run + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.please.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "plz", "tool", "lps" } + ``` + - `filetypes` : + ```lua + { "bzl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## powershell_es + +https://github.com/PowerShell/PowerShellEditorServices + +Language server for PowerShell. + +To install, download and extract PowerShellEditorServices.zip +from the [releases](https://github.com/PowerShell/PowerShellEditorServices/releases). +To configure the language server, set the property `bundle_path` to the root +of the extracted PowerShellEditorServices.zip. + +The default configuration doesn't set `cmd` unless `bundle_path` is specified. + +```lua +require'lspconfig'.powershell_es.setup{ + bundle_path = 'c:/w/PowerShellEditorServices', +} +``` + +By default the languageserver is started in `pwsh` (PowerShell Core). This can be changed by specifying `shell`. + +```lua +require'lspconfig'.powershell_es.setup{ + bundle_path = 'c:/w/PowerShellEditorServices', + shell = 'powershell.exe', +} +``` + +Note that the execution policy needs to be set to `Unrestricted` for the languageserver run under PowerShell + +If necessary, specific `cmd` can be defined instead of `bundle_path`. +See [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices#stdio) +to learn more. + +```lua +require'lspconfig'.powershell_es.setup{ + cmd = {'pwsh', '-NoLogo', '-NoProfile', '-Command', "c:/PSES/Start-EditorServices.ps1 ..."} +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.powershell_es.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "ps1" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + git root or current directory + ``` + - `shell` : + ```lua + "pwsh" + ``` + - `single_file_support` : + ```lua + true + ``` + + +## prismals + +Language Server for the Prisma JavaScript and TypeScript ORM + +`@prisma/language-server` can be installed via npm +```sh +npm install -g @prisma/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.prismals.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "prisma-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "prisma" } + ``` + - `root_dir` : + ```lua + root_pattern(".git", "package.json") + ``` + - `settings` : + ```lua + { + prisma = { + prismaFmtBinPath = "" + } + } + ``` + + +## prolog_ls + + https://github.com/jamesnvc/lsp_server + + Language Server Protocol server for SWI-Prolog + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.prolog_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "swipl", "-g", "use_module(library(lsp_server)).", "-g", "lsp_server:main", "-t", "halt", "--", "stdio" } + ``` + - `filetypes` : + ```lua + { "prolog" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## prosemd_lsp + +https://github.com/kitten/prosemd-lsp + +An experimental LSP for Markdown. + +Please see the manual installation instructions: https://github.com/kitten/prosemd-lsp#manual-installation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.prosemd_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "prosemd-lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + + ``` + - `single_file_support` : + ```lua + true + ``` + + +## psalm + +https://github.com/vimeo/psalm + +Can be installed with composer. +```sh +composer global require vimeo/psalm +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.psalm.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "psalm-language-server" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("psalm.xml", "psalm.xml.dist") + ``` + + +## puppet + +LSP server for Puppet. + +Installation: + +- Clone the editor-services repository: + https://github.com/puppetlabs/puppet-editor-services + +- Navigate into that directory and run: `bundle install` + +- Install the 'puppet-lint' gem: `gem install puppet-lint` + +- Add that repository to $PATH. + +- Ensure you can run `puppet-languageserver` from outside the editor-services directory. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.puppet.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "puppet-languageserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "puppet" } + ``` + - `root_dir` : + ```lua + root_pattern("manifests", ".puppet-lint.rc", "hiera.yaml", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## purescriptls + +https://github.com/nwolverson/purescript-language-server + +The `purescript-language-server` can be added to your project and `$PATH` via + +* JavaScript package manager such as npm, pnpm, Yarn, et al. +* Nix under the `nodePackages` and `nodePackages_latest` package sets + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.purescriptls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "purescript-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "purescript" } + ``` + - `root_dir` : + ```lua + root_pattern('spago.dhall', 'psc-package.json', 'bower.json', 'flake.nix', 'shell.nix'), + ``` + + +## pylsp + +https://github.com/python-lsp/python-lsp-server + +A Python 3.6+ implementation of the Language Server Protocol. + +See the [project's README](https://github.com/python-lsp/python-lsp-server) for installation instructions. + +Configuration options are documented [here](https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md). +In order to configure an option, it must be translated to a nested Lua table and included in the `settings` argument to the `setup{}` function. +For example, in order to set the `pylsp.plugins.pycodestyle.ignore` option: +```lua +require'lspconfig'.pylsp.setup{ + settings = { + pylsp = { + plugins = { + pycodestyle = { + ignore = {'W391'}, + maxLineLength = 100 + } + } + } + } +} +``` + +Note: This is a community fork of `pyls`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pylsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pylsp" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## pyre + +https://pyre-check.org/ + +`pyre` a static type checker for Python 3. + +`pyre` offers an extremely limited featureset. It currently only supports diagnostics, +which are triggered on save. + +Do not report issues for missing features in `pyre` to `lspconfig`. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pyre.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pyre", "persistent" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## pyright + +https://github.com/microsoft/pyright + +`pyright`, a static type checker and language server for python + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pyright.setup{} +``` +**Commands:** +- PyrightOrganizeImports: Organize Imports + +**Default values:** + - `cmd` : + ```lua + { "pyright-langserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + python = { + analysis = { + autoSearchPaths = true, + diagnosticMode = "workspace", + useLibraryCodeForTypes = true + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## qml_lsp + +https://invent.kde.org/sdk/qml-lsp + +LSP implementation for QML (autocompletion, live linting, etc. in editors) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.qml_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "qml-lsp" } + ``` + - `filetypes` : + ```lua + { "qmljs" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## qmlls + +https://github.com/qt/qtdeclarative + +LSP implementation for QML (autocompletion, live linting, etc. in editors), + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.qmlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "qmlls" } + ``` + - `filetypes` : + ```lua + { "qmljs" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## quick_lint_js + +https://quick-lint-js.com/ + +quick-lint-js finds bugs in JavaScript programs. + +See installation [instructions](https://quick-lint-js.com/install/) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.quick_lint_js.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "quick-lint-js", "--lsp-server" } + ``` + - `filetypes` : + ```lua + { "javascript" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## r_language_server + +[languageserver](https://github.com/REditorSupport/languageserver) is an +implementation of the Microsoft's Language Server Protocol for the R +language. + +It is released on CRAN and can be easily installed by + +```R +install.packages("languageserver") +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.r_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "R", "--slave", "-e", "languageserver::run()" } + ``` + - `filetypes` : + ```lua + { "r", "rmd" } + ``` + - `log_level` : + ```lua + 2 + ``` + - `root_dir` : + ```lua + root_pattern(".git") or os_homedir + ``` + + +## racket_langserver + +[https://github.com/jeapostrophe/racket-langserver](https://github.com/jeapostrophe/racket-langserver) + +The Racket language server. This project seeks to use +[DrRacket](https://github.com/racket/drracket)'s public API to provide +functionality that mimics DrRacket's code tools as closely as possible. + +Install via `raco`: `raco pkg install racket-langserver` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.racket_langserver.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "racket", "--lib", "racket-langserver" } + ``` + - `filetypes` : + ```lua + { "racket", "scheme" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## reason_ls + +Reason language server + +You can install reason language server from [reason-language-server](https://github.com/jaredly/reason-language-server) repository. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.reason_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "reason-language-server" } + ``` + - `filetypes` : + ```lua + { "reason" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## relay_lsp + + https://github.com/facebook/relay + `Relay` is a JavaScript framework for building data-driven React applications + + Setup: + + - Make sure you have a Relay config file somewhere in your project. + - We support standard config file formats (`.yml`, `.js`, `.json`), and the the `relay` field in your `package.json` + - Make sure you have the `relay-compiler` installed in your project. The bare minimum is v13. + - Make sure you are able to run the `relay-compiler` command from the command line. If `yarn relay-compiler` works, it's very likely that the LSP will work. + - Remove / disable any conflicting GraphQL LSPs you have installed. + + Relay LSP is a part of the Relay Compiler binary and available when adding `relay-compiler` to your project's devDependencies. + + ```lua + require'lspconfig'.relay_lsp.setup { + -- (default: false) Whether or not we should automatically start + -- the Relay Compiler in watch mode when you open a project + auto_start_compiler = false, + + + -- (default: null) Path to a relay config relative to the + -- `root_dir`. Without this, the compiler will search for your + -- config. This is helpful if your relay project is in a nested + -- directory. + path_to_config = nil, + } + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.relay_lsp.setup{} +``` + + +**Default values:** + - `auto_start_compiler` : + ```lua + false + ``` + - `cmd` : + ```lua + { "relay-compiler", "lsp" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" } + ``` + - `handlers` : + ```lua + { + ["window/showStatus"] = + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("relay.config.*", "package.json") + ``` + + +## remark_ls + +https://github.com/remarkjs/remark-language-server + +`remark-language-server` can be installed via `npm`: +```sh +npm install -g remark-language-server +``` + +`remark-language-server` uses the same +[configuration files](https://github.com/remarkjs/remark/tree/main/packages/remark-cli#example-config-files-json-yaml-js) +as `remark-cli`. + +This uses a plugin based system. Each plugin needs to be installed locally using `npm` or `yarn`. + +For example, given the following `.remarkrc.json`: + +```json +{ + "presets": [ + "remark-preset-lint-recommended" + ] +} +``` + +`remark-preset-lint-recommended` needs to be installed in the local project: + +```sh +npm install remark-preset-lint-recommended +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.remark_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "remark-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## rescriptls + +https://github.com/rescript-lang/rescript-vscode + +ReScript language server + +**By default, rescriptls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. +You have to install the language server manually. + +You can use the bundled language server inside the [vim-rescript](https://github.com/rescript-lang/vim-rescript) repo. + +Clone the vim-rescript repo and point `cmd` to `server.js` inside `server/out` directory: + +```lua +cmd = {'node', '/server/out/server.js', '--stdio'} + +``` + +If you have vim-rescript installed you can also use that installation. for example if you're using packer.nvim you can set cmd to something like this: + +```lua +cmd = { + 'node', + '/home/username/.local/share/nvim/site/pack/packer/start/vim-rescript/server/out/server.js', + '--stdio' +} +``` + +Another option is to use vscode extension [release](https://github.com/rescript-lang/rescript-vscode/releases). +Take a look at [here](https://github.com/rescript-lang/rescript-vscode#use-with-other-editors) for instructions. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rescriptls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + {} + ``` + - `filetypes` : + ```lua + { "rescript" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## rls + +https://github.com/rust-lang/rls + +rls, a language server for Rust + +See https://github.com/rust-lang/rls#setup to setup rls itself. +See https://github.com/rust-lang/rls#configuration for rls-specific settings. +All settings listed on the rls configuration section of the readme +must be set under settings.rust as follows: + +```lua +nvim_lsp.rls.setup { + settings = { + rust = { + unstable_features = true, + build_on_save = false, + all_features = true, + }, + }, +} +``` + +If you want to use rls for a particular build, eg nightly, set cmd as follows: + +```lua +cmd = {"rustup", "run", "nightly", "rls"} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rls" } + ``` + - `filetypes` : + ```lua + { "rust" } + ``` + - `root_dir` : + ```lua + root_pattern("Cargo.toml") + ``` + + +## rnix + +https://github.com/nix-community/rnix-lsp + +A language server for Nix providing basic completion and formatting via nixpkgs-fmt. + +To install manually, run `cargo install rnix-lsp`. If you are using nix, rnix-lsp is in nixpkgs. + +This server accepts configuration via the `settings` key. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rnix.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rnix-lsp" } + ``` + - `filetypes` : + ```lua + { "nix" } + ``` + - `init_options` : + ```lua + {} + ``` + - `root_dir` : + ```lua + vim's starting directory + ``` + - `settings` : + ```lua + {} + ``` + + +## robotframework_ls + +https://github.com/robocorp/robotframework-lsp + +Language Server Protocol implementation for Robot Framework. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.robotframework_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "robotframework_ls" } + ``` + - `filetypes` : + ```lua + { "robot" } + ``` + - `root_dir` : + ```lua + util.root_pattern('robotidy.toml', 'pyproject.toml')(fname) or util.find_git_ancestor(fname) + ``` + + +## rome + +https://rome.tools + +Language server for the Rome Frontend Toolchain. + +```sh +npm install [-g] rome +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rome.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rome", "lsp-proxy" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "json", "typescript", "typescript.tsx", "typescriptreact" } + ``` + - `root_dir` : + ```lua + root_pattern('package.json', 'node_modules', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ruby_ls + +https://shopify.github.io/ruby-lsp/ + +This gem is an implementation of the language server protocol specification for +Ruby, used to improve editor features. + +Install the gem. There's no need to require it, since the server is used as a +standalone executable. + +```sh +group :development do + gem "ruby-lsp", require: false +end +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ruby_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ruby-lsp" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `init_options` : + ```lua + { + enabledFeatures = { "codeActions", "diagnostics", "documentHighlights", "documentSymbols", "formatting", "inlayHint" } + } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + + +## rust_analyzer + +https://github.com/rust-analyzer/rust-analyzer + +rust-analyzer (aka rls 2.0), a language server for Rust + +See [docs](https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/user#settings) for extra settings. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rust_analyzer.setup{} +``` +**Commands:** +- CargoReload: Reload current cargo workspace + +**Default values:** + - `cmd` : + ```lua + { "rust-analyzer" } + ``` + - `filetypes` : + ```lua + { "rust" } + ``` + - `root_dir` : + ```lua + root_pattern("Cargo.toml", "rust-project.json") + ``` + - `settings` : + ```lua + { + ["rust-analyzer"] = {} + } + ``` + + +## salt_ls + +Language server for Salt configuration files. +https://github.com/dcermak/salt-lsp + +The language server can be installed with `pip`: +```sh +pip install salt-lsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.salt_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "salt_lsp_server" } + ``` + - `filetypes` : + ```lua + { "sls" } + ``` + - `root_dir` : + ```lua + root_pattern('.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## scheme_langserver + +https://github.com/ufo5260987423/scheme-langserver +`scheme-langserver`, a language server protocol implementation for scheme. +And for nvim user, please add .sls to scheme file extension list. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.scheme_langserver.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "scheme-langserver" } + ``` + - `filetypes` : + ```lua + { "scheme" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## scry + +https://github.com/crystal-lang-tools/scry + +Crystal language server. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.scry.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "scry" } + ``` + - `filetypes` : + ```lua + { "crystal" } + ``` + - `root_dir` : + ```lua + root_pattern('shard.yml', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## serve_d + + https://github.com/Pure-D/serve-d + + `Microsoft language server protocol implementation for D using workspace-d.` + Download a binary from https://github.com/Pure-D/serve-d/releases and put it in your $PATH. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.serve_d.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "serve-d" } + ``` + - `filetypes` : + ```lua + { "d" } + ``` + - `root_dir` : + ```lua + util.root_pattern("dub.json", "dub.sdl", ".git") + ``` + + +## sixtyfps + +https://github.com/sixtyfpsui/sixtyfps +`SixtyFPS`'s language server + +You can build and install `sixtyfps-lsp` binary with `cargo`: +```sh +cargo install sixtyfps-lsp +``` + +Vim does not have built-in syntax for the `sixtyfps` filetype currently. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.60 set filetype=sixtyfps ]] +``` + +or by installing a filetype plugin such as https://github.com/RustemB/sixtyfps-vim + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sixtyfps.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sixtyfps-lsp" } + ``` + - `filetypes` : + ```lua + { "sixtyfps" } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## slint_lsp + +https://github.com/slint-ui/slint +`Slint`'s language server + +You can build and install `slint-lsp` binary with `cargo`: +```sh +cargo install slint-lsp +``` + +Vim does not have built-in syntax for the `slint` filetype at this time. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.slint set filetype=slint ]] +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.slint_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "slint-lsp" } + ``` + - `filetypes` : + ```lua + { "slint" } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## smarty_ls + +https://github.com/landeaux/vscode-smarty-langserver-extracted + +Language server for Smarty. + +`smarty-language-server` can be installed via `npm`: + +```sh +npm i -g vscode-smarty-langserver-extracted +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.smarty_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "smarty-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "smarty" } + ``` + - `init_options` : + ```lua + {} + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + css = { + validate = true + }, + smarty = { + pluginDirs = {} + } + } + ``` + + +## solang + +A language server for Solidity + +See the [documentation](https://solang.readthedocs.io/en/latest/installing.html) for installation instructions. + +The language server only provides the following capabilities: +* Syntax highlighting +* Diagnostics +* Hover + +There is currently no support for completion, goto definition, references, or other functionality. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solang.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solang", "--language-server", "--target", "ewasm" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## solargraph + +https://solargraph.org/ + +solargraph, a language server for Ruby + +You can install solargraph via gem install. + +```sh +gem install --user-install solargraph +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solargraph.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solargraph", "stdio" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `init_options` : + ```lua + { + formatting = true + } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + - `settings` : + ```lua + { + solargraph = { + diagnostics = true + } + } + ``` + + +## solc + +https://docs.soliditylang.org/en/latest/installing-solidity.html + +solc is the native language server for the Solidity language. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solc.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solc", "--lsp" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + root_pattern('hardhat.config.*', '.git') + ``` + + +## solidity + +https://github.com/qiuxiang/solidity-ls + +npm i solidity-ls -g + +Make sure that solc is installed and it's the same version of the file. solc-select is recommended. + +Solidity language server is a LSP with autocomplete, go to definition and diagnostics. + +If you use brownie, use this root_dir: +root_dir = util.root_pattern('brownie-config.yaml', '.git') + +on includePath, you can add an extra path to search for external libs, on remapping you can remap lib <> path, like: + +```lua +{ solidity = { includePath = '/Users/your_user/.brownie/packages/', remapping = { ["@OpenZeppelin/"] = 'OpenZeppelin/openzeppelin-contracts@4.6.0/' } } } +``` + +**For brownie users** +Change the root_dir to: + +```lua +root_pattern("brownie-config.yaml", ".git") +``` + +The best way of using it is to have a package.json in your project folder with the packages that you will use. +After installing with package.json, just create a `remappings.txt` with: + +``` +@OpenZeppelin/=node_modules/OpenZeppelin/openzeppelin-contracts@4.6.0/ +``` + +You can omit the node_modules as well. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solidity.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solidity-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") + ``` + - `settings` : + ```lua + { + solidity = { + includePath = "", + remapping = {} + } + } + ``` + + +## solidity_ls + +npm install -g solidity-language-server + +solidity-language-server is a language server for the solidity language ported from the vscode solidity extension + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solidity_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solidity-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + root_pattern(".git", "package.json") + ``` + + +## sorbet + +https://sorbet.org + +Sorbet is a fast, powerful type checker designed for Ruby. + +You can install Sorbet via gem install. You might also be interested in how to set +Sorbet up for new projects: https://sorbet.org/docs/adopting. + +```sh +gem install sorbet +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sorbet.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "srb", "tc", "--lsp" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + + +## sourcekit + +https://github.com/apple/sourcekit-lsp + +Language server for Swift and C/C++/Objective-C. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sourcekit.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sourcekit-lsp" } + ``` + - `filetypes` : + ```lua + { "swift", "c", "cpp", "objective-c", "objective-cpp" } + ``` + - `root_dir` : + ```lua + root_pattern("Package.swift", ".git") + ``` + + +## sourcery + +https://github.com/sourcery-ai/sourcery + +Refactor Python instantly using the power of AI. + +It requires the init_options param to be populated as shown below and will respond with the list of ServerCapabilities that it supports: + +```lua +require'lspconfig'.sourcery.setup { + init_options = { + --- The Sourcery token for authenticating the user. + --- This is retrieved from the Sourcery website and must be + --- provided by each user. The extension must provide a + --- configuration option for the user to provide this value. + token = , + + --- The extension's name and version as defined by the extension. + extension_version = 'vim.lsp', + + --- The editor's name and version as defined by the editor. + editor_version = 'vim', + }, +} +``` + +Alternatively, you can login to sourcery by running `sourcery login` with sourcery-cli. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sourcery.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sourcery", "lsp" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `init_options` : + ```lua + { + editor_version = "vim", + extension_version = "vim.lsp" + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## spectral + +https://github.com/luizcorreia/spectral-language-server + `A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v2 & v3.` + +`spectral-language-server` can be installed via `npm`: +```sh +npm i -g spectral-language-server +``` +See [vscode-spectral](https://github.com/stoplightio/vscode-spectral#extension-settings) for configuration options. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.spectral.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "spectral-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml", "json", "yml" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + enable = true, + run = "onType", + validateLanguages = { "yaml", "json", "yml" } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## sqlls + +https://github.com/joe-re/sql-language-server + +This LSP can be installed via `npm`. Find further instructions on manual installation of the sql-language-server at [joe-re/sql-language-server](https://github.com/joe-re/sql-language-server). +
+ + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sqlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sql-language-server", "up", "--method", "stdio" } + ``` + - `filetypes` : + ```lua + { "sql", "mysql" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## sqls + +https://github.com/lighttiger2505/sqls + +```lua +require'lspconfig'.sqls.setup{ + cmd = {"path/to/command", "-config", "path/to/config.yml"}; + ... +} +``` +Sqls can be installed via `go get github.com/lighttiger2505/sqls`. Instructions for compiling Sqls from the source can be found at [lighttiger2505/sqls](https://github.com/lighttiger2505/sqls). + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sqls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sqls" } + ``` + - `filetypes` : + ```lua + { "sql", "mysql" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## starlark-rust + +https://github.com/facebookexperimental/starlark-rust/ +The LSP part of `starlark-rust` is not currently documented, + but the implementation works well for linting. +This gives valuable warnings for potential issues in the code, +but does not support refactorings. + +It can be installed with cargo: https://crates.io/crates/starlark + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.starlark-rust.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "starlark", "--lsp" } + ``` + - `filetypes` : + ```lua + { "star", "bzl", "BUILD.bazel" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## steep + +https://github.com/soutaro/steep + +`steep` is a static type checker for Ruby. + +You need `Steepfile` to make it work. Generate it with `steep init`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.steep.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "steep", "langserver" } + ``` + - `filetypes` : + ```lua + { "ruby", "eruby" } + ``` + - `root_dir` : + ```lua + root_pattern("Steepfile", ".git") + ``` + + +## stylelint_lsp + +https://github.com/bmatcuk/stylelint-lsp + +`stylelint-lsp` can be installed via `npm`: + +```sh +npm i -g stylelint-lsp +``` + +Can be configured by passing a `settings.stylelintplus` object to `stylelint_lsp.setup`: + +```lua +require'lspconfig'.stylelint_lsp.setup{ + settings = { + stylelintplus = { + -- see available options in stylelint-lsp documentation + } + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.stylelint_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "stylelint-lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "css", "less", "scss", "sugarss", "vue", "wxss", "javascript", "javascriptreact", "typescript", "typescriptreact" } + ``` + - `root_dir` : + ```lua + root_pattern('.stylelintrc', 'package.json') + ``` + - `settings` : + ```lua + {} + ``` + + +## sumneko_lua + +https://github.com/sumneko/lua-language-server + +Lua language server. + +`lua-language-server` can be installed by following the instructions [here](https://github.com/sumneko/lua-language-server/wiki/Getting-Started#command-line). + +The default `cmd` assumes that the `lua-language-server` binary can be found in `$PATH`. + +If you primarily use `lua-language-server` for Neovim, and want to provide completions, +analysis, and location handling for plugins on runtime path, you can use the following +settings. + +Note: that these settings will meaningfully increase the time until `lua-language-server` can service +initial requests (completion, location) upon starting as well as time to first diagnostics. +Completion results will include a workspace indexing progress message until the server has finished indexing. + +```lua +require'lspconfig'.sumneko_lua.setup { + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT', + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = {'vim'}, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = vim.api.nvim_get_runtime_file("", true), + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + }, + }, +} +``` + +See `lua-language-server`'s [documentation](https://github.com/sumneko/lua-language-server/blob/master/locale/en-us/setting.lua) for an explanation of the above fields: +* [Lua.runtime.path](https://github.com/sumneko/lua-language-server/blob/076dd3e5c4e03f9cef0c5757dfa09a010c0ec6bf/locale/en-us/setting.lua#L5-L13) +* [Lua.workspace.library](https://github.com/sumneko/lua-language-server/blob/076dd3e5c4e03f9cef0c5757dfa09a010c0ec6bf/locale/en-us/setting.lua#L77-L78) + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sumneko_lua.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lua-language-server" } + ``` + - `filetypes` : + ```lua + { "lua" } + ``` + - `log_level` : + ```lua + 2 + ``` + - `root_dir` : + ```lua + root_pattern(".luarc.json", ".luarc.jsonc", ".luacheckrc", ".stylua.toml", "stylua.toml", "selene.toml", "selene.yml", ".git") + ``` + - `settings` : + ```lua + { + Lua = { + telemetry = { + enable = false + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## svelte + +https://github.com/sveltejs/language-tools/tree/master/packages/language-server + +Note: assuming that [tsserver](#tsserver) is setup, full JavaScript/TypeScript support (find references, rename, etc of symbols in Svelte files when working in JS/TS files) requires per-project installation and configuration of [typescript-svelte-plugin](https://github.com/sveltejs/language-tools/tree/master/packages/typescript-plugin#usage). + +`svelte-language-server` can be installed via `npm`: +```sh +npm install -g svelte-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.svelte.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "svelteserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "svelte" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") + ``` + + +## svlangserver + +https://github.com/imc-trading/svlangserver + +Language server for SystemVerilog. + +`svlangserver` can be installed via `npm`: + +```sh +$ npm install -g @imc-trading/svlangserver +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.svlangserver.setup{} +``` +**Commands:** +- SvlangserverBuildIndex: Instructs language server to rerun indexing +- SvlangserverReportHierarchy: Generates hierarchy for the given module + +**Default values:** + - `cmd` : + ```lua + { "svlangserver" } + ``` + - `filetypes` : + ```lua + { "verilog", "systemverilog" } + ``` + - `root_dir` : + ```lua + root_pattern(".svlangserver", ".git") + ``` + - `settings` : + ```lua + { + systemverilog = { + includeIndexing = { "*.{v,vh,sv,svh}", "**/*.{v,vh,sv,svh}" } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## svls + +https://github.com/dalance/svls + +Language server for verilog and SystemVerilog + +`svls` can be installed via `cargo`: + ```sh + cargo install svls + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.svls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "svls" } + ``` + - `filetypes` : + ```lua + { "verilog", "systemverilog" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## syntax_tree + +https://ruby-syntax-tree.github.io/syntax_tree/ + +A fast Ruby parser and formatter. + +Syntax Tree is a suite of tools built on top of the internal CRuby parser. It +provides the ability to generate a syntax tree from source, as well as the +tools necessary to inspect and manipulate that syntax tree. It can be used to +build formatters, linters, language servers, and more. + +```sh +gem install syntax_tree +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.syntax_tree.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "stree", "lsp" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `root_dir` : + ```lua + root_pattern(".streerc", "Gemfile", ".git") + ``` + + +## tailwindcss + +https://github.com/tailwindlabs/tailwindcss-intellisense + +Tailwind CSS Language Server can be installed via npm: +```sh +npm install -g @tailwindcss/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tailwindcss.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tailwindcss-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "aspnetcorerazor", "astro", "astro-markdown", "blade", "django-html", "htmldjango", "edge", "eelixir", "elixir", "ejs", "erb", "eruby", "gohtml", "haml", "handlebars", "hbs", "html", "html-eex", "heex", "jade", "leaf", "liquid", "markdown", "mdx", "mustache", "njk", "nunjucks", "php", "razor", "slim", "twig", "css", "less", "postcss", "sass", "scss", "stylus", "sugarss", "javascript", "javascriptreact", "reason", "rescript", "typescript", "typescriptreact", "vue", "svelte" } + ``` + - `init_options` : + ```lua + { + userLanguages = { + eelixir = "html-eex", + eruby = "erb" + } + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern('tailwind.config.js', 'tailwind.config.ts', 'postcss.config.js', 'postcss.config.ts', 'package.json', 'node_modules', '.git') + ``` + - `settings` : + ```lua + { + tailwindCSS = { + classAttributes = { "class", "className", "classList", "ngClass" }, + lint = { + cssConflict = "warning", + invalidApply = "error", + invalidConfigPath = "error", + invalidScreen = "error", + invalidTailwindDirective = "error", + invalidVariant = "error", + recommendedVariantOrder = "warning" + }, + validate = true + } + } + ``` + + +## taplo + +https://taplo.tamasfe.dev/cli/usage/language-server.html + +Language server for Taplo, a TOML toolkit. + +`taplo-cli` can be installed via `cargo`: +```sh +cargo install --features lsp --locked taplo-cli +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.taplo.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "taplo", "lsp", "stdio" } + ``` + - `filetypes` : + ```lua + { "toml" } + ``` + - `root_dir` : + ```lua + root_pattern("*.toml", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## tblgen_lsp_server + +https://mlir.llvm.org/docs/Tools/MLIRLSP/#tablegen-lsp-language-server--tblgen-lsp-server + +The Language Server for the LLVM TableGen language + +`tblgen-lsp-server` can be installed at the llvm-project repository (https://github.com/llvm/llvm-project) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tblgen_lsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tblgen-lsp-server" } + ``` + - `filetypes` : + ```lua + { "tablegen" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## teal_ls + +https://github.com/teal-language/teal-language-server + +Install with: +``` +luarocks install --dev teal-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.teal_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "teal-language-server" } + ``` + - `filetypes` : + ```lua + { "teal" } + ``` + - `root_dir` : + ```lua + root_pattern("tlconfig.lua", ".git") + ``` + + +## terraform_lsp + +https://github.com/juliosueiras/terraform-lsp + +Terraform language server +Download a released binary from +https://github.com/juliosueiras/terraform-lsp/releases. + +From https://github.com/hashicorp/terraform-ls#terraform-ls-vs-terraform-lsp: + +Both HashiCorp and the maintainer of terraform-lsp expressed interest in +collaborating on a language server and are working towards a _long-term_ +goal of a single stable and feature-complete implementation. + +For the time being both projects continue to exist, giving users the +choice: + +- `terraform-ls` providing + - overall stability (by relying only on public APIs) + - compatibility with any provider and any Terraform >=0.12.0 currently + less features + - due to project being younger and relying on public APIs which may + not offer the same functionality yet + +- `terraform-lsp` providing + - currently more features + - compatibility with a single particular Terraform (0.12.20 at time of writing) + - configs designed for other 0.12 versions may work, but interpretation may be inaccurate + - less stability (due to reliance on Terraform's own internal packages) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.terraform_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "terraform-lsp" } + ``` + - `filetypes` : + ```lua + { "terraform", "hcl" } + ``` + - `root_dir` : + ```lua + root_pattern(".terraform", ".git") + ``` + + +## terraformls + +https://github.com/hashicorp/terraform-ls + +Terraform language server +Download a released binary from https://github.com/hashicorp/terraform-ls/releases. + +From https://github.com/hashicorp/terraform-ls#terraform-ls-vs-terraform-lsp: + +Both HashiCorp and the maintainer of terraform-lsp expressed interest in +collaborating on a language server and are working towards a _long-term_ +goal of a single stable and feature-complete implementation. + +For the time being both projects continue to exist, giving users the +choice: + +- `terraform-ls` providing + - overall stability (by relying only on public APIs) + - compatibility with any provider and any Terraform >=0.12.0 currently + less features + - due to project being younger and relying on public APIs which may + not offer the same functionality yet + +- `terraform-lsp` providing + - currently more features + - compatibility with a single particular Terraform (0.12.20 at time of writing) + - configs designed for other 0.12 versions may work, but interpretation may be inaccurate + - less stability (due to reliance on Terraform's own internal packages) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.terraformls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "terraform-ls", "serve" } + ``` + - `filetypes` : + ```lua + { "terraform" } + ``` + - `root_dir` : + ```lua + root_pattern(".terraform", ".git") + ``` + + +## texlab + +https://github.com/latex-lsp/texlab + +A completion engine built from scratch for (La)TeX. + +See https://github.com/latex-lsp/texlab/wiki/Configuration for configuration options. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.texlab.setup{} +``` +**Commands:** +- TexlabBuild: Build the current buffer +- TexlabForward: Forward search from current position + +**Default values:** + - `cmd` : + ```lua + { "texlab" } + ``` + - `filetypes` : + ```lua + { "tex", "plaintex", "bib" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + texlab = { + auxDirectory = ".", + bibtexFormatter = "texlab", + build = { + args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" }, + executable = "latexmk", + forwardSearchAfter = false, + onSave = false + }, + chktex = { + onEdit = false, + onOpenAndSave = false + }, + diagnosticsDelay = 300, + formatterLineLength = 80, + forwardSearch = { + args = {} + }, + latexFormatter = "latexindent", + latexindent = { + modifyLineBreaks = false + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## tflint + +https://github.com/terraform-linters/tflint + +A pluggable Terraform linter that can act as lsp server. +Installation instructions can be found in https://github.com/terraform-linters/tflint#installation. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tflint.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tflint", "--langserver" } + ``` + - `filetypes` : + ```lua + { "terraform" } + ``` + - `root_dir` : + ```lua + root_pattern(".terraform", ".git", ".tflint.hcl") + ``` + + +## theme_check + +https://github.com/Shopify/shopify-cli + +`theme-check-language-server` is bundled with `shopify-cli` or it can also be installed via + +https://github.com/Shopify/theme-check#installation + +**NOTE:** +If installed via Homebrew, `cmd` must be set to 'theme-check-liquid-server' + +```lua +require lspconfig.theme_check.setup { + cmd = { 'theme-check-liquid-server' } +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.theme_check.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "theme-check-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "liquid" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## tilt_ls + +https://github.com/tilt-dev/tilt + +Tilt language server. + +You might need to add filetype detection manually: + +```vim +autocmd BufRead Tiltfile setf=tiltfile +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tilt_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tilt", "lsp", "start" } + ``` + - `filetypes` : + ```lua + { "tiltfile" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## tsserver + +https://github.com/theia-ide/typescript-language-server + +`typescript-language-server` depends on `typescript`. Both packages can be installed via `npm`: +```sh +npm install -g typescript typescript-language-server +``` + +To configure typescript language server, add a +[`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or +[`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to the root of your +project. + +Here's an example that disables type checking in JavaScript files. + +```json +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "checkJs": false + }, + "exclude": [ + "node_modules" + ] +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tsserver.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "typescript-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" } + ``` + - `init_options` : + ```lua + { + hostInfo = "neovim" + } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git") + ``` + + +## turtle_ls + +https://github.com/stardog-union/stardog-language-servers/tree/master/packages/turtle-language-server +`turtle-language-server`, An editor-agnostic server providing language intelligence (diagnostics, hover tooltips, etc.) for the W3C standard Turtle RDF syntax via the Language Server Protocol. +installable via npm install -g turtle-language-server or yarn global add turtle-language-server. +requires node. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.turtle_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "node", + [3] = "--stdio" + } + ``` + - `filetypes` : + ```lua + { "turtle", "ttl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## typeprof + +https://github.com/ruby/typeprof + +`typeprof` is the built-in analysis and LSP tool for Ruby 3.1+. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.typeprof.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "typeprof", "--lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "ruby", "eruby" } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + + +## unison + +https://github.com/unisonweb/unison/blob/trunk/docs/language-server.markdown + + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.unison.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nc", "localhost", "5757" } + ``` + - `filetypes` : + ```lua + { "unison" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## vala_ls + +https://github.com/Prince781/vala-language-server + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vala_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vala-language-server" } + ``` + - `filetypes` : + ```lua + { "vala", "genie" } + ``` + - `root_dir` : + ```lua + root_pattern("meson.build", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## vdmj + +https://github.com/nickbattle/vdmj + +The VDMJ language server can be installed by cloning the VDMJ repository and +running `mvn clean install`. + +Various options are provided to configure the language server (see below). In +particular: +- `annotation_paths` is a list of folders and/or jar file paths for annotations +that should be used with the language server; +- any value of `debugger_port` less than zero will disable the debugger; note +that if a non-zero value is used, only one instance of the server can be active +at a time. + +More settings for VDMJ can be changed in a file called `vdmj.properties` under +`root_dir/.vscode`. For a description of the available settings, see +[Section 7 of the VDMJ User Guide](https://raw.githubusercontent.com/nickbattle/vdmj/master/vdmj/documentation/UserGuide.pdf). + +Note: proof obligations and combinatorial testing are not currently supported +by neovim. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vdmj.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + Generated from the options given + ``` + - `filetypes` : + ```lua + { "vdmsl", "vdmpp", "vdmrt" } + ``` + - `options` : + ```lua + { + annotation_paths = {}, + debugger_port = -1, + high_precision = false, + java = "$JAVA_HOME/bin/java", + java_opts = { "-Xmx3000m", "-Xss1m" }, + logfile = "path.join(vim.fn.stdpath 'cache', 'vdm-lsp.log')", + mavenrepo = "$HOME/.m2/repository/dk/au/ece/vdmj", + version = "The latest version installed in `mavenrepo`" + } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor(fname) or find_vscode_ancestor(fname) + ``` + + +## verible + +https://github.com/chipsalliance/verible + +A linter and formatter for verilog and SystemVerilog files. + +Release binaries can be downloaded from [here](https://github.com/chipsalliance/verible/releases) +and placed in a directory on PATH. + +See https://github.com/chipsalliance/verible/tree/master/verilog/tools/ls/README.md for options. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.verible.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "verible-verilog-ls" } + ``` + - `filetypes` : + ```lua + { "systemverilog", "verilog" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## veridian + +https://github.com/vivekmalneedi/veridian + +A SystemVerilog LanguageServer. + +Download the latest release for your OS from the releases page + +# install with slang feature, if C++17 compiler is available +cargo install --git https://github.com/vivekmalneedi/veridian.git --all-features +# install if C++17 compiler is not available +cargo install --git https://github.com/vivekmalneedi/veridian.git + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.veridian.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "veridian" } + ``` + - `filetypes` : + ```lua + { "systemverilog", "verilog" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## vimls + +https://github.com/iamcco/vim-language-server + +You can install vim-language-server via npm: +```sh +npm install -g vim-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vimls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vim-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "vim" } + ``` + - `init_options` : + ```lua + { + diagnostic = { + enable = true + }, + indexes = { + count = 3, + gap = 100, + projectRootPatterns = { "runtime", "nvim", ".git", "autoload", "plugin" }, + runtimepath = true + }, + isNeovim = true, + iskeyword = "@,48-57,_,192-255,-#", + runtimepath = "", + suggest = { + fromRuntimepath = true, + fromVimruntime = true + }, + vimruntime = "" + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## visualforce_ls + +https://github.com/forcedotcom/salesforcedx-vscode + +Language server for Visualforce. + +For manual installation, download the .vsix archive file from the +[forcedotcom/salesforcedx-vscode](https://github.com/forcedotcom/salesforcedx-vscode) +GitHub releases. Then, configure `cmd` to run the Node script at the unpacked location: + +```lua +require'lspconfig'.visualforce_ls.setup { + cmd = { + 'node', + '/path/to/unpacked/archive/extension/node_modules/@salesforce/salesforcedx-visualforce-language-server/out/src/visualforceServer.js', + '--stdio' + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.visualforce_ls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "visualforce" } + ``` + - `init_options` : + ```lua + { + embeddedLanguages = { + css = true, + javascript = true + } + } + ``` + - `root_dir` : + ```lua + root_pattern('sfdx-project.json') + ``` + + +## vls + +https://github.com/vlang/vls + +V language server. + +`v-language-server` can be installed by following the instructions [here](https://github.com/vlang/vls#installation). +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "v", "ls" } + ``` + - `filetypes` : + ```lua + { "vlang" } + ``` + - `root_dir` : + ```lua + root_pattern("v.mod", ".git") + ``` + + +## volar + +https://github.com/johnsoncodehk/volar/tree/20d713b/packages/vue-language-server + +Volar language server for Vue + +Volar can be installed via npm: + +```sh +npm install -g @volar/vue-language-server +``` + +Volar by default supports Vue 3 projects. Vue 2 projects need +[additional configuration](https://github.com/johnsoncodehk/volar/blob/master/extensions/vscode-vue-language-features/README.md?plain=1#L28-L63). + +**Take Over Mode** + +Volar can serve as a language server for both Vue and TypeScript via [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471). + +To enable Take Over Mode, override the default filetypes in `setup{}` as follows: + +```lua +require'lspconfig'.volar.setup{ + filetypes = {'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue', 'json'} +} +``` + +**Overriding the default TypeScript Server used by Volar** + +The default config looks for TS in the local `node_modules`. This can lead to issues +e.g. when working on a [monorepo](https://monorepo.tools/). The alternatives are: + +- use a global TypeScript Server installation + +```lua +require'lspconfig'.volar.setup{ + init_options = { + typescript = { + tsdk = '/path/to/.npm/lib/node_modules/typescript/lib' + -- Alternative location if installed as root: + -- tsdk = '/usr/local/lib/node_modules/typescript/lib' + } + } +} +``` + +- use a local server and fall back to a global TypeScript Server installation + +```lua +local util = require 'lspconfig.util' +local function get_typescript_server_path(root_dir) + + local global_ts = '/home/[yourusernamehere]/.npm/lib/node_modules/typescript/lib' + -- Alternative location if installed as root: + -- local global_ts = '/usr/local/lib/node_modules/typescript/lib' + local found_ts = '' + local function check_dir(path) + found_ts = util.path.join(path, 'node_modules', 'typescript', 'lib') + if util.path.exists(found_ts) then + return path + end + end + if util.search_ancestors(root_dir, check_dir) then + return found_ts + else + return global_ts + end +end + +require'lspconfig'.volar.setup{ + on_new_config = function(new_config, new_root_dir) + new_config.init_options.typescript.tsdk = get_typescript_server_path(new_root_dir) + end, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.volar.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vue-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "vue" } + ``` + - `init_options` : + ```lua + { + documentFeatures = { + documentColor = false, + documentFormatting = { + defaultPrintWidth = 100 + }, + documentSymbol = true, + foldingRange = true, + linkedEditingRange = true, + selectionRange = true + }, + languageFeatures = { + callHierarchy = true, + codeAction = true, + codeLens = true, + completion = { + defaultAttrNameCase = "kebabCase", + defaultTagNameCase = "both" + }, + definition = true, + diagnostics = true, + documentHighlight = true, + documentLink = true, + hover = true, + implementation = true, + references = true, + rename = true, + renameFileRefactoring = true, + schemaRequestService = true, + semanticTokens = false, + signatureHelp = true, + typeDefinition = true + }, + typescript = { + tsdk = "" + } + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## vuels + +https://github.com/vuejs/vetur/tree/master/server + +Vue language server(vls) +`vue-language-server` can be installed via `npm`: +```sh +npm install -g vls +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vuels.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vls" } + ``` + - `filetypes` : + ```lua + { "vue" } + ``` + - `init_options` : + ```lua + { + config = { + css = {}, + emmet = {}, + html = { + suggest = {} + }, + javascript = { + format = {} + }, + stylusSupremacy = {}, + typescript = { + format = {} + }, + vetur = { + completion = { + autoImport = false, + tagCasing = "kebab", + useScaffoldSnippets = false + }, + format = { + defaultFormatter = { + js = "none", + ts = "none" + }, + defaultFormatterOptions = {}, + scriptInitialIndent = false, + styleInitialIndent = false + }, + useWorkspaceDependencies = false, + validation = { + script = true, + style = true, + template = true + } + } + } + } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", "vue.config.js") + ``` + + +## wgsl_analyzer + +https://github.com/wgsl-analyzer/wgsl-analyzer + +`wgsl_analyzer` can be installed via `cargo`: +```sh +cargo install --git https://github.com/wgsl-analyzer/wgsl-analyzer wgsl_analyzer +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.wgsl_analyzer.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "wgsl_analyzer" } + ``` + - `filetypes` : + ```lua + { "wgsl" } + ``` + - `root_dir` : + ```lua + root_pattern(".git" + ``` + - `settings` : + ```lua + {} + ``` + + +## yamlls + +https://github.com/redhat-developer/yaml-language-server + +`yaml-language-server` can be installed via `yarn`: +```sh +yarn global add yaml-language-server +``` + +To use a schema for validation, there are two options: + +1. Add a modeline to the file. A modeline is a comment of the form: + +``` +# yaml-language-server: $schema= +``` + +where the relative filepath is the path relative to the open yaml file, and the absolute filepath +is the filepath relative to the filesystem root ('/' on unix systems) + +2. Associated a schema url, relative , or absolute (to root of project, not to filesystem root) path to +the a glob pattern relative to the detected project root. Check `:LspInfo` to determine the resolved project +root. + +```lua +require('lspconfig').yamlls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + ... -- other settings. note this overrides the lspconfig defaults. + schemas = { + ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*" + ["../path/relative/to/file.yml"] = "/.github/workflows/*" + ["/path/from/root/of/project"] = "/.github/workflows/*" + }, + }, + } +} +``` + +Currently, kubernetes is special-cased in yammls, see the following upstream issues: +* [#211](https://github.com/redhat-developer/yaml-language-server/issues/211). +* [#307](https://github.com/redhat-developer/yaml-language-server/issues/307). + +To override a schema to use a specific k8s schema version (for example, to use 1.18): + +```lua +require('lspconfig').yamlls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + ... -- other settings. note this overrides the lspconfig defaults. + schemas = { + ["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.18.0-standalone-strict/all.json"] = "/*.k8s.yaml", + ... -- other schemas + }, + }, + } +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.yamlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "yaml-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml", "yaml.docker-compose" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `settings` : + ```lua + { + redhat = { + telemetry = { + enabled = false + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## zk + +https://github.com/mickael-menu/zk + +A plain text note-taking assistant + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.zk.setup{} +``` +**Commands:** +- ZkIndex: Index +- ZkNew: ZkNew + +**Default values:** + - `cmd` : + ```lua + { "zk", "lsp" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + root_pattern(".zk") + ``` + + +## zls + +https://github.com/zigtools/zls + +Zig LSP implementation + Zig Language Server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.zls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "zls" } + ``` + - `filetypes` : + ```lua + { "zig", "zir" } + ``` + - `root_dir` : + ```lua + util.root_pattern("zls.json", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + + +vim:ft=markdown diff --git a/bundle/nvim-lspconfig-0.1.4/doc/server_configurations.txt b/bundle/nvim-lspconfig-0.1.4/doc/server_configurations.txt new file mode 100644 index 000000000..da7dc4fbd --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/doc/server_configurations.txt @@ -0,0 +1,8503 @@ +# Configurations + + +LSP configs provided by nvim-lspconfig are listed below. This documentation is +autogenerated from the Lua files. You can view this file in Nvim by running +`:help lspconfig-all`. + +- [als](#als) +- [anakin_language_server](#anakin_language_server) +- [angularls](#angularls) +- [ansiblels](#ansiblels) +- [antlersls](#antlersls) +- [apex_ls](#apex_ls) +- [arduino_language_server](#arduino_language_server) +- [asm_lsp](#asm_lsp) +- [astro](#astro) +- [awk_ls](#awk_ls) +- [bashls](#bashls) +- [beancount](#beancount) +- [bicep](#bicep) +- [blueprint_ls](#blueprint_ls) +- [bsl_ls](#bsl_ls) +- [bufls](#bufls) +- [ccls](#ccls) +- [clangd](#clangd) +- [clarity_lsp](#clarity_lsp) +- [clojure_lsp](#clojure_lsp) +- [cmake](#cmake) +- [codeqlls](#codeqlls) +- [crystalline](#crystalline) +- [csharp_ls](#csharp_ls) +- [cssls](#cssls) +- [cssmodules_ls](#cssmodules_ls) +- [cucumber_language_server](#cucumber_language_server) +- [dafny](#dafny) +- [dagger](#dagger) +- [dartls](#dartls) +- [denols](#denols) +- [dhall_lsp_server](#dhall_lsp_server) +- [diagnosticls](#diagnosticls) +- [dockerls](#dockerls) +- [dolmenls](#dolmenls) +- [dotls](#dotls) +- [efm](#efm) +- [elixirls](#elixirls) +- [elmls](#elmls) +- [ember](#ember) +- [emmet_ls](#emmet_ls) +- [erg_language_server](#erg_language_server) +- [erlangls](#erlangls) +- [esbonio](#esbonio) +- [eslint](#eslint) +- [fennel-ls](#fennel-ls) +- [flow](#flow) +- [flux_lsp](#flux_lsp) +- [foam_ls](#foam_ls) +- [fortls](#fortls) +- [fsautocomplete](#fsautocomplete) +- [fsharp_language_server](#fsharp_language_server) +- [fstar](#fstar) +- [gdscript](#gdscript) +- [ghcide](#ghcide) +- [ghdl_ls](#ghdl_ls) +- [gleam](#gleam) +- [glint](#glint) +- [glslls](#glslls) +- [golangci_lint_ls](#golangci_lint_ls) +- [gopls](#gopls) +- [gradle_ls](#gradle_ls) +- [grammarly](#grammarly) +- [graphql](#graphql) +- [groovyls](#groovyls) +- [haxe_language_server](#haxe_language_server) +- [hdl_checker](#hdl_checker) +- [hhvm](#hhvm) +- [hie](#hie) +- [hls](#hls) +- [hoon_ls](#hoon_ls) +- [html](#html) +- [idris2_lsp](#idris2_lsp) +- [intelephense](#intelephense) +- [java_language_server](#java_language_server) +- [jdtls](#jdtls) +- [jedi_language_server](#jedi_language_server) +- [jsonls](#jsonls) +- [jsonnet_ls](#jsonnet_ls) +- [julials](#julials) +- [kotlin_language_server](#kotlin_language_server) +- [lean3ls](#lean3ls) +- [leanls](#leanls) +- [lelwel_ls](#lelwel_ls) +- [lemminx](#lemminx) +- [ltex](#ltex) +- [luau_lsp](#luau_lsp) +- [m68k](#m68k) +- [marksman](#marksman) +- [metals](#metals) +- [millet](#millet) +- [mint](#mint) +- [mlir_lsp_server](#mlir_lsp_server) +- [mlir_pdll_lsp_server](#mlir_pdll_lsp_server) +- [mm0_ls](#mm0_ls) +- [move_analyzer](#move_analyzer) +- [neocmake](#neocmake) +- [nickel_ls](#nickel_ls) +- [nil_ls](#nil_ls) +- [nimls](#nimls) +- [ntt](#ntt) +- [nxls](#nxls) +- [ocamlls](#ocamlls) +- [ocamllsp](#ocamllsp) +- [ols](#ols) +- [omnisharp](#omnisharp) +- [opencl_ls](#opencl_ls) +- [openscad_ls](#openscad_ls) +- [pasls](#pasls) +- [perlls](#perlls) +- [perlnavigator](#perlnavigator) +- [perlpls](#perlpls) +- [phan](#phan) +- [phpactor](#phpactor) +- [please](#please) +- [powershell_es](#powershell_es) +- [prismals](#prismals) +- [prolog_ls](#prolog_ls) +- [prosemd_lsp](#prosemd_lsp) +- [psalm](#psalm) +- [puppet](#puppet) +- [purescriptls](#purescriptls) +- [pylsp](#pylsp) +- [pyre](#pyre) +- [pyright](#pyright) +- [qml_lsp](#qml_lsp) +- [qmlls](#qmlls) +- [quick_lint_js](#quick_lint_js) +- [r_language_server](#r_language_server) +- [racket_langserver](#racket_langserver) +- [reason_ls](#reason_ls) +- [relay_lsp](#relay_lsp) +- [remark_ls](#remark_ls) +- [rescriptls](#rescriptls) +- [rls](#rls) +- [rnix](#rnix) +- [robotframework_ls](#robotframework_ls) +- [rome](#rome) +- [ruby_ls](#ruby_ls) +- [rust_analyzer](#rust_analyzer) +- [salt_ls](#salt_ls) +- [scheme_langserver](#scheme_langserver) +- [scry](#scry) +- [serve_d](#serve_d) +- [sixtyfps](#sixtyfps) +- [slint_lsp](#slint_lsp) +- [smarty_ls](#smarty_ls) +- [solang](#solang) +- [solargraph](#solargraph) +- [solc](#solc) +- [solidity](#solidity) +- [solidity_ls](#solidity_ls) +- [sorbet](#sorbet) +- [sourcekit](#sourcekit) +- [sourcery](#sourcery) +- [spectral](#spectral) +- [sqlls](#sqlls) +- [sqls](#sqls) +- [starlark-rust](#starlark-rust) +- [steep](#steep) +- [stylelint_lsp](#stylelint_lsp) +- [sumneko_lua](#sumneko_lua) +- [svelte](#svelte) +- [svlangserver](#svlangserver) +- [svls](#svls) +- [syntax_tree](#syntax_tree) +- [tailwindcss](#tailwindcss) +- [taplo](#taplo) +- [tblgen_lsp_server](#tblgen_lsp_server) +- [teal_ls](#teal_ls) +- [terraform_lsp](#terraform_lsp) +- [terraformls](#terraformls) +- [texlab](#texlab) +- [tflint](#tflint) +- [theme_check](#theme_check) +- [tilt_ls](#tilt_ls) +- [tsserver](#tsserver) +- [turtle_ls](#turtle_ls) +- [typeprof](#typeprof) +- [unison](#unison) +- [vala_ls](#vala_ls) +- [vdmj](#vdmj) +- [verible](#verible) +- [veridian](#veridian) +- [vimls](#vimls) +- [visualforce_ls](#visualforce_ls) +- [vls](#vls) +- [volar](#volar) +- [vuels](#vuels) +- [wgsl_analyzer](#wgsl_analyzer) +- [yamlls](#yamlls) +- [zk](#zk) +- [zls](#zls) + +## als + +https://github.com/AdaCore/ada_language_server + +Installation instructions can be found [here](https://github.com/AdaCore/ada_language_server#Install). + +Can be configured by passing a "settings" object to `als.setup{}`: + +```lua +require('lspconfig').als.setup{ + settings = { + ada = { + projectFile = "project.gpr"; + scenarioVariables = { ... }; + } + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.als.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ada_language_server" } + ``` + - `filetypes` : + ```lua + { "ada" } + ``` + - `root_dir` : + ```lua + util.root_pattern("Makefile", ".git", "*.gpr", "*.adc") + ``` + + +## anakin_language_server + +https://pypi.org/project/anakin-language-server/ + +`anakin-language-server` is yet another Jedi Python language server. + +Available options: + +* Initialization: https://github.com/muffinmad/anakin-language-server#initialization-option +* Configuration: https://github.com/muffinmad/anakin-language-server#configuration-options + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.anakin_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "anakinls" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + anakinls = { + pyflakes_errors = { "ImportStarNotPermitted", "UndefinedExport", "UndefinedLocal", "UndefinedName", "DuplicateArgument", "MultiValueRepeatedKeyLiteral", "MultiValueRepeatedKeyVariable", "FutureFeatureNotDefined", "LateFutureImport", "ReturnOutsideFunction", "YieldOutsideFunction", "ContinueOutsideLoop", "BreakOutsideLoop", "TwoStarredExpressions", "TooManyExpressionsInStarredAssignment", "ForwardAnnotationSyntaxError", "RaiseNotImplemented", "StringDotFormatExtraPositionalArguments", "StringDotFormatExtraNamedArguments", "StringDotFormatMissingArgument", "StringDotFormatMixingAutomatic", "StringDotFormatInvalidFormat", "PercentFormatInvalidFormat", "PercentFormatMixedPositionalAndNamed", "PercentFormatUnsupportedFormat", "PercentFormatPositionalCountMismatch", "PercentFormatExtraNamedArguments", "PercentFormatMissingArgument", "PercentFormatExpectedMapping", "PercentFormatExpectedSequence", "PercentFormatStarRequiresSequence" } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## angularls + +https://github.com/angular/vscode-ng-language-service + +`angular-language-server` can be installed via npm `npm install -g @angular/language-server`. + +Note, that if you override the default `cmd`, you must also update `on_new_config` to set `new_config.cmd` during startup. + +```lua +local project_library_path = "/path/to/project/lib" +local cmd = {"ngserver", "--stdio", "--tsProbeLocations", project_library_path , "--ngProbeLocations", project_library_path} + +require'lspconfig'.angularls.setup{ + cmd = cmd, + on_new_config = function(new_config,new_root_dir) + new_config.cmd = cmd + end, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.angularls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ngserver", "--stdio", "--tsProbeLocations", "", "--ngProbeLocations", "" } + ``` + - `filetypes` : + ```lua + { "typescript", "html", "typescriptreact", "typescript.tsx" } + ``` + - `root_dir` : + ```lua + root_pattern("angular.json") + ``` + + +## ansiblels + +https://github.com/ansible/ansible-language-server + +Language server for the ansible configuration management tool. + +`ansible-language-server` can be installed via `npm`: + +```sh +npm install -g @ansible/ansible-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ansiblels.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ansible-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml.ansible" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + ansible = { + ansible = { + path = "ansible" + }, + executionEnvironment = { + enabled = false + }, + python = { + interpreterPath = "python" + }, + validation = { + enabled = true, + lint = { + enabled = true, + path = "ansible-lint" + } + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## antlersls + +https://www.npmjs.com/package/antlers-language-server + +`antlersls` can be installed via `npm`: +```sh +npm install -g antlers-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.antlersls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "antlersls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "html", "antlers" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## apex_ls + +https://github.com/forcedotcom/salesforcedx-vscode + +Language server for Apex. + +For manual installation, download the JAR file from the [VSCode +extension](https://github.com/forcedotcom/salesforcedx-vscode/tree/develop/packages/salesforcedx-vscode-apex). + +```lua +require'lspconfig'.apex_ls.setup { + apex_jar_path = '/path/to/apex-jorje-lsp.jar', + apex_enable_semantic_errors = false, -- Whether to allow Apex Language Server to surface semantic errors + apex_enable_completion_statistics = false, -- Whether to allow Apex Language Server to collect telemetry on code completion usage +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.apex_ls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "apexcode" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern('sfdx-project.json') + ``` + + +## arduino_language_server + +https://github.com/arduino/arduino-language-server + +Language server for Arduino + +The `arduino-language-server` can be installed by running: + +``` +go install github.com/arduino/arduino-language-server@latest +``` + +The `arduino-cli` tool must also be installed. Follow [these +installation instructions](https://arduino.github.io/arduino-cli/latest/installation/) for +your platform. + +After installing `arduino-cli`, follow [these +instructions](https://arduino.github.io/arduino-cli/latest/getting-started/#create-a-configuration-file) +for generating a configuration file if you haven't done so already, and make +sure you [install any relevant platforms +libraries](https://arduino.github.io/arduino-cli/latest/getting-started/#install-the-core-for-your-board). +Make sure to save the full path to the created `arduino-cli.yaml` file for later. + +The language server also requires `clangd` to be installed. Follow [these +installation instructions](https://clangd.llvm.org/installation) for your +platform. + +Next, you will need to decide which FQBN to use. +To identify the available FQBNs for boards you currently have connected, you may use the `arduino-cli` command, like so: + +```sh +$ arduino-cli board list +Port Protocol Type Board Name FQBN Core +/dev/ttyACM0 serial Serial Port (USB) Arduino Uno arduino:avr:uno arduino:avr + ^^^^^^^^^^^^^^^ +``` + +After all dependencies are installed you'll need to set the command for the +language server in your setup: + +```lua +require'lspconfig'.arduino_language_server.setup { + cmd = { + "arduino-language-server", + "-cli-config", "/path/to/arduino-cli.yaml", + "-fqbn", "arduino:avr:uno", + "-cli", "arduino-cli", + "-clangd", "clangd" + } +} +``` + +For further instruction about configuration options, run `arduino-language-server --help`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.arduino_language_server.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "arduino" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## asm_lsp + +https://github.com/bergercookie/asm-lsp + +Language Server for GAS/GO Assembly + +`asm-lsp` can be installed via cargo: +cargo install asm-lsp + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.asm_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "asm-lsp" } + ``` + - `filetypes` : + ```lua + { "asm", "vmasm" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## astro + +https://github.com/withastro/language-tools/tree/main/packages/language-server + +`astro-ls` can be installed via `npm`: +```sh +npm install -g @astrojs/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.astro.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "astro-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "astro" } + ``` + - `init_options` : + ```lua + { + configuration = {}, + typescript = { + serverPath = "" + } + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git") + ``` + + +## awk_ls + +https://github.com/Beaglefoot/awk-language-server/ + +`awk-language-server` can be installed via `npm`: +```sh +npm install -g awk-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.awk_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "awk-language-server" } + ``` + - `filetypes` : + ```lua + { "awk" } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bashls + +https://github.com/mads-hartmann/bash-language-server + +`bash-language-server` can be installed via `npm`: +```sh +npm i -g bash-language-server +``` + +Language server for bash, written using tree sitter in typescript. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bashls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "bash-language-server", "start" } + ``` + - `cmd_env` : + ```lua + { + GLOB_PATTERN = "*@(.sh|.inc|.bash|.command)" + } + ``` + - `filetypes` : + ```lua + { "sh" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## beancount + +https://github.com/polarmutex/beancount-language-server#installation + +See https://github.com/polarmutex/beancount-language-server#configuration for configuration options + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.beancount.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "beancount-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "beancount", "bean" } + ``` + - `init_options` : + ```lua + { + journalFile = "" + } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bicep + +https://github.com/azure/bicep +Bicep language server + +Bicep language server can be installed by downloading and extracting a release of bicep-langserver.zip from [Bicep GitHub releases](https://github.com/Azure/bicep/releases). + +Bicep language server requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +Neovim does not have built-in support for the bicep filetype which is required for lspconfig to automatically launch the language server. + +Filetype detection can be added via an autocmd: +```lua +vim.cmd [[ autocmd BufNewFile,BufRead *.bicep set filetype=bicep ]] +``` + +**By default, bicep language server does not have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. + +```lua +local bicep_lsp_bin = "/path/to/bicep-langserver/Bicep.LangServer.dll" +require'lspconfig'.bicep.setup{ + cmd = { "dotnet", bicep_lsp_bin }; + ... +} +``` + +To download the latest release and place in /usr/local/bin/bicep-langserver: +```bash +(cd $(mktemp -d) \ + && curl -fLO https://github.com/Azure/bicep/releases/latest/download/bicep-langserver.zip \ + && rm -rf /usr/local/bin/bicep-langserver \ + && unzip -d /usr/local/bin/bicep-langserver bicep-langserver.zip) +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bicep.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "bicep" } + ``` + - `init_options` : + ```lua + {} + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## blueprint_ls + +https://gitlab.gnome.org/jwestman/blueprint-compiler + +`blueprint-compiler` can be installed via your system package manager. + +Language server for the blurprint markup language, written in python and part +of the blueprint-compiler. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.blueprint_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "blueprint-compiler", "lsp" } + ``` + - `cmd_env` : + ```lua + { + GLOB_PATTERN = "*@(.blp)" + } + ``` + - `filetypes` : + ```lua + { "blueprint" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bsl_ls + + https://github.com/1c-syntax/bsl-language-server + + Language Server Protocol implementation for 1C (BSL) - 1C:Enterprise 8 and OneScript languages. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bsl_ls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "bsl", "os" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## bufls + +https://github.com/bufbuild/buf-language-server + +`buf-language-server` can be installed via `go install`: +```sh +go install github.com/bufbuild/buf-language-server/cmd/bufls@latest +``` + +bufls is a Protobuf language server compatible with Buf modules and workspaces + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bufls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "bufls", "serve" } + ``` + - `filetypes` : + ```lua + { "proto" } + ``` + - `root_dir` : + ```lua + root_pattern("buf.work.yaml", ".git") + ``` + + +## ccls + +https://github.com/MaskRay/ccls/wiki + +ccls relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) specified +as compile_commands.json or, for simpler projects, a .ccls. +For details on how to automatically generate one using CMake look [here](https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html). Alternatively, you can use [Bear](https://github.com/rizsotto/Bear). + +Customization options are passed to ccls at initialization time via init_options, a list of available options can be found [here](https://github.com/MaskRay/ccls/wiki/Customization#initialization-options). For example: + +```lua +local lspconfig = require'lspconfig' +lspconfig.ccls.setup { + init_options = { + compilationDatabaseDirectory = "build"; + index = { + threads = 0; + }; + clang = { + excludeArgs = { "-frounding-math"} ; + }; + } +} + +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ccls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ccls" } + ``` + - `filetypes` : + ```lua + { "c", "cpp", "objc", "objcpp" } + ``` + - `offset_encoding` : + ```lua + "utf-32" + ``` + - `root_dir` : + ```lua + root_pattern('compile_commands.json', '.ccls', '.git') + ``` + - `single_file_support` : + ```lua + false + ``` + + +## clangd + +https://clangd.llvm.org/installation.html + +- **NOTE:** Clang >= 11 is recommended! See [#23](https://github.com/neovim/nvim-lsp/issues/23). +- If `compile_commands.json` lives in a build directory, you should + symlink it to the root of your source tree. + ``` + ln -s /path/to/myproject/build/compile_commands.json /path/to/myproject/ + ``` +- clangd relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) + specified as compile_commands.json, see https://clangd.llvm.org/installation#compile_commandsjson + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.clangd.setup{} +``` +**Commands:** +- ClangdSwitchSourceHeader: Switch between source/header + +**Default values:** + - `capabilities` : + ```lua + default capabilities, with offsetEncoding utf-8 + ``` + - `cmd` : + ```lua + { "clangd" } + ``` + - `filetypes` : + ```lua + { "c", "cpp", "objc", "objcpp", "cuda", "proto" } + ``` + - `root_dir` : + ```lua + root_pattern( + '.clangd', + '.clang-tidy', + '.clang-format', + 'compile_commands.json', + 'compile_flags.txt', + 'configure.ac', + '.git' + ) + + ``` + - `single_file_support` : + ```lua + true + ``` + + +## clarity_lsp + +`clarity-lsp` is a language server for the Clarity language. Clarity is a decidable smart contract language that optimizes for predictability and security. Smart contracts allow developers to encode essential business logic on a blockchain. + +To learn how to configure the clarity language server, see the [clarity-lsp documentation](https://github.com/hirosystems/clarity-lsp). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.clarity_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "clarity-lsp" } + ``` + - `filetypes` : + ```lua + { "clar", "clarity" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## clojure_lsp + +https://github.com/clojure-lsp/clojure-lsp + +Clojure Language Server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.clojure_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "clojure-lsp" } + ``` + - `filetypes` : + ```lua + { "clojure", "edn" } + ``` + - `root_dir` : + ```lua + root_pattern("project.clj", "deps.edn", "build.boot", "shadow-cljs.edn", ".git") + ``` + + +## cmake + +https://github.com/regen100/cmake-language-server + +CMake LSP Implementation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cmake.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cmake-language-server" } + ``` + - `filetypes` : + ```lua + { "cmake" } + ``` + - `init_options` : + ```lua + { + buildDirectory = "build" + } + ``` + - `root_dir` : + ```lua + root_pattern('CMakePresets.json', 'CTestConfig.cmake', '.git', 'build', 'cmake') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## codeqlls + +Reference: +https://codeql.github.com/docs/codeql-cli/ + +Binaries: +https://github.com/github/codeql-cli-binaries + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.codeqlls.setup{} +``` + + +**Default values:** + - `before_init` : + ```lua + see source file + ``` + - `cmd` : + ```lua + { "codeql", "execute", "language-server", "--check-errors", "ON_CHANGE", "-q" } + ``` + - `filetypes` : + ```lua + { "ql" } + ``` + - `log_level` : + ```lua + 2 + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + search_path = "list containing all search paths, eg: '~/codeql-home/codeql-repo'" + } + ``` + + +## crystalline + +https://github.com/elbywan/crystalline + +Crystal language server. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.crystalline.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "crystalline" } + ``` + - `filetypes` : + ```lua + { "crystal" } + ``` + - `root_dir` : + ```lua + root_pattern('shard.yml', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## csharp_ls + +https://github.com/razzmatazz/csharp-language-server + +Language Server for C#. + +csharp-ls requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +The preferred way to install csharp-ls is with `dotnet tool install --global csharp-ls`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.csharp_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "csharp-ls" } + ``` + - `filetypes` : + ```lua + { "cs" } + ``` + - `init_options` : + ```lua + { + AutomaticWorkspaceInit = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## cssls + + +https://github.com/hrsh7th/vscode-langservers-extracted + +`css-languageserver` can be installed via `npm`: + +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-css-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.cssls.setup { + capabilities = capabilities, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cssls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vscode-css-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "css", "scss", "less" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") or bufdir + ``` + - `settings` : + ```lua + { + css = { + validate = true + }, + less = { + validate = true + }, + scss = { + validate = true + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## cssmodules_ls + +https://github.com/antonk52/cssmodules-language-server + +Language server for autocompletion and go-to-definition functionality for CSS modules. + +You can install cssmodules-language-server via npm: +```sh +npm install -g cssmodules-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cssmodules_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cssmodules-language-server" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "typescript", "typescriptreact" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json") + ``` + + +## cucumber_language_server + +https://cucumber.io +https://github.com/cucumber/common +https://www.npmjs.com/package/@cucumber/language-server + +Language server for Cucumber. + +`cucumber-language-server` can be installed via `npm`: +```sh +npm install -g @cucumber/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cucumber_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cucumber-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "cucumber" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## dafny + + NeoVim support for the Dafny language server. + Please follow the instructions and compile the language server from source: + https://github.com/dafny-lang/language-server-csharp + + Note that there is no default cmd set. You must set it yourself. The recommended way is to use `{"dotnet", ""}`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dafny.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "dfy", "dafny" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dagger + +https://github.com/dagger/cuelsp + +Dagger's lsp server for cuelang. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dagger.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cuelsp" } + ``` + - `filetypes` : + ```lua + { "cue" } + ``` + - `root_dir` : + ```lua + root_pattern("cue.mod", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dartls + +https://github.com/dart-lang/sdk/tree/master/pkg/analysis_server/tool/lsp_spec + +Language server for dart. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dartls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dart", "language-server", "--protocol=lsp" } + ``` + - `filetypes` : + ```lua + { "dart" } + ``` + - `init_options` : + ```lua + { + closingLabels = true, + flutterOutline = true, + onlyAnalyzeProjectsWithOpenFiles = true, + outline = true, + suggestFromUnimportedLibraries = true + } + ``` + - `root_dir` : + ```lua + root_pattern("pubspec.yaml") + ``` + - `settings` : + ```lua + { + dart = { + completeFunctionCalls = true, + showTodos = true + } + } + ``` + + +## denols + +https://github.com/denoland/deno + +Deno's built-in language server + +To appropriately highlight codefences returned from denols, you will need to augment vim.g.markdown_fenced languages + in your init.lua. Example: + +```lua +vim.g.markdown_fenced_languages = { + "ts=typescript" +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.denols.setup{} +``` +**Commands:** +- DenolsCache: Cache a module and all of its dependencies. + +**Default values:** + - `cmd` : + ```lua + { "deno", "lsp" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" } + ``` + - `handlers` : + ```lua + { + ["textDocument/definition"] = , + ["textDocument/references"] = , + ["workspace/executeCommand"] = + } + ``` + - `init_options` : + ```lua + { + enable = true, + unstable = false + } + ``` + - `root_dir` : + ```lua + root_pattern("deno.json", "deno.jsonc", ".git") + ``` + + +## dhall_lsp_server + +https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-lsp-server + +language server for dhall + +`dhall-lsp-server` can be installed via cabal: +```sh +cabal install dhall-lsp-server +``` +prebuilt binaries can be found [here](https://github.com/dhall-lang/dhall-haskell/releases). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dhall_lsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dhall-lsp-server" } + ``` + - `filetypes` : + ```lua + { "dhall" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## diagnosticls + +https://github.com/iamcco/diagnostic-languageserver + +Diagnostic language server integrate with linters. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.diagnosticls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "diagnostic-languageserver", "--stdio" } + ``` + - `filetypes` : + ```lua + Empty by default, override to add filetypes + ``` + - `root_dir` : + ```lua + Vim's starting directory + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dockerls + +https://github.com/rcjsuen/dockerfile-language-server-nodejs + +`docker-langserver` can be installed via `npm`: +```sh +npm install -g dockerfile-language-server-nodejs +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dockerls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "docker-langserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "dockerfile" } + ``` + - `root_dir` : + ```lua + root_pattern("Dockerfile") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dolmenls + +https://github.com/Gbury/dolmen/blob/master/doc/lsp.md + +`dolmenls` can be installed via `opam` +```sh +opam install dolmen_lsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dolmenls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dolmenls" } + ``` + - `filetypes` : + ```lua + { "smt2", "tptp", "p", "cnf", "icnf", "zf" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dotls + +https://github.com/nikeee/dot-language-server + +`dot-language-server` can be installed via `npm`: +```sh +npm install -g dot-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dotls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dot-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "dot" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## efm + +https://github.com/mattn/efm-langserver + +General purpose Language Server that can use specified error message format generated from specified command. + +Requires at minimum EFM version [v0.0.38](https://github.com/mattn/efm-langserver/releases/tag/v0.0.38) to support +launching the language server on single files. If on an older version of EFM, disable single file support: + +```lua +require('lspconfig')['efm'].setup{ + settings = ..., -- You must populate this according to the EFM readme + filetypes = ..., -- Populate this according to the note below + single_file_support = false, -- This is the important line for supporting older version of EFM +} +``` + +Note: In order for neovim's built-in language server client to send the appropriate `languageId` to EFM, **you must +specify `filetypes` in your call to `setup{}`**. Otherwise `lspconfig` will launch EFM on the `BufEnter` instead +of the `FileType` autocommand, and the `filetype` variable used to populate the `languageId` will not yet be set. + +```lua +require('lspconfig')['efm'].setup{ + settings = ..., -- You must populate this according to the EFM readme + filetypes = { 'python','cpp','lua' } +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.efm.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "efm-langserver" } + ``` + - `root_dir` : + ```lua + util.root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## elixirls + +https://github.com/elixir-lsp/elixir-ls + +`elixir-ls` can be installed by following the instructions [here](https://github.com/elixir-lsp/elixir-ls#building-and-running). + +```bash +curl -fLO https://github.com/elixir-lsp/elixir-ls/releases/latest/download/elixir-ls.zip +unzip elixir-ls.zip -d /path/to/elixir-ls +# Unix +chmod +x /path/to/elixir-ls/language_server.sh +``` + +**By default, elixir-ls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of your unzipped elixir-ls. + +```lua +require'lspconfig'.elixirls.setup{ + -- Unix + cmd = { "/path/to/elixir-ls/language_server.sh" }; + -- Windows + cmd = { "/path/to/elixir-ls/language_server.bat" }; + ... +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.elixirls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "elixir", "eelixir", "heex", "surface" } + ``` + - `root_dir` : + ```lua + root_pattern("mix.exs", ".git") or vim.loop.os_homedir() + ``` + + +## elmls + +https://github.com/elm-tooling/elm-language-server#installation + +If you don't want to use Nvim to install it, then you can use: +```sh +npm install -g elm elm-test elm-format @elm-tooling/elm-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.elmls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "elm-language-server" } + ``` + - `filetypes` : + ```lua + { "elm" } + ``` + - `init_options` : + ```lua + { + elmAnalyseTrigger = "change" + } + ``` + - `root_dir` : + ```lua + root_pattern("elm.json") + ``` + + +## ember + +https://github.com/lifeart/ember-language-server + +`ember-language-server` can be installed via `npm`: + +```sh +npm install -g @lifeart/ember-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ember.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ember-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "handlebars", "typescript", "javascript" } + ``` + - `root_dir` : + ```lua + root_pattern("ember-cli-build.js", ".git") + ``` + + +## emmet_ls + +https://github.com/aca/emmet-ls + +Package can be installed via `npm`: +```sh +npm install -g emmet-ls +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.emmet_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "emmet-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "eruby" } + ``` + - `root_dir` : + ```lua + git root + ``` + - `single_file_support` : + ```lua + true + ``` + + +## erg_language_server + +https://github.com/erg-lang/erg-language-server + +ELS (erg-language-server) is a language server for the Erg programming language. + +`els` can be installed via `cargo`: + ```sh + cargo install els + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.erg_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "els" } + ``` + - `filetypes` : + ```lua + { "erg" } + ``` + - `root_dir` : + ```lua + root_pattern("package.er") or find_git_ancestor + ``` + + +## erlangls + +https://erlang-ls.github.io + +Language Server for Erlang. + +Clone [erlang_ls](https://github.com/erlang-ls/erlang_ls) +Compile the project with `make` and copy resulting binaries somewhere in your $PATH eg. `cp _build/*/bin/* ~/local/bin` + +Installation instruction can be found [here](https://github.com/erlang-ls/erlang_ls). + +Installation requirements: + - [Erlang OTP 21+](https://github.com/erlang/otp) + - [rebar3 3.9.1+](https://github.com/erlang/rebar3) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.erlangls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "erlang_ls" } + ``` + - `filetypes` : + ```lua + { "erlang" } + ``` + - `root_dir` : + ```lua + root_pattern('rebar.config', 'erlang.mk', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## esbonio + +https://github.com/swyddfa/esbonio + +Esbonio is a language server for [Sphinx](https://www.sphinx-doc.org/en/master/) documentation projects. +The language server can be installed via pip + +``` +pip install esbonio +``` + +Since Sphinx is highly extensible you will get best results if you install the language server in the same +Python environment as the one used to build your documentation. To ensure that the correct Python environment +is picked up, you can either launch `nvim` with the correct environment activated. + +``` +source env/bin/activate +nvim +``` + +Or you can modify the default `cmd` to include the full path to the Python interpreter. + +```lua +require'lspconfig'.esbonio.setup { + cmd = { '/path/to/virtualenv/bin/python', '-m', 'esbonio' } +} +``` + +Esbonio supports a number of config values passed as `init_options` on startup, for example. + +```lua +require'lspconfig'.esbonio.setup { + init_options = { + server = { + logLevel = "debug" + }, + sphinx = { + confDir = "/path/to/docs", + srcDir = "${confDir}/../docs-src" + } +} +``` + +A full list and explanation of the available options can be found [here](https://swyddfa.github.io/esbonio/docs/latest/en/lsp/getting-started.html#configuration) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.esbonio.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "python3", "-m", "esbonio" } + ``` + - `filetypes` : + ```lua + { "rst" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## eslint + +https://github.com/hrsh7th/vscode-langservers-extracted + +`vscode-eslint-language-server` is a linting engine for JavaScript / Typescript. +It can be installed via `npm`: + +```sh +npm i -g vscode-langservers-extracted +``` + +`vscode-eslint-language-server` provides an `EslintFixAll` command that can be used to format a document on save: +```vim +autocmd BufWritePre *.tsx,*.ts,*.jsx,*.js EslintFixAll +``` + +See [vscode-eslint](https://github.com/microsoft/vscode-eslint/blob/55871979d7af184bf09af491b6ea35ebd56822cf/server/src/eslintServer.ts#L216-L229) for configuration options. + +Messages handled in lspconfig: `eslint/openDoc`, `eslint/confirmESLintExecution`, `eslint/probeFailed`, `eslint/noLibrary` + +Additional messages you can handle: `eslint/noConfig` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.eslint.setup{} +``` +**Commands:** +- EslintFixAll: Fix all eslint problems for this buffer + +**Default values:** + - `cmd` : + ```lua + { "vscode-eslint-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx", "vue", "svelte", "astro" } + ``` + - `handlers` : + ```lua + { + ["eslint/confirmESLintExecution"] = , + ["eslint/noLibrary"] = , + ["eslint/openDoc"] = , + ["eslint/probeFailed"] = + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + codeAction = { + disableRuleComment = { + enable = true, + location = "separateLine" + }, + showDocumentation = { + enable = true + } + }, + codeActionOnSave = { + enable = false, + mode = "all" + }, + experimental = { + useFlatConfig = false + }, + format = true, + nodePath = "", + onIgnoredFiles = "off", + packageManager = "npm", + problems = { + shortenToSingleLine = false + }, + quiet = false, + rulesCustomizations = {}, + run = "onType", + useESLintClass = false, + validate = "on", + workingDirectory = { + mode = "location" + } + } + ``` + + +## fennel-ls + +https://sr.ht/~xerool/fennel-ls/ + +A language server for fennel. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fennel-ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fennel-ls" } + ``` + - `filetypes` : + ```lua + { "fennel" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## flow + +https://flow.org/ +https://github.com/facebook/flow + +See below for how to setup Flow itself. +https://flow.org/en/docs/install/ + +See below for lsp command options. + +```sh +npx flow lsp --help +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.flow.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "npx", "--no-install", "flow", "lsp" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx" } + ``` + - `root_dir` : + ```lua + root_pattern(".flowconfig") + ``` + + +## flux_lsp + +https://github.com/influxdata/flux-lsp +`flux-lsp` can be installed via `cargo`: +```sh +cargo install --git https://github.com/influxdata/flux-lsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.flux_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "flux-lsp" } + ``` + - `filetypes` : + ```lua + { "flux" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## foam_ls + +https://github.com/FoamScience/foam-language-server + +`foam-language-server` can be installed via `npm` +```sh +npm install -g foam-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.foam_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "foam-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "foam", "OpenFOAM" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## fortls + +https://github.com/gnikit/fortls + +fortls is a Fortran Language Server, the server can be installed via pip + +```sh +pip install fortls +``` + +Settings to the server can be passed either through the `cmd` option or through +a local configuration file e.g. `.fortls`. For more information +see the `fortls` [documentation](https://gnikit.github.io/fortls/options.html). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fortls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fortls", "--notify_init", "--hover_signature", "--hover_language=fortran", "--use_signature_help" } + ``` + - `filetypes` : + ```lua + { "fortran" } + ``` + - `root_dir` : + ```lua + root_pattern(".fortls") + ``` + - `settings` : + ```lua + {} + ``` + + +## fsautocomplete + +https://github.com/fsharp/FsAutoComplete + +Language Server for F# provided by FsAutoComplete (FSAC). + +FsAutoComplete requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +The preferred way to install FsAutoComplete is with `dotnet tool install --global fsautocomplete`. + +Instructions to compile from source are found on the main [repository](https://github.com/fsharp/FsAutoComplete). + +You may also need to configure the filetype as Vim defaults to Forth for `*.fs` files: + +`autocmd BufNewFile,BufRead *.fs,*.fsx,*.fsi set filetype=fsharp` + +This is automatically done by plugins such as [PhilT/vim-fsharp](https://github.com/PhilT/vim-fsharp), [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp), and [adelarsq/neofsharp.vim](https://github.com/adelarsq/neofsharp.vim). + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fsautocomplete.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fsautocomplete", "--adaptive-lsp-server-enabled" } + ``` + - `filetypes` : + ```lua + { "fsharp" } + ``` + - `init_options` : + ```lua + { + AutomaticWorkspaceInit = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## fsharp_language_server + +F# Language Server +https://github.com/faldor20/fsharp-language-server + +An implementation of the language server protocol using the F# Compiler Service. + +Build the project from source and override the command path to location of DLL. + +If filetype determination is not already performed by an available plugin ([PhilT/vim-fsharp](https://github.com/PhilT/vim-fsharp), [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp), and [adelarsq/neofsharp.vim](https://github.com/adelarsq/neofsharp.vim). +), then the following must be added to initialization configuration: + + +`autocmd BufNewFile,BufRead *.fs,*.fsx,*.fsi set filetype=fsharp` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fsharp_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dotnet", "FSharpLanguageServer.dll" } + ``` + - `filetypes` : + ```lua + { "fsharp" } + ``` + - `init_options` : + ```lua + { + AutomaticWorkspaceInit = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## fstar + +https://github.com/FStarLang/FStar + +LSP support is included in FStar. Make sure `fstar.exe` is in your PATH. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fstar.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fstar.exe", "--lsp" } + ``` + - `filetypes` : + ```lua + { "fstar" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## gdscript + +https://github.com/godotengine/godot + +Language server for GDScript, used by Godot Engine. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gdscript.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + see source file + ``` + - `filetypes` : + ```lua + { "gd", "gdscript", "gdscript3" } + ``` + - `root_dir` : + ```lua + util.root_pattern("project.godot", ".git") + ``` + + +## ghcide + +https://github.com/digital-asset/ghcide + +A library for building Haskell IDE tooling. +"ghcide" isn't for end users now. Use "haskell-language-server" instead of "ghcide". + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ghcide.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ghcide", "--lsp" } + ``` + - `filetypes` : + ```lua + { "haskell", "lhaskell" } + ``` + - `root_dir` : + ```lua + root_pattern("stack.yaml", "hie-bios", "BUILD.bazel", "cabal.config", "package.yaml") + ``` + + +## ghdl_ls + +https://github.com/ghdl/ghdl-language-server + +A language server for VHDL, using ghdl as its backend. + +`ghdl-ls` is part of pyghdl, for installation instructions see +[the upstream README](https://github.com/ghdl/ghdl/tree/master/pyGHDL/lsp). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ghdl_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ghdl-ls" } + ``` + - `filetypes` : + ```lua + { "vhdl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## gleam + +https://github.com/gleam-lang/gleam + +A language server for Gleam Programming Language. +[Installation](https://gleam.run/getting-started/installing/) + +It can be i + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gleam.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "gleam", "lsp" } + ``` + - `filetypes` : + ```lua + { "gleam" } + ``` + - `root_dir` : + ```lua + root_pattern("gleam.toml", ".git") + ``` + + +## glint + + https://github.com/typed-ember/glint + + https://typed-ember.gitbook.io/glint/ + + `glint-language-server` is installed when adding `@glint/core` to your project's devDependencies: + + ```sh + npm install @glint/core --save-dev + ``` + + or + + ```sh + yarn add -D @glint/core + ``` + + or + + ```sh + pnpm add -D @glint/core + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.glint.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "glint-language-server" } + ``` + - `filetypes` : + ```lua + { "html.handlebars", "handlebars", "typescript", "typescript.glimmer", "javascript", "javascript.glimmer" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## glslls + +https://github.com/svenstaro/glsl-language-server + +Language server implementation for GLSL + +`glslls` can be compiled and installed manually, or, if your distribution has access to the AUR, +via the `glsl-language-server` AUR package + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.glslls.setup{} +``` + + +**Default values:** + - `capabilities` : + ```lua + { + offsetEncoding = { "utf-8", "utf-16" }, + textDocument = { + completion = { + editsNearCursor = true + } + } + } + ``` + - `cmd` : + ```lua + { "glslls", "--stdin" } + ``` + - `filetypes` : + ```lua + { "glsl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## golangci_lint_ls + +Combination of both lint server and client + +https://github.com/nametake/golangci-lint-langserver +https://github.com/golangci/golangci-lint + + +Installation of binaries needed is done via + +``` +go install github.com/nametake/golangci-lint-langserver@latest +go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.golangci_lint_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "golangci-lint-langserver" } + ``` + - `filetypes` : + ```lua + { "go", "gomod" } + ``` + - `init_options` : + ```lua + { + command = { "golangci-lint", "run", "--out-format", "json" } + } + ``` + - `root_dir` : + ```lua + root_pattern('go.work') or root_pattern('go.mod', '.golangci.yaml', '.git') + ``` + + +## gopls + +https://github.com/golang/tools/tree/master/gopls + +Google's lsp server for golang. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gopls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "gopls" } + ``` + - `filetypes` : + ```lua + { "go", "gomod", "gowork", "gotmpl" } + ``` + - `root_dir` : + ```lua + root_pattern("go.mod", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## gradle_ls + +https://github.com/microsoft/vscode-gradle + +Microsoft's lsp server for gradle files + +If you're setting this up manually, build vscode-gradle using `./gradlew installDist` and point `cmd` to the `gradle-language-server` generated in the build directory + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gradle_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "gradle-language-server" } + ``` + - `filetypes` : + ```lua + { "groovy" } + ``` + - `init_options` : + ```lua + { + settings = { + gradleWrapperEnabled = true + } + } + ``` + - `root_dir` : + ```lua + root_pattern("settings.gradle") + ``` + + +## grammarly + +https://github.com/znck/grammarly + +`grammarly-languageserver` can be installed via `npm`: + +```sh +npm i -g grammarly-languageserver +``` + +WARNING: Since this language server uses Grammarly's API, any document you open with it running is shared with them. Please evaluate their [privacy policy](https://www.grammarly.com/privacy-policy) before using this. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.grammarly.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "grammarly-languageserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `handlers` : + ```lua + { + ["$/updateDocumentState"] = + } + ``` + - `init_options` : + ```lua + { + clientId = "client_BaDkMgx4X19X9UxxYRCXZo" + } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## graphql + +https://github.com/graphql/graphiql/tree/main/packages/graphql-language-service-cli + +`graphql-lsp` can be installed via `npm`: + +```sh +npm install -g graphql-language-service-cli +``` + +Note that you must also have [the graphql package](https://github.com/graphql/graphql-js) installed and create a [GraphQL config file](https://www.graphql-config.com/docs/user/user-introduction). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.graphql.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "graphql-lsp", "server", "-m", "stream" } + ``` + - `filetypes` : + ```lua + { "graphql", "typescriptreact", "javascriptreact" } + ``` + - `root_dir` : + ```lua + util.root_pattern('.git', '.graphqlrc*', '.graphql.config.*', 'graphql.config.*') + ``` + + +## groovyls + +https://github.com/prominic/groovy-language-server.git + +Requirements: + - Linux/macOS (for now) + - Java 11+ + +`groovyls` can be installed by following the instructions [here](https://github.com/prominic/groovy-language-server.git#build). + +If you have installed groovy language server, you can set the `cmd` custom path as follow: + +```lua +require'lspconfig'.groovyls.setup{ + -- Unix + cmd = { "java", "-jar", "path/to/groovyls/groovy-language-server-all.jar" }, + ... +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.groovyls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "java", "-jar", "groovy-language-server-all.jar" } + ``` + - `filetypes` : + ```lua + { "groovy" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## haxe_language_server + +https://github.com/vshaxe/haxe-language-server + +The Haxe language server can be built by running the following commands from +the project's root directory: + + npm install + npx lix run vshaxe-build -t language-server + +This will create `bin/server.js`. Note that the server requires Haxe 3.4.0 or +higher. + +After building the language server, set the `cmd` setting in your setup +function: + +```lua +lspconfig.haxe_language_server.setup({ + cmd = {"node", "path/to/bin/server.js"}, +}) +``` + +By default, an HXML compiler arguments file named `build.hxml` is expected in +your project's root directory. If your file is named something different, +specify it using the `init_options.displayArguments` setting. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.haxe_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "haxe-language-server" } + ``` + - `filetypes` : + ```lua + { "haxe" } + ``` + - `init_options` : + ```lua + { + displayArguments = { "build.hxml" } + } + ``` + - `root_dir` : + ```lua + root_pattern("*.hxml") + ``` + - `settings` : + ```lua + { + haxe = { + executable = "haxe" + } + } + ``` + + +## hdl_checker + +https://github.com/suoto/hdl_checker +Language server for hdl-checker. +Install using: `pip install hdl-checker --upgrade` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hdl_checker.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hdl_checker", "--lsp" } + ``` + - `filetypes` : + ```lua + { "vhdl", "verilog", "systemverilog" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## hhvm + +Language server for programs written in Hack +https://hhvm.com/ +https://github.com/facebook/hhvm +See below for how to setup HHVM & typechecker: +https://docs.hhvm.com/hhvm/getting-started/getting-started + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hhvm.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hh_client", "lsp" } + ``` + - `filetypes` : + ```lua + { "php", "hack" } + ``` + - `root_dir` : + ```lua + root_pattern(".hhconfig") + ``` + + +## hie + +https://github.com/haskell/haskell-ide-engine + +the following init_options are supported (see https://github.com/haskell/haskell-ide-engine#configuration): +```lua +init_options = { + languageServerHaskell = { + hlintOn = bool; + maxNumberOfProblems = number; + diagnosticsDebounceDuration = number; + liquidOn = bool (default false); + completionSnippetsOn = bool (default true); + formatOnImportOn = bool (default true); + formattingProvider = string (default "brittany", alternate "floskell"); + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hie.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hie-wrapper", "--lsp" } + ``` + - `filetypes` : + ```lua + { "haskell" } + ``` + - `root_dir` : + ```lua + root_pattern("stack.yaml", "package.yaml", ".git") + ``` + + +## hls + +https://github.com/haskell/haskell-language-server + +Haskell Language Server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "haskell-language-server-wrapper", "--lsp" } + ``` + - `filetypes` : + ```lua + { "haskell", "lhaskell" } + ``` + - `lspinfo` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + function (filepath) + return ( + util.root_pattern('hie.yaml', 'stack.yaml', 'cabal.project')(filepath) + or util.root_pattern('*.cabal', 'package.yaml')(filepath) + ) + end + + ``` + - `settings` : + ```lua + { + haskell = { + formattingProvider = "ormolu" + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## hoon_ls + +https://github.com/urbit/hoon-language-server + +A language server for Hoon. + +The language server can be installed via `npm install -g @hoon-language-server` + +Start a fake ~zod with `urbit -F zod`. +Start the language server at the Urbit Dojo prompt with: `|start %language-server` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hoon_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hoon-language-server" } + ``` + - `filetypes` : + ```lua + { "hoon" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## html + +https://github.com/hrsh7th/vscode-langservers-extracted + +`vscode-html-language-server` can be installed via `npm`: +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-html-language-server` only provides completions when snippet support is enabled. +To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +The code-formatting feature of the lsp can be controlled with the `provideFormatter` option. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.html.setup { + capabilities = capabilities, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.html.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vscode-html-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "html" } + ``` + - `init_options` : + ```lua + { + configurationSection = { "html", "css", "javascript" }, + embeddedLanguages = { + css = true, + javascript = true + }, + provideFormatter = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## idris2_lsp + +https://github.com/idris-community/idris2-lsp + +The Idris 2 language server. + +Plugins for the Idris 2 filetype include +[Idris2-Vim](https://github.com/edwinb/idris2-vim) (fewer features, stable) and +[Nvim-Idris2](https://github.com/ShinKage/nvim-idris2) (cutting-edge, +experimental). + +Idris2-Lsp requires a build of Idris 2 that includes the "Idris 2 API" package. +Package managers with known support for this build include the +[AUR](https://aur.archlinux.org/packages/idris2/) and +[Homebrew](https://formulae.brew.sh/formula/idris2#default). + +If your package manager does not support the Idris 2 API, you will need to build +Idris 2 from source. Refer to the +[the Idris 2 installation instructions](https://github.com/idris-lang/Idris2/blob/main/INSTALL.md) +for details. Steps 5 and 8 are listed as "optional" in that guide, but they are +necessary in order to make the Idris 2 API available. + +You need to install a version of Idris2-Lsp that is compatible with your +version of Idris 2. There should be a branch corresponding to every released +Idris 2 version after v0.4.0. Use the latest commit on that branch. For example, +if you have Idris v0.5.1, you should use the v0.5.1 branch of Idris2-Lsp. + +If your Idris 2 version is newer than the newest Idris2-Lsp branch, use the +latest commit on the `master` branch, and set a reminder to check the Idris2-Lsp +repo for the release of a compatible versioned branch. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.idris2_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "idris2-lsp" } + ``` + - `filetypes` : + ```lua + { "idris2" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## intelephense + +https://intelephense.com/ + +`intelephense` can be installed via `npm`: +```sh +npm install -g intelephense +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.intelephense.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "intelephense", "--stdio" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("composer.json", ".git") + ``` + + +## java_language_server + +https://github.com/georgewfraser/java-language-server + +Java language server + +Point `cmd` to `lang_server_linux.sh` or the equivalent script for macOS/Windows provided by java-language-server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.java_language_server.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "java" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## jdtls + +https://projects.eclipse.org/projects/eclipse.jdt.ls + +Language server for Java. + +IMPORTANT: If you want all the features jdtls has to offer, [nvim-jdtls](https://github.com/mfussenegger/nvim-jdtls) +is highly recommended. If all you need is diagnostics, completion, imports, gotos and formatting and some code actions +you can keep reading here. + +For manual installation you can download precompiled binaries from the +[official downloads site](http://download.eclipse.org/jdtls/snapshots/?d) +and ensure that the `PATH` variable contains the `bin` directory of the extracted archive. + +```lua + -- init.lua + require'lspconfig'.jdtls.setup{} +``` + +You can also pass extra custom jvm arguments with the JDTLS_JVM_ARGS environment variable as a space separated list of arguments, +that will be converted to multiple --jvm-arg= args when passed to the jdtls script. This will allow for example tweaking +the jvm arguments or integration with external tools like lombok: + +```sh +export JDTLS_JVM_ARGS="-javaagent:$HOME/.local/share/java/lombok.jar" +``` + +For automatic installation you can use the following unofficial installers/launchers under your own risk: + - [jdtls-launcher](https://github.com/eruizc-dev/jdtls-launcher) (Includes lombok support by default) + ```lua + -- init.lua + require'lspconfig'.jdtls.setup{ cmd = { 'jdtls' } } + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jdtls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "jdtls", "-configuration", "/home/runner/.cache/jdtls/config", "-data", "/home/runner/.cache/jdtls/workspace" } + ``` + - `filetypes` : + ```lua + { "java" } + ``` + - `handlers` : + ```lua + { + ["$/progress"] = , + ["language/status"] = , + ["textDocument/codeAction"] = , + ["textDocument/rename"] = , + ["workspace/applyEdit"] = + } + ``` + - `init_options` : + ```lua + { + jvm_args = {}, + workspace = "/home/runner/.cache/jdtls/workspace" + } + ``` + - `root_dir` : + ```lua + { + -- Single-module projects + { + 'build.xml', -- Ant + 'pom.xml', -- Maven + 'settings.gradle', -- Gradle + 'settings.gradle.kts', -- Gradle + }, + -- Multi-module projects + { 'build.gradle', 'build.gradle.kts' }, + } or vim.fn.getcwd() + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jedi_language_server + +https://github.com/pappasam/jedi-language-server + +`jedi-language-server`, a language server for Python, built on top of jedi + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jedi_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "jedi-language-server" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + vim's starting directory + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jsonls + +https://github.com/hrsh7th/vscode-langservers-extracted + +vscode-json-language-server, a language server for JSON and JSON schema + +`vscode-json-language-server` can be installed via `npm`: +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-json-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.jsonls.setup { + capabilities = capabilities, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jsonls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vscode-json-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "json", "jsonc" } + ``` + - `init_options` : + ```lua + { + provideFormatter = true + } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jsonnet_ls + +https://github.com/grafana/jsonnet-language-server + +A Language Server Protocol (LSP) server for Jsonnet. + +The language server can be installed with `go`: +```sh +go install github.com/grafana/jsonnet-language-server@latest +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jsonnet_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "jsonnet-language-server" } + ``` + - `filetypes` : + ```lua + { "jsonnet", "libsonnet" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("jsonnetfile.json") + ``` + + +## julials + +https://github.com/julia-vscode/julia-vscode + +LanguageServer.jl can be installed with `julia` and `Pkg`: +```sh +julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.add("LanguageServer")' +``` +where `~/.julia/environments/nvim-lspconfig` is the location where +the default configuration expects LanguageServer.jl to be installed. + +To update an existing install, use the following command: +```sh +julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.update()' +``` + +Note: In order to have LanguageServer.jl pick up installed packages or dependencies in a +Julia project, you must make sure that the project is instantiated: +```sh +julia --project=/path/to/my/project -e 'using Pkg; Pkg.instantiate()' +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.julials.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "julia", "--startup-file=no", "--history-file=no", "-e", ' # Load LanguageServer.jl: attempt to load from ~/.julia/environments/nvim-lspconfig\n # with the regular load path as a fallback\n ls_install_path = joinpath(\n get(DEPOT_PATH, 1, joinpath(homedir(), ".julia")),\n "environments", "nvim-lspconfig"\n )\n pushfirst!(LOAD_PATH, ls_install_path)\n using LanguageServer\n popfirst!(LOAD_PATH)\n depot_path = get(ENV, "JULIA_DEPOT_PATH", "")\n project_path = let\n dirname(something(\n ## 1. Finds an explicitly set project (JULIA_PROJECT)\n Base.load_path_expand((\n p = get(ENV, "JULIA_PROJECT", nothing);\n p === nothing ? nothing : isempty(p) ? nothing : p\n )),\n ## 2. Look for a Project.toml file in the current working directory,\n ## or parent directories, with $HOME as an upper boundary\n Base.current_project(),\n ## 3. First entry in the load path\n get(Base.load_path(), 1, nothing),\n ## 4. Fallback to default global environment,\n ## this is more or less unreachable\n Base.load_path_expand("@v#.#"),\n ))\n end\n @info "Running language server" VERSION pwd() project_path depot_path\n server = LanguageServer.LanguageServerInstance(stdin, stdout, project_path, depot_path)\n server.runlinter = true\n run(server)\n ' } + ``` + - `filetypes` : + ```lua + { "julia" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## kotlin_language_server + + A kotlin language server which was developed for internal usage and + released afterwards. Maintaining is not done by the original author, + but by fwcd. + + It is built via gradle and developed on github. + Source and additional description: + https://github.com/fwcd/kotlin-language-server + + This server requires vim to be aware of the kotlin-filetype. + You could refer for this capability to: + https://github.com/udalov/kotlin-vim (recommended) + Note that there is no LICENSE specified yet. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.kotlin_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "kotlin-language-server" } + ``` + - `filetypes` : + ```lua + { "kotlin" } + ``` + - `root_dir` : + ```lua + root_pattern("settings.gradle") + ``` + + +## lean3ls + +https://github.com/leanprover/lean-client-js/tree/master/lean-language-server + +Lean installation instructions can be found +[here](https://leanprover-community.github.io/get_started.html#regular-install). + +Once Lean is installed, you can install the Lean 3 language server by running +```sh +npm install -g lean-language-server +``` + +Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim), +that plugin fully handles the setup of the Lean language server, +and you shouldn't set up `lean3ls` both with it and `lspconfig`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lean3ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lean-language-server", "--stdio", "--", "-M", "4096", "-T", "100000" } + ``` + - `filetypes` : + ```lua + { "lean3" } + ``` + - `offset_encoding` : + ```lua + "utf-32" + ``` + - `root_dir` : + ```lua + root_pattern("leanpkg.toml") or root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## leanls + +https://github.com/leanprover/lean4 + +Lean installation instructions can be found +[here](https://leanprover-community.github.io/get_started.html#regular-install). + +The Lean 4 language server is built-in with a Lean 4 install +(and can be manually run with, e.g., `lean --server`). + +Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim), +that plugin fully handles the setup of the Lean language server, +and you shouldn't set up `leanls` both with it and `lspconfig`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.leanls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lake", "serve", "--" } + ``` + - `filetypes` : + ```lua + { "lean" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `options` : + ```lua + { + no_lake_lsp_cmd = { "lean", "--server" } + } + ``` + - `root_dir` : + ```lua + root_pattern("lakefile.lean", "lean-toolchain", "leanpkg.toml", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## lelwel_ls + +https://github.com/0x2a-42/lelwel + +Language server for lelwel grammars. + +You can install `lelwel-ls` via cargo: +```sh +cargo install --features="lsp" lelwel +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lelwel_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lelwel-ls" } + ``` + - `filetypes` : + ```lua + { "llw" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## lemminx + +https://github.com/eclipse/lemminx + +The easiest way to install the server is to get a binary from https://github.com/redhat-developer/vscode-xml/releases and place it on your PATH. + +NOTE to macOS users: Binaries from unidentified developers are blocked by default. If you trust the downloaded binary, run it once, cancel the prompt, then remove the binary from Gatekeeper quarantine with `xattr -d com.apple.quarantine lemminx`. It should now run without being blocked. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lemminx.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lemminx" } + ``` + - `filetypes` : + ```lua + { "xml", "xsd", "xsl", "xslt", "svg" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ltex + +https://github.com/valentjn/ltex-ls + +LTeX Language Server: LSP language server for LanguageTool 🔍✔️ with support for LaTeX 🎓, Markdown 📝, and others + +To install, download the latest [release](https://github.com/valentjn/ltex-ls/releases) and ensure `ltex-ls` is on your path. + +To support org files or R sweave, users can define a custom filetype autocommand (or use a plugin which defines these filetypes): + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.org set filetype=org ]] +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ltex.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ltex-ls" } + ``` + - `filetypes` : + ```lua + { "bib", "gitcommit", "markdown", "org", "plaintex", "rst", "rnoweb", "tex" } + ``` + - `get_language_id` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## luau_lsp + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.luau_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "luau-lsp", "lsp" } + ``` + - `filetypes` : + ```lua + { "luau" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## m68k + +https://github.com/grahambates/m68k-lsp + +Language server for Motorola 68000 family assembly + +`m68k-lsp-server` can be installed via `npm`: + +```sh +npm install -g m68k-lsp-server +``` + +Ensure you are using the 68k asm syntax variant in Neovim. + +```lua +vim.g.asmsyntax = 'asm68k' +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.m68k.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "m68k-lsp-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "asm68k" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## marksman + +https://github.com/artempyanykh/marksman + +Marksman is a Markdown LSP server providing completion, cross-references, diagnostics, and more. + +Marksman works on MacOS, Linux, and Windows and is distributed as a self-contained binary for each OS. + +Pre-built binaries can be downloaded from https://github.com/artempyanykh/marksman/releases + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.marksman.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "marksman", "server" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + root_pattern(".git", ".marksman.toml") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## metals + +https://scalameta.org/metals/ + +Scala language server with rich IDE features. + +See full instructions in the Metals documentation: + +https://scalameta.org/metals/docs/editors/vim#using-an-alternative-lsp-client + +Note: that if you're using [nvim-metals](https://github.com/scalameta/nvim-metals), that plugin fully handles the setup and installation of Metals, and you shouldn't set up Metals both with it and `lspconfig`. + +To install Metals, make sure to have [coursier](https://get-coursier.io/docs/cli-installation) installed, and once you do you can install the latest Metals with `cs install metals`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.metals.setup{} +``` + + +**Default values:** + - `capabilities` : + ```lua + { + workspace = { + configuration = false + } + } + ``` + - `cmd` : + ```lua + { "metals" } + ``` + - `filetypes` : + ```lua + { "scala" } + ``` + - `init_options` : + ```lua + { + compilerOptions = { + snippetAutoIndent = false + }, + isHttpEnabled = true, + statusBarProvider = "show-message" + } + ``` + - `message_level` : + ```lua + 4 + ``` + - `root_dir` : + ```lua + util.root_pattern("build.sbt", "build.sc", "build.gradle", "pom.xml") + ``` + + +## millet + +https://github.com/azdavis/millet + +Millet, a language server for Standard ML + +To use with nvim: + +1. Install a Rust toolchain: https://rustup.rs +2. Clone the repo +3. Run `cargo build --release --bin lang-srv` +4. Move `target/release/lang-srv` to somewhere on your $PATH as `millet` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.millet.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "millet" } + ``` + - `filetypes` : + ```lua + { "sml" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## mint + +https://www.mint-lang.com + +Install Mint using the [instructions](https://www.mint-lang.com/install). +The language server is included since version 0.12.0. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mint.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mint", "ls" } + ``` + - `filetypes` : + ```lua + { "mint" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## mlir_lsp_server + +https://mlir.llvm.org/docs/Tools/MLIRLSP/#mlir-lsp-language-server--mlir-lsp-server= + +The Language Server for the LLVM MLIR language + +`mlir-lsp-server` can be installed at the llvm-project repository (https://github.com/llvm/llvm-project) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mlir_lsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mlir-lsp-server" } + ``` + - `filetypes` : + ```lua + { "mlir" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## mlir_pdll_lsp_server + +https://mlir.llvm.org/docs/Tools/MLIRLSP/#pdll-lsp-language-server--mlir-pdll-lsp-server + +The Language Server for the LLVM PDLL language + +`mlir-pdll-lsp-server` can be installed at the llvm-project repository (https://github.com/llvm/llvm-project) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mlir_pdll_lsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mlir-pdll-lsp-server" } + ``` + - `filetypes` : + ```lua + { "pdll" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## mm0_ls + +https://github.com/digama0/mm0 + +Language Server for the metamath-zero theorem prover. + +Requires [mm0-rs](https://github.com/digama0/mm0/tree/master/mm0-rs) to be installed +and available on the `PATH`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mm0_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mm0-rs", "server" } + ``` + - `filetypes` : + ```lua + { "metamath-zero" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## move_analyzer + +https://github.com/move-language/move/tree/main/language/move-analyzer + +Language server for Move + +The `move-analyzer` can be installed by running: + +``` +cargo install --git https://github.com/move-language/move move-analyzer +``` + +See [`move-analyzer`'s doc](https://github.com/move-language/move/blob/1b258a06e3c7d2bc9174578aac92cca3ac19de71/language/move-analyzer/editors/code/README.md#how-to-install) for details. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.move_analyzer.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "move-analyzer" } + ``` + - `filetypes` : + ```lua + { "move" } + ``` + - `root_dir` : + ```lua + root_pattern("Move.toml") + ``` + + +## neocmake + +https://github.com/Decodetalkers/neocmakelsp + +CMake LSP Implementation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.neocmake.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "neocmakelsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "cmake" } + ``` + - `root_dir` : + ```lua + root_pattern('.git', 'cmake') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nickel_ls + +Nickel Language Server + +https://github.com/tweag/nickel + +`nls` can be installed with nix, or cargo, from the Nickel repository. +```sh +git clone https://github.com/tweag/nickel.git +``` + +Nix: +```sh +cd nickel +nix-env -f . -i +``` + +cargo: +```sh +cd nickel/lsp/nls +cargo install --path . +``` + +In order to have lspconfig detect Nickel filetypes (a prerequisite for autostarting a server), +install the [Nickel vim plugin](https://github.com/nickel-lang/vim-nickel). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nickel_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nls" } + ``` + - `filetypes` : + ```lua + { "ncl", "nickel" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## nil_ls + +https://github.com/oxalica/nil + +A new language server for Nix Expression Language. + +If you are using Nix with Flakes support, run `nix profile install github:oxalica/nil` to install. +Check the repository README for more information. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nil_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nil" } + ``` + - `filetypes` : + ```lua + { "nix" } + ``` + - `root_dir` : + ```lua + root_pattern("flake.nix", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nimls + +https://github.com/PMunch/nimlsp + +`nimlsp` can be installed via the `nimble` package manager: + +```sh +nimble install nimlsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nimls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nimlsp" } + ``` + - `filetypes` : + ```lua + { "nim" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ntt + +https://github.com/nokia/ntt +Installation instructions can be found [here](https://github.com/nokia/ntt#Install). +Can be configured by passing a "settings" object to `ntt.setup{}`: +```lua +require('lspconfig').ntt.setup{ + settings = { + ntt = { + } + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ntt.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ntt", "langserver" } + ``` + - `filetypes` : + ```lua + { "ttcn" } + ``` + - `root_dir` : + ```lua + util.root_pattern(".git") + ``` + + +## nxls + +https://github.com/nrwl/nx-console/tree/master/apps/nxls + +nxls, a language server for Nx Workspaces + +`nxls` can be installed via `npm`: +```sh +npm i -g nxls +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nxls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nxls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "json", "jsonc" } + ``` + - `root_dir` : + ```lua + util.root_pattern + ``` + + +## ocamlls + +https://github.com/ocaml-lsp/ocaml-language-server + +`ocaml-language-server` can be installed via `npm` +```sh +npm install -g ocaml-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ocamlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ocaml-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "ocaml", "reason" } + ``` + - `root_dir` : + ```lua + root_pattern("*.opam", "esy.json", "package.json") + ``` + + +## ocamllsp + +https://github.com/ocaml/ocaml-lsp + +`ocaml-lsp` can be installed as described in [installation guide](https://github.com/ocaml/ocaml-lsp#installation). + +To install the lsp server in a particular opam switch: +```sh +opam install ocaml-lsp-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ocamllsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ocamllsp" } + ``` + - `filetypes` : + ```lua + { "ocaml", "ocaml.menhir", "ocaml.interface", "ocaml.ocamllex", "reason", "dune" } + ``` + - `get_language_id` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("*.opam", "esy.json", "package.json", ".git", "dune-project", "dune-workspace") + ``` + + +## ols + + https://github.com/DanielGavin/ols + + `Odin Language Server`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ols.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ols" } + ``` + - `filetypes` : + ```lua + { "odin" } + ``` + - `root_dir` : + ```lua + util.root_pattern("ols.json", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## omnisharp + +https://github.com/omnisharp/omnisharp-roslyn +OmniSharp server based on Roslyn workspaces + +`omnisharp-roslyn` can be installed by downloading and extracting a release from [here](https://github.com/OmniSharp/omnisharp-roslyn/releases). +OmniSharp can also be built from source by following the instructions [here](https://github.com/omnisharp/omnisharp-roslyn#downloading-omnisharp). + +OmniSharp requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +**By default, omnisharp-roslyn doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. + +```lua +require'lspconfig'.omnisharp.setup { + cmd = { "dotnet", "/path/to/omnisharp/OmniSharp.dll" }, + + -- Enables support for reading code style, naming convention and analyzer + -- settings from .editorconfig. + enable_editorconfig_support = true, + + -- If true, MSBuild project system will only load projects for files that + -- were opened in the editor. This setting is useful for big C# codebases + -- and allows for faster initialization of code navigation features only + -- for projects that are relevant to code that is being edited. With this + -- setting enabled OmniSharp may load fewer projects and may thus display + -- incomplete reference lists for symbols. + enable_ms_build_load_projects_on_demand = false, + + -- Enables support for roslyn analyzers, code fixes and rulesets. + enable_roslyn_analyzers = false, + + -- Specifies whether 'using' directives should be grouped and sorted during + -- document formatting. + organize_imports_on_format = false, + + -- Enables support for showing unimported types and unimported extension + -- methods in completion lists. When committed, the appropriate using + -- directive will be added at the top of the current file. This option can + -- have a negative impact on initial completion responsiveness, + -- particularly for the first few completion sessions after opening a + -- solution. + enable_import_completion = false, + + -- Specifies whether to include preview versions of the .NET SDK when + -- determining which version to use for project loading. + sdk_include_prereleases = true, + + -- Only run analyzers against open files when 'enableRoslynAnalyzers' is + -- true + analyze_open_documents_only = false, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.omnisharp.setup{} +``` + + +**Default values:** + - `analyze_open_documents_only` : + ```lua + false + ``` + - `enable_editorconfig_support` : + ```lua + true + ``` + - `enable_import_completion` : + ```lua + false + ``` + - `enable_ms_build_load_projects_on_demand` : + ```lua + false + ``` + - `enable_roslyn_analyzers` : + ```lua + false + ``` + - `filetypes` : + ```lua + { "cs", "vb" } + ``` + - `init_options` : + ```lua + {} + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `organize_imports_on_format` : + ```lua + false + ``` + - `root_dir` : + ```lua + root_pattern(".sln") or root_pattern(".csproj") + ``` + - `sdk_include_prereleases` : + ```lua + true + ``` + + +## opencl_ls + +https://github.com/Galarius/opencl-language-server + +Build instructions can be found [here](https://github.com/Galarius/opencl-language-server/blob/main/_dev/build.md). + +Prebuilt binaries are available for Linux, macOS and Windows [here](https://github.com/Galarius/opencl-language-server/releases). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.opencl_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "opencl-language-server" } + ``` + - `filetypes` : + ```lua + { "opencl" } + ``` + - `root_dir` : + ```lua + util.root_pattern(".git") + ``` + + +## openscad_ls + +https://github.com/dzhu/openscad-language-server + +A Language Server Protocol server for OpenSCAD + +You can build and install `openscad-language-server` binary with `cargo`: +```sh +cargo install openscad-language-server +``` + +Vim does not have built-in syntax for the `openscad` filetype currently. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.scad set filetype=openscad ]] +``` + +or by installing a filetype plugin such as https://github.com/sirtaj/vim-openscad + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.openscad_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "openscad-language-server" } + ``` + - `filetypes` : + ```lua + { "openscad" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## pasls + +https://github.com/genericptr/pascal-language-server + +An LSP server implementation for Pascal variants that are supported by Free Pascal, including Object Pascal. It uses CodeTools from Lazarus as backend. + +First set `cmd` to the Pascal lsp binary. + +Customization options are passed to pasls as environment variables for example in your `.bashrc`: +```bash +export FPCDIR='/usr/lib/fpc/src' # FPC source directory (This is the only required option for the server to work). +export PP='/usr/lib/fpc/3.2.2/ppcx64' # Path to the Free Pascal compiler executable. +export LAZARUSDIR='/usr/lib/lazarus' # Path to the Lazarus sources. +export FPCTARGET='' # Target operating system for cross compiling. +export FPCTARGETCPU='x86_64' # Target CPU for cross compiling. +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pasls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pasls" } + ``` + - `filetypes` : + ```lua + { "pascal" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## perlls + +https://github.com/richterger/Perl-LanguageServer/tree/master/clients/vscode/perl + +`Perl-LanguageServer`, a language server for Perl. + +To use the language server, ensure that you have Perl::LanguageServer installed and perl command is on your path. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.perlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "perl", "-MPerl::LanguageServer", "-e", "Perl::LanguageServer::run", "--", "--port 13603", "--nostdio 0", "--version 2.1.0" } + ``` + - `filetypes` : + ```lua + { "perl" } + ``` + - `root_dir` : + ```lua + vim's starting directory + ``` + - `settings` : + ```lua + { + perl = { + fileFilter = { ".pm", ".pl" }, + ignoreDirs = ".git", + perlCmd = "perl", + perlInc = " " + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## perlnavigator + +https://github.com/bscan/PerlNavigator + +A Perl language server + +**By default, perlnavigator doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. +You have to install the language server manually. + +Clone the PerlNavigator repo, install based on the [instructions](https://github.com/bscan/PerlNavigator#installation-for-other-editors), +and point `cmd` to `server.js` inside the `server/out` directory: + +```lua +cmd = {'node', '/server/out/server.js', '--stdio'} +``` + +At minimum, you will need `perl` in your path. If you want to use a non-standard `perl` you will need to set your configuration like so: +```lua +settings = { + perlnavigator = { + perlPath = '/some/odd/location/my-perl' + } +} +``` + +The `contributes.configuration.properties` section of `perlnavigator`'s `package.json` has all available configuration settings. All +settings have a reasonable default, but, at minimum, you may want to point `perlnavigator` at your `perltidy` and `perlcritic` configurations. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.perlnavigator.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + {} + ``` + - `filetypes` : + ```lua + { "perl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## perlpls + +https://github.com/FractalBoy/perl-language-server +https://metacpan.org/pod/PLS + +`PLS`, another language server for Perl. + +To use the language server, ensure that you have PLS installed and that it is in your path + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.perlpls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pls" } + ``` + - `filetypes` : + ```lua + { "perl" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `settings` : + ```lua + { + perl = { + perlcritic = { + enabled = false + }, + syntax = { + enabled = true + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## phan + +https://github.com/phan/phan + +Installation: https://github.com/phan/phan#getting-started + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.phan.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "phan", "-m", "json", "--no-color", "--no-progress-bar", "-x", "-u", "-S", "--language-server-on-stdin", "--allow-polyfill-parser" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("composer.json", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## phpactor + +https://github.com/phpactor/phpactor + +Installation: https://phpactor.readthedocs.io/en/master/usage/standalone.html#global-installation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.phpactor.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "phpactor", "language-server" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("composer.json", ".git") + ``` + + +## please + +https://github.com/thought-machine/please + +High-performance extensible build system for reproducible multi-language builds. + +The `plz` binary will automatically install the LSP for you on first run + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.please.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "plz", "tool", "lps" } + ``` + - `filetypes` : + ```lua + { "bzl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## powershell_es + +https://github.com/PowerShell/PowerShellEditorServices + +Language server for PowerShell. + +To install, download and extract PowerShellEditorServices.zip +from the [releases](https://github.com/PowerShell/PowerShellEditorServices/releases). +To configure the language server, set the property `bundle_path` to the root +of the extracted PowerShellEditorServices.zip. + +The default configuration doesn't set `cmd` unless `bundle_path` is specified. + +```lua +require'lspconfig'.powershell_es.setup{ + bundle_path = 'c:/w/PowerShellEditorServices', +} +``` + +By default the languageserver is started in `pwsh` (PowerShell Core). This can be changed by specifying `shell`. + +```lua +require'lspconfig'.powershell_es.setup{ + bundle_path = 'c:/w/PowerShellEditorServices', + shell = 'powershell.exe', +} +``` + +Note that the execution policy needs to be set to `Unrestricted` for the languageserver run under PowerShell + +If necessary, specific `cmd` can be defined instead of `bundle_path`. +See [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices#stdio) +to learn more. + +```lua +require'lspconfig'.powershell_es.setup{ + cmd = {'pwsh', '-NoLogo', '-NoProfile', '-Command', "c:/PSES/Start-EditorServices.ps1 ..."} +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.powershell_es.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "ps1" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + git root or current directory + ``` + - `shell` : + ```lua + "pwsh" + ``` + - `single_file_support` : + ```lua + true + ``` + + +## prismals + +Language Server for the Prisma JavaScript and TypeScript ORM + +`@prisma/language-server` can be installed via npm +```sh +npm install -g @prisma/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.prismals.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "prisma-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "prisma" } + ``` + - `root_dir` : + ```lua + root_pattern(".git", "package.json") + ``` + - `settings` : + ```lua + { + prisma = { + prismaFmtBinPath = "" + } + } + ``` + + +## prolog_ls + + https://github.com/jamesnvc/lsp_server + + Language Server Protocol server for SWI-Prolog + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.prolog_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "swipl", "-g", "use_module(library(lsp_server)).", "-g", "lsp_server:main", "-t", "halt", "--", "stdio" } + ``` + - `filetypes` : + ```lua + { "prolog" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## prosemd_lsp + +https://github.com/kitten/prosemd-lsp + +An experimental LSP for Markdown. + +Please see the manual installation instructions: https://github.com/kitten/prosemd-lsp#manual-installation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.prosemd_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "prosemd-lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + + ``` + - `single_file_support` : + ```lua + true + ``` + + +## psalm + +https://github.com/vimeo/psalm + +Can be installed with composer. +```sh +composer global require vimeo/psalm +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.psalm.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "psalm-language-server" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("psalm.xml", "psalm.xml.dist") + ``` + + +## puppet + +LSP server for Puppet. + +Installation: + +- Clone the editor-services repository: + https://github.com/puppetlabs/puppet-editor-services + +- Navigate into that directory and run: `bundle install` + +- Install the 'puppet-lint' gem: `gem install puppet-lint` + +- Add that repository to $PATH. + +- Ensure you can run `puppet-languageserver` from outside the editor-services directory. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.puppet.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "puppet-languageserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "puppet" } + ``` + - `root_dir` : + ```lua + root_pattern("manifests", ".puppet-lint.rc", "hiera.yaml", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## purescriptls + +https://github.com/nwolverson/purescript-language-server + +The `purescript-language-server` can be added to your project and `$PATH` via + +* JavaScript package manager such as npm, pnpm, Yarn, et al. +* Nix under the `nodePackages` and `nodePackages_latest` package sets + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.purescriptls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "purescript-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "purescript" } + ``` + - `root_dir` : + ```lua + root_pattern('spago.dhall', 'psc-package.json', 'bower.json', 'flake.nix', 'shell.nix'), + ``` + + +## pylsp + +https://github.com/python-lsp/python-lsp-server + +A Python 3.6+ implementation of the Language Server Protocol. + +See the [project's README](https://github.com/python-lsp/python-lsp-server) for installation instructions. + +Configuration options are documented [here](https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md). +In order to configure an option, it must be translated to a nested Lua table and included in the `settings` argument to the `setup{}` function. +For example, in order to set the `pylsp.plugins.pycodestyle.ignore` option: +```lua +require'lspconfig'.pylsp.setup{ + settings = { + pylsp = { + plugins = { + pycodestyle = { + ignore = {'W391'}, + maxLineLength = 100 + } + } + } + } +} +``` + +Note: This is a community fork of `pyls`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pylsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pylsp" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## pyre + +https://pyre-check.org/ + +`pyre` a static type checker for Python 3. + +`pyre` offers an extremely limited featureset. It currently only supports diagnostics, +which are triggered on save. + +Do not report issues for missing features in `pyre` to `lspconfig`. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pyre.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pyre", "persistent" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## pyright + +https://github.com/microsoft/pyright + +`pyright`, a static type checker and language server for python + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pyright.setup{} +``` +**Commands:** +- PyrightOrganizeImports: Organize Imports + +**Default values:** + - `cmd` : + ```lua + { "pyright-langserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + python = { + analysis = { + autoSearchPaths = true, + diagnosticMode = "workspace", + useLibraryCodeForTypes = true + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## qml_lsp + +https://invent.kde.org/sdk/qml-lsp + +LSP implementation for QML (autocompletion, live linting, etc. in editors) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.qml_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "qml-lsp" } + ``` + - `filetypes` : + ```lua + { "qmljs" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## qmlls + +https://github.com/qt/qtdeclarative + +LSP implementation for QML (autocompletion, live linting, etc. in editors), + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.qmlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "qmlls" } + ``` + - `filetypes` : + ```lua + { "qmljs" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## quick_lint_js + +https://quick-lint-js.com/ + +quick-lint-js finds bugs in JavaScript programs. + +See installation [instructions](https://quick-lint-js.com/install/) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.quick_lint_js.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "quick-lint-js", "--lsp-server" } + ``` + - `filetypes` : + ```lua + { "javascript" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## r_language_server + +[languageserver](https://github.com/REditorSupport/languageserver) is an +implementation of the Microsoft's Language Server Protocol for the R +language. + +It is released on CRAN and can be easily installed by + +```R +install.packages("languageserver") +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.r_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "R", "--slave", "-e", "languageserver::run()" } + ``` + - `filetypes` : + ```lua + { "r", "rmd" } + ``` + - `log_level` : + ```lua + 2 + ``` + - `root_dir` : + ```lua + root_pattern(".git") or os_homedir + ``` + + +## racket_langserver + +[https://github.com/jeapostrophe/racket-langserver](https://github.com/jeapostrophe/racket-langserver) + +The Racket language server. This project seeks to use +[DrRacket](https://github.com/racket/drracket)'s public API to provide +functionality that mimics DrRacket's code tools as closely as possible. + +Install via `raco`: `raco pkg install racket-langserver` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.racket_langserver.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "racket", "--lib", "racket-langserver" } + ``` + - `filetypes` : + ```lua + { "racket", "scheme" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## reason_ls + +Reason language server + +You can install reason language server from [reason-language-server](https://github.com/jaredly/reason-language-server) repository. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.reason_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "reason-language-server" } + ``` + - `filetypes` : + ```lua + { "reason" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## relay_lsp + + https://github.com/facebook/relay + `Relay` is a JavaScript framework for building data-driven React applications + + Setup: + + - Make sure you have a Relay config file somewhere in your project. + - We support standard config file formats (`.yml`, `.js`, `.json`), and the the `relay` field in your `package.json` + - Make sure you have the `relay-compiler` installed in your project. The bare minimum is v13. + - Make sure you are able to run the `relay-compiler` command from the command line. If `yarn relay-compiler` works, it's very likely that the LSP will work. + - Remove / disable any conflicting GraphQL LSPs you have installed. + + Relay LSP is a part of the Relay Compiler binary and available when adding `relay-compiler` to your project's devDependencies. + + ```lua + require'lspconfig'.relay_lsp.setup { + -- (default: false) Whether or not we should automatically start + -- the Relay Compiler in watch mode when you open a project + auto_start_compiler = false, + + + -- (default: null) Path to a relay config relative to the + -- `root_dir`. Without this, the compiler will search for your + -- config. This is helpful if your relay project is in a nested + -- directory. + path_to_config = nil, + } + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.relay_lsp.setup{} +``` + + +**Default values:** + - `auto_start_compiler` : + ```lua + false + ``` + - `cmd` : + ```lua + { "relay-compiler", "lsp" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" } + ``` + - `handlers` : + ```lua + { + ["window/showStatus"] = + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("relay.config.*", "package.json") + ``` + + +## remark_ls + +https://github.com/remarkjs/remark-language-server + +`remark-language-server` can be installed via `npm`: +```sh +npm install -g remark-language-server +``` + +`remark-language-server` uses the same +[configuration files](https://github.com/remarkjs/remark/tree/main/packages/remark-cli#example-config-files-json-yaml-js) +as `remark-cli`. + +This uses a plugin based system. Each plugin needs to be installed locally using `npm` or `yarn`. + +For example, given the following `.remarkrc.json`: + +```json +{ + "presets": [ + "remark-preset-lint-recommended" + ] +} +``` + +`remark-preset-lint-recommended` needs to be installed in the local project: + +```sh +npm install remark-preset-lint-recommended +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.remark_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "remark-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## rescriptls + +https://github.com/rescript-lang/rescript-vscode + +ReScript language server + +**By default, rescriptls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. +You have to install the language server manually. + +You can use the bundled language server inside the [vim-rescript](https://github.com/rescript-lang/vim-rescript) repo. + +Clone the vim-rescript repo and point `cmd` to `server.js` inside `server/out` directory: + +```lua +cmd = {'node', '/server/out/server.js', '--stdio'} + +``` + +If you have vim-rescript installed you can also use that installation. for example if you're using packer.nvim you can set cmd to something like this: + +```lua +cmd = { + 'node', + '/home/username/.local/share/nvim/site/pack/packer/start/vim-rescript/server/out/server.js', + '--stdio' +} +``` + +Another option is to use vscode extension [release](https://github.com/rescript-lang/rescript-vscode/releases). +Take a look at [here](https://github.com/rescript-lang/rescript-vscode#use-with-other-editors) for instructions. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rescriptls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + {} + ``` + - `filetypes` : + ```lua + { "rescript" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## rls + +https://github.com/rust-lang/rls + +rls, a language server for Rust + +See https://github.com/rust-lang/rls#setup to setup rls itself. +See https://github.com/rust-lang/rls#configuration for rls-specific settings. +All settings listed on the rls configuration section of the readme +must be set under settings.rust as follows: + +```lua +nvim_lsp.rls.setup { + settings = { + rust = { + unstable_features = true, + build_on_save = false, + all_features = true, + }, + }, +} +``` + +If you want to use rls for a particular build, eg nightly, set cmd as follows: + +```lua +cmd = {"rustup", "run", "nightly", "rls"} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rls" } + ``` + - `filetypes` : + ```lua + { "rust" } + ``` + - `root_dir` : + ```lua + root_pattern("Cargo.toml") + ``` + + +## rnix + +https://github.com/nix-community/rnix-lsp + +A language server for Nix providing basic completion and formatting via nixpkgs-fmt. + +To install manually, run `cargo install rnix-lsp`. If you are using nix, rnix-lsp is in nixpkgs. + +This server accepts configuration via the `settings` key. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rnix.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rnix-lsp" } + ``` + - `filetypes` : + ```lua + { "nix" } + ``` + - `init_options` : + ```lua + {} + ``` + - `root_dir` : + ```lua + vim's starting directory + ``` + - `settings` : + ```lua + {} + ``` + + +## robotframework_ls + +https://github.com/robocorp/robotframework-lsp + +Language Server Protocol implementation for Robot Framework. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.robotframework_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "robotframework_ls" } + ``` + - `filetypes` : + ```lua + { "robot" } + ``` + - `root_dir` : + ```lua + util.root_pattern('robotidy.toml', 'pyproject.toml')(fname) or util.find_git_ancestor(fname) + ``` + + +## rome + +https://rome.tools + +Language server for the Rome Frontend Toolchain. + +```sh +npm install [-g] rome +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rome.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rome", "lsp-proxy" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "json", "typescript", "typescript.tsx", "typescriptreact" } + ``` + - `root_dir` : + ```lua + root_pattern('package.json', 'node_modules', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ruby_ls + +https://shopify.github.io/ruby-lsp/ + +This gem is an implementation of the language server protocol specification for +Ruby, used to improve editor features. + +Install the gem. There's no need to require it, since the server is used as a +standalone executable. + +```sh +group :development do + gem "ruby-lsp", require: false +end +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ruby_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ruby-lsp" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `init_options` : + ```lua + { + enabledFeatures = { "codeActions", "diagnostics", "documentHighlights", "documentSymbols", "formatting", "inlayHint" } + } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + + +## rust_analyzer + +https://github.com/rust-analyzer/rust-analyzer + +rust-analyzer (aka rls 2.0), a language server for Rust + +See [docs](https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/user#settings) for extra settings. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rust_analyzer.setup{} +``` +**Commands:** +- CargoReload: Reload current cargo workspace + +**Default values:** + - `cmd` : + ```lua + { "rust-analyzer" } + ``` + - `filetypes` : + ```lua + { "rust" } + ``` + - `root_dir` : + ```lua + root_pattern("Cargo.toml", "rust-project.json") + ``` + - `settings` : + ```lua + { + ["rust-analyzer"] = {} + } + ``` + + +## salt_ls + +Language server for Salt configuration files. +https://github.com/dcermak/salt-lsp + +The language server can be installed with `pip`: +```sh +pip install salt-lsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.salt_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "salt_lsp_server" } + ``` + - `filetypes` : + ```lua + { "sls" } + ``` + - `root_dir` : + ```lua + root_pattern('.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## scheme_langserver + +https://github.com/ufo5260987423/scheme-langserver +`scheme-langserver`, a language server protocol implementation for scheme. +And for nvim user, please add .sls to scheme file extension list. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.scheme_langserver.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "scheme-langserver" } + ``` + - `filetypes` : + ```lua + { "scheme" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## scry + +https://github.com/crystal-lang-tools/scry + +Crystal language server. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.scry.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "scry" } + ``` + - `filetypes` : + ```lua + { "crystal" } + ``` + - `root_dir` : + ```lua + root_pattern('shard.yml', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## serve_d + + https://github.com/Pure-D/serve-d + + `Microsoft language server protocol implementation for D using workspace-d.` + Download a binary from https://github.com/Pure-D/serve-d/releases and put it in your $PATH. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.serve_d.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "serve-d" } + ``` + - `filetypes` : + ```lua + { "d" } + ``` + - `root_dir` : + ```lua + util.root_pattern("dub.json", "dub.sdl", ".git") + ``` + + +## sixtyfps + +https://github.com/sixtyfpsui/sixtyfps +`SixtyFPS`'s language server + +You can build and install `sixtyfps-lsp` binary with `cargo`: +```sh +cargo install sixtyfps-lsp +``` + +Vim does not have built-in syntax for the `sixtyfps` filetype currently. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.60 set filetype=sixtyfps ]] +``` + +or by installing a filetype plugin such as https://github.com/RustemB/sixtyfps-vim + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sixtyfps.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sixtyfps-lsp" } + ``` + - `filetypes` : + ```lua + { "sixtyfps" } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## slint_lsp + +https://github.com/slint-ui/slint +`Slint`'s language server + +You can build and install `slint-lsp` binary with `cargo`: +```sh +cargo install slint-lsp +``` + +Vim does not have built-in syntax for the `slint` filetype at this time. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.slint set filetype=slint ]] +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.slint_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "slint-lsp" } + ``` + - `filetypes` : + ```lua + { "slint" } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## smarty_ls + +https://github.com/landeaux/vscode-smarty-langserver-extracted + +Language server for Smarty. + +`smarty-language-server` can be installed via `npm`: + +```sh +npm i -g vscode-smarty-langserver-extracted +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.smarty_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "smarty-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "smarty" } + ``` + - `init_options` : + ```lua + {} + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + css = { + validate = true + }, + smarty = { + pluginDirs = {} + } + } + ``` + + +## solang + +A language server for Solidity + +See the [documentation](https://solang.readthedocs.io/en/latest/installing.html) for installation instructions. + +The language server only provides the following capabilities: +* Syntax highlighting +* Diagnostics +* Hover + +There is currently no support for completion, goto definition, references, or other functionality. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solang.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solang", "--language-server", "--target", "ewasm" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## solargraph + +https://solargraph.org/ + +solargraph, a language server for Ruby + +You can install solargraph via gem install. + +```sh +gem install --user-install solargraph +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solargraph.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solargraph", "stdio" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `init_options` : + ```lua + { + formatting = true + } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + - `settings` : + ```lua + { + solargraph = { + diagnostics = true + } + } + ``` + + +## solc + +https://docs.soliditylang.org/en/latest/installing-solidity.html + +solc is the native language server for the Solidity language. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solc.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solc", "--lsp" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + root_pattern('hardhat.config.*', '.git') + ``` + + +## solidity + +https://github.com/qiuxiang/solidity-ls + +npm i solidity-ls -g + +Make sure that solc is installed and it's the same version of the file. solc-select is recommended. + +Solidity language server is a LSP with autocomplete, go to definition and diagnostics. + +If you use brownie, use this root_dir: +root_dir = util.root_pattern('brownie-config.yaml', '.git') + +on includePath, you can add an extra path to search for external libs, on remapping you can remap lib <> path, like: + +```lua +{ solidity = { includePath = '/Users/your_user/.brownie/packages/', remapping = { ["@OpenZeppelin/"] = 'OpenZeppelin/openzeppelin-contracts@4.6.0/' } } } +``` + +**For brownie users** +Change the root_dir to: + +```lua +root_pattern("brownie-config.yaml", ".git") +``` + +The best way of using it is to have a package.json in your project folder with the packages that you will use. +After installing with package.json, just create a `remappings.txt` with: + +``` +@OpenZeppelin/=node_modules/OpenZeppelin/openzeppelin-contracts@4.6.0/ +``` + +You can omit the node_modules as well. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solidity.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solidity-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") + ``` + - `settings` : + ```lua + { + solidity = { + includePath = "", + remapping = {} + } + } + ``` + + +## solidity_ls + +npm install -g solidity-language-server + +solidity-language-server is a language server for the solidity language ported from the vscode solidity extension + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solidity_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solidity-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + root_pattern(".git", "package.json") + ``` + + +## sorbet + +https://sorbet.org + +Sorbet is a fast, powerful type checker designed for Ruby. + +You can install Sorbet via gem install. You might also be interested in how to set +Sorbet up for new projects: https://sorbet.org/docs/adopting. + +```sh +gem install sorbet +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sorbet.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "srb", "tc", "--lsp" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + + +## sourcekit + +https://github.com/apple/sourcekit-lsp + +Language server for Swift and C/C++/Objective-C. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sourcekit.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sourcekit-lsp" } + ``` + - `filetypes` : + ```lua + { "swift", "c", "cpp", "objective-c", "objective-cpp" } + ``` + - `root_dir` : + ```lua + root_pattern("Package.swift", ".git") + ``` + + +## sourcery + +https://github.com/sourcery-ai/sourcery + +Refactor Python instantly using the power of AI. + +It requires the init_options param to be populated as shown below and will respond with the list of ServerCapabilities that it supports: + +```lua +require'lspconfig'.sourcery.setup { + init_options = { + --- The Sourcery token for authenticating the user. + --- This is retrieved from the Sourcery website and must be + --- provided by each user. The extension must provide a + --- configuration option for the user to provide this value. + token = , + + --- The extension's name and version as defined by the extension. + extension_version = 'vim.lsp', + + --- The editor's name and version as defined by the editor. + editor_version = 'vim', + }, +} +``` + +Alternatively, you can login to sourcery by running `sourcery login` with sourcery-cli. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sourcery.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sourcery", "lsp" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `init_options` : + ```lua + { + editor_version = "vim", + extension_version = "vim.lsp" + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## spectral + +https://github.com/luizcorreia/spectral-language-server + `A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v2 & v3.` + +`spectral-language-server` can be installed via `npm`: +```sh +npm i -g spectral-language-server +``` +See [vscode-spectral](https://github.com/stoplightio/vscode-spectral#extension-settings) for configuration options. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.spectral.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "spectral-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml", "json", "yml" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + enable = true, + run = "onType", + validateLanguages = { "yaml", "json", "yml" } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## sqlls + +https://github.com/joe-re/sql-language-server + +This LSP can be installed via `npm`. Find further instructions on manual installation of the sql-language-server at [joe-re/sql-language-server](https://github.com/joe-re/sql-language-server). +
+ + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sqlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sql-language-server", "up", "--method", "stdio" } + ``` + - `filetypes` : + ```lua + { "sql", "mysql" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## sqls + +https://github.com/lighttiger2505/sqls + +```lua +require'lspconfig'.sqls.setup{ + cmd = {"path/to/command", "-config", "path/to/config.yml"}; + ... +} +``` +Sqls can be installed via `go get github.com/lighttiger2505/sqls`. Instructions for compiling Sqls from the source can be found at [lighttiger2505/sqls](https://github.com/lighttiger2505/sqls). + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sqls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sqls" } + ``` + - `filetypes` : + ```lua + { "sql", "mysql" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## starlark-rust + +https://github.com/facebookexperimental/starlark-rust/ +The LSP part of `starlark-rust` is not currently documented, + but the implementation works well for linting. +This gives valuable warnings for potential issues in the code, +but does not support refactorings. + +It can be installed with cargo: https://crates.io/crates/starlark + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.starlark-rust.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "starlark", "--lsp" } + ``` + - `filetypes` : + ```lua + { "star", "bzl", "BUILD.bazel" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## steep + +https://github.com/soutaro/steep + +`steep` is a static type checker for Ruby. + +You need `Steepfile` to make it work. Generate it with `steep init`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.steep.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "steep", "langserver" } + ``` + - `filetypes` : + ```lua + { "ruby", "eruby" } + ``` + - `root_dir` : + ```lua + root_pattern("Steepfile", ".git") + ``` + + +## stylelint_lsp + +https://github.com/bmatcuk/stylelint-lsp + +`stylelint-lsp` can be installed via `npm`: + +```sh +npm i -g stylelint-lsp +``` + +Can be configured by passing a `settings.stylelintplus` object to `stylelint_lsp.setup`: + +```lua +require'lspconfig'.stylelint_lsp.setup{ + settings = { + stylelintplus = { + -- see available options in stylelint-lsp documentation + } + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.stylelint_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "stylelint-lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "css", "less", "scss", "sugarss", "vue", "wxss", "javascript", "javascriptreact", "typescript", "typescriptreact" } + ``` + - `root_dir` : + ```lua + root_pattern('.stylelintrc', 'package.json') + ``` + - `settings` : + ```lua + {} + ``` + + +## sumneko_lua + +https://github.com/sumneko/lua-language-server + +Lua language server. + +`lua-language-server` can be installed by following the instructions [here](https://github.com/sumneko/lua-language-server/wiki/Getting-Started#command-line). + +The default `cmd` assumes that the `lua-language-server` binary can be found in `$PATH`. + +If you primarily use `lua-language-server` for Neovim, and want to provide completions, +analysis, and location handling for plugins on runtime path, you can use the following +settings. + +Note: that these settings will meaningfully increase the time until `lua-language-server` can service +initial requests (completion, location) upon starting as well as time to first diagnostics. +Completion results will include a workspace indexing progress message until the server has finished indexing. + +```lua +require'lspconfig'.sumneko_lua.setup { + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT', + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = {'vim'}, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = vim.api.nvim_get_runtime_file("", true), + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + }, + }, +} +``` + +See `lua-language-server`'s [documentation](https://github.com/sumneko/lua-language-server/blob/master/locale/en-us/setting.lua) for an explanation of the above fields: +* [Lua.runtime.path](https://github.com/sumneko/lua-language-server/blob/076dd3e5c4e03f9cef0c5757dfa09a010c0ec6bf/locale/en-us/setting.lua#L5-L13) +* [Lua.workspace.library](https://github.com/sumneko/lua-language-server/blob/076dd3e5c4e03f9cef0c5757dfa09a010c0ec6bf/locale/en-us/setting.lua#L77-L78) + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sumneko_lua.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lua-language-server" } + ``` + - `filetypes` : + ```lua + { "lua" } + ``` + - `log_level` : + ```lua + 2 + ``` + - `root_dir` : + ```lua + root_pattern(".luarc.json", ".luarc.jsonc", ".luacheckrc", ".stylua.toml", "stylua.toml", "selene.toml", "selene.yml", ".git") + ``` + - `settings` : + ```lua + { + Lua = { + telemetry = { + enable = false + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## svelte + +https://github.com/sveltejs/language-tools/tree/master/packages/language-server + +Note: assuming that [tsserver](#tsserver) is setup, full JavaScript/TypeScript support (find references, rename, etc of symbols in Svelte files when working in JS/TS files) requires per-project installation and configuration of [typescript-svelte-plugin](https://github.com/sveltejs/language-tools/tree/master/packages/typescript-plugin#usage). + +`svelte-language-server` can be installed via `npm`: +```sh +npm install -g svelte-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.svelte.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "svelteserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "svelte" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") + ``` + + +## svlangserver + +https://github.com/imc-trading/svlangserver + +Language server for SystemVerilog. + +`svlangserver` can be installed via `npm`: + +```sh +$ npm install -g @imc-trading/svlangserver +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.svlangserver.setup{} +``` +**Commands:** +- SvlangserverBuildIndex: Instructs language server to rerun indexing +- SvlangserverReportHierarchy: Generates hierarchy for the given module + +**Default values:** + - `cmd` : + ```lua + { "svlangserver" } + ``` + - `filetypes` : + ```lua + { "verilog", "systemverilog" } + ``` + - `root_dir` : + ```lua + root_pattern(".svlangserver", ".git") + ``` + - `settings` : + ```lua + { + systemverilog = { + includeIndexing = { "*.{v,vh,sv,svh}", "**/*.{v,vh,sv,svh}" } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## svls + +https://github.com/dalance/svls + +Language server for verilog and SystemVerilog + +`svls` can be installed via `cargo`: + ```sh + cargo install svls + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.svls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "svls" } + ``` + - `filetypes` : + ```lua + { "verilog", "systemverilog" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## syntax_tree + +https://ruby-syntax-tree.github.io/syntax_tree/ + +A fast Ruby parser and formatter. + +Syntax Tree is a suite of tools built on top of the internal CRuby parser. It +provides the ability to generate a syntax tree from source, as well as the +tools necessary to inspect and manipulate that syntax tree. It can be used to +build formatters, linters, language servers, and more. + +```sh +gem install syntax_tree +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.syntax_tree.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "stree", "lsp" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `root_dir` : + ```lua + root_pattern(".streerc", "Gemfile", ".git") + ``` + + +## tailwindcss + +https://github.com/tailwindlabs/tailwindcss-intellisense + +Tailwind CSS Language Server can be installed via npm: +```sh +npm install -g @tailwindcss/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tailwindcss.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tailwindcss-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "aspnetcorerazor", "astro", "astro-markdown", "blade", "django-html", "htmldjango", "edge", "eelixir", "elixir", "ejs", "erb", "eruby", "gohtml", "haml", "handlebars", "hbs", "html", "html-eex", "heex", "jade", "leaf", "liquid", "markdown", "mdx", "mustache", "njk", "nunjucks", "php", "razor", "slim", "twig", "css", "less", "postcss", "sass", "scss", "stylus", "sugarss", "javascript", "javascriptreact", "reason", "rescript", "typescript", "typescriptreact", "vue", "svelte" } + ``` + - `init_options` : + ```lua + { + userLanguages = { + eelixir = "html-eex", + eruby = "erb" + } + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern('tailwind.config.js', 'tailwind.config.ts', 'postcss.config.js', 'postcss.config.ts', 'package.json', 'node_modules', '.git') + ``` + - `settings` : + ```lua + { + tailwindCSS = { + classAttributes = { "class", "className", "classList", "ngClass" }, + lint = { + cssConflict = "warning", + invalidApply = "error", + invalidConfigPath = "error", + invalidScreen = "error", + invalidTailwindDirective = "error", + invalidVariant = "error", + recommendedVariantOrder = "warning" + }, + validate = true + } + } + ``` + + +## taplo + +https://taplo.tamasfe.dev/cli/usage/language-server.html + +Language server for Taplo, a TOML toolkit. + +`taplo-cli` can be installed via `cargo`: +```sh +cargo install --features lsp --locked taplo-cli +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.taplo.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "taplo", "lsp", "stdio" } + ``` + - `filetypes` : + ```lua + { "toml" } + ``` + - `root_dir` : + ```lua + root_pattern("*.toml", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## tblgen_lsp_server + +https://mlir.llvm.org/docs/Tools/MLIRLSP/#tablegen-lsp-language-server--tblgen-lsp-server + +The Language Server for the LLVM TableGen language + +`tblgen-lsp-server` can be installed at the llvm-project repository (https://github.com/llvm/llvm-project) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tblgen_lsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tblgen-lsp-server" } + ``` + - `filetypes` : + ```lua + { "tablegen" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## teal_ls + +https://github.com/teal-language/teal-language-server + +Install with: +``` +luarocks install --dev teal-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.teal_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "teal-language-server" } + ``` + - `filetypes` : + ```lua + { "teal" } + ``` + - `root_dir` : + ```lua + root_pattern("tlconfig.lua", ".git") + ``` + + +## terraform_lsp + +https://github.com/juliosueiras/terraform-lsp + +Terraform language server +Download a released binary from +https://github.com/juliosueiras/terraform-lsp/releases. + +From https://github.com/hashicorp/terraform-ls#terraform-ls-vs-terraform-lsp: + +Both HashiCorp and the maintainer of terraform-lsp expressed interest in +collaborating on a language server and are working towards a _long-term_ +goal of a single stable and feature-complete implementation. + +For the time being both projects continue to exist, giving users the +choice: + +- `terraform-ls` providing + - overall stability (by relying only on public APIs) + - compatibility with any provider and any Terraform >=0.12.0 currently + less features + - due to project being younger and relying on public APIs which may + not offer the same functionality yet + +- `terraform-lsp` providing + - currently more features + - compatibility with a single particular Terraform (0.12.20 at time of writing) + - configs designed for other 0.12 versions may work, but interpretation may be inaccurate + - less stability (due to reliance on Terraform's own internal packages) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.terraform_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "terraform-lsp" } + ``` + - `filetypes` : + ```lua + { "terraform", "hcl" } + ``` + - `root_dir` : + ```lua + root_pattern(".terraform", ".git") + ``` + + +## terraformls + +https://github.com/hashicorp/terraform-ls + +Terraform language server +Download a released binary from https://github.com/hashicorp/terraform-ls/releases. + +From https://github.com/hashicorp/terraform-ls#terraform-ls-vs-terraform-lsp: + +Both HashiCorp and the maintainer of terraform-lsp expressed interest in +collaborating on a language server and are working towards a _long-term_ +goal of a single stable and feature-complete implementation. + +For the time being both projects continue to exist, giving users the +choice: + +- `terraform-ls` providing + - overall stability (by relying only on public APIs) + - compatibility with any provider and any Terraform >=0.12.0 currently + less features + - due to project being younger and relying on public APIs which may + not offer the same functionality yet + +- `terraform-lsp` providing + - currently more features + - compatibility with a single particular Terraform (0.12.20 at time of writing) + - configs designed for other 0.12 versions may work, but interpretation may be inaccurate + - less stability (due to reliance on Terraform's own internal packages) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.terraformls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "terraform-ls", "serve" } + ``` + - `filetypes` : + ```lua + { "terraform" } + ``` + - `root_dir` : + ```lua + root_pattern(".terraform", ".git") + ``` + + +## texlab + +https://github.com/latex-lsp/texlab + +A completion engine built from scratch for (La)TeX. + +See https://github.com/latex-lsp/texlab/wiki/Configuration for configuration options. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.texlab.setup{} +``` +**Commands:** +- TexlabBuild: Build the current buffer +- TexlabForward: Forward search from current position + +**Default values:** + - `cmd` : + ```lua + { "texlab" } + ``` + - `filetypes` : + ```lua + { "tex", "plaintex", "bib" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + texlab = { + auxDirectory = ".", + bibtexFormatter = "texlab", + build = { + args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" }, + executable = "latexmk", + forwardSearchAfter = false, + onSave = false + }, + chktex = { + onEdit = false, + onOpenAndSave = false + }, + diagnosticsDelay = 300, + formatterLineLength = 80, + forwardSearch = { + args = {} + }, + latexFormatter = "latexindent", + latexindent = { + modifyLineBreaks = false + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## tflint + +https://github.com/terraform-linters/tflint + +A pluggable Terraform linter that can act as lsp server. +Installation instructions can be found in https://github.com/terraform-linters/tflint#installation. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tflint.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tflint", "--langserver" } + ``` + - `filetypes` : + ```lua + { "terraform" } + ``` + - `root_dir` : + ```lua + root_pattern(".terraform", ".git", ".tflint.hcl") + ``` + + +## theme_check + +https://github.com/Shopify/shopify-cli + +`theme-check-language-server` is bundled with `shopify-cli` or it can also be installed via + +https://github.com/Shopify/theme-check#installation + +**NOTE:** +If installed via Homebrew, `cmd` must be set to 'theme-check-liquid-server' + +```lua +require lspconfig.theme_check.setup { + cmd = { 'theme-check-liquid-server' } +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.theme_check.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "theme-check-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "liquid" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## tilt_ls + +https://github.com/tilt-dev/tilt + +Tilt language server. + +You might need to add filetype detection manually: + +```vim +autocmd BufRead Tiltfile setf=tiltfile +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tilt_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tilt", "lsp", "start" } + ``` + - `filetypes` : + ```lua + { "tiltfile" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## tsserver + +https://github.com/theia-ide/typescript-language-server + +`typescript-language-server` depends on `typescript`. Both packages can be installed via `npm`: +```sh +npm install -g typescript typescript-language-server +``` + +To configure typescript language server, add a +[`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or +[`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to the root of your +project. + +Here's an example that disables type checking in JavaScript files. + +```json +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "checkJs": false + }, + "exclude": [ + "node_modules" + ] +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tsserver.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "typescript-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" } + ``` + - `init_options` : + ```lua + { + hostInfo = "neovim" + } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git") + ``` + + +## turtle_ls + +https://github.com/stardog-union/stardog-language-servers/tree/master/packages/turtle-language-server +`turtle-language-server`, An editor-agnostic server providing language intelligence (diagnostics, hover tooltips, etc.) for the W3C standard Turtle RDF syntax via the Language Server Protocol. +installable via npm install -g turtle-language-server or yarn global add turtle-language-server. +requires node. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.turtle_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "node", + [3] = "--stdio" + } + ``` + - `filetypes` : + ```lua + { "turtle", "ttl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## typeprof + +https://github.com/ruby/typeprof + +`typeprof` is the built-in analysis and LSP tool for Ruby 3.1+. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.typeprof.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "typeprof", "--lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "ruby", "eruby" } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + + +## unison + +https://github.com/unisonweb/unison/blob/trunk/docs/language-server.markdown + + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.unison.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nc", "localhost", "5757" } + ``` + - `filetypes` : + ```lua + { "unison" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## vala_ls + +https://github.com/Prince781/vala-language-server + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vala_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vala-language-server" } + ``` + - `filetypes` : + ```lua + { "vala", "genie" } + ``` + - `root_dir` : + ```lua + root_pattern("meson.build", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## vdmj + +https://github.com/nickbattle/vdmj + +The VDMJ language server can be installed by cloning the VDMJ repository and +running `mvn clean install`. + +Various options are provided to configure the language server (see below). In +particular: +- `annotation_paths` is a list of folders and/or jar file paths for annotations +that should be used with the language server; +- any value of `debugger_port` less than zero will disable the debugger; note +that if a non-zero value is used, only one instance of the server can be active +at a time. + +More settings for VDMJ can be changed in a file called `vdmj.properties` under +`root_dir/.vscode`. For a description of the available settings, see +[Section 7 of the VDMJ User Guide](https://raw.githubusercontent.com/nickbattle/vdmj/master/vdmj/documentation/UserGuide.pdf). + +Note: proof obligations and combinatorial testing are not currently supported +by neovim. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vdmj.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + Generated from the options given + ``` + - `filetypes` : + ```lua + { "vdmsl", "vdmpp", "vdmrt" } + ``` + - `options` : + ```lua + { + annotation_paths = {}, + debugger_port = -1, + high_precision = false, + java = "$JAVA_HOME/bin/java", + java_opts = { "-Xmx3000m", "-Xss1m" }, + logfile = "path.join(vim.fn.stdpath 'cache', 'vdm-lsp.log')", + mavenrepo = "$HOME/.m2/repository/dk/au/ece/vdmj", + version = "The latest version installed in `mavenrepo`" + } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor(fname) or find_vscode_ancestor(fname) + ``` + + +## verible + +https://github.com/chipsalliance/verible + +A linter and formatter for verilog and SystemVerilog files. + +Release binaries can be downloaded from [here](https://github.com/chipsalliance/verible/releases) +and placed in a directory on PATH. + +See https://github.com/chipsalliance/verible/tree/master/verilog/tools/ls/README.md for options. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.verible.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "verible-verilog-ls" } + ``` + - `filetypes` : + ```lua + { "systemverilog", "verilog" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## veridian + +https://github.com/vivekmalneedi/veridian + +A SystemVerilog LanguageServer. + +Download the latest release for your OS from the releases page + +# install with slang feature, if C++17 compiler is available +cargo install --git https://github.com/vivekmalneedi/veridian.git --all-features +# install if C++17 compiler is not available +cargo install --git https://github.com/vivekmalneedi/veridian.git + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.veridian.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "veridian" } + ``` + - `filetypes` : + ```lua + { "systemverilog", "verilog" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## vimls + +https://github.com/iamcco/vim-language-server + +You can install vim-language-server via npm: +```sh +npm install -g vim-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vimls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vim-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "vim" } + ``` + - `init_options` : + ```lua + { + diagnostic = { + enable = true + }, + indexes = { + count = 3, + gap = 100, + projectRootPatterns = { "runtime", "nvim", ".git", "autoload", "plugin" }, + runtimepath = true + }, + isNeovim = true, + iskeyword = "@,48-57,_,192-255,-#", + runtimepath = "", + suggest = { + fromRuntimepath = true, + fromVimruntime = true + }, + vimruntime = "" + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## visualforce_ls + +https://github.com/forcedotcom/salesforcedx-vscode + +Language server for Visualforce. + +For manual installation, download the .vsix archive file from the +[forcedotcom/salesforcedx-vscode](https://github.com/forcedotcom/salesforcedx-vscode) +GitHub releases. Then, configure `cmd` to run the Node script at the unpacked location: + +```lua +require'lspconfig'.visualforce_ls.setup { + cmd = { + 'node', + '/path/to/unpacked/archive/extension/node_modules/@salesforce/salesforcedx-visualforce-language-server/out/src/visualforceServer.js', + '--stdio' + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.visualforce_ls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "visualforce" } + ``` + - `init_options` : + ```lua + { + embeddedLanguages = { + css = true, + javascript = true + } + } + ``` + - `root_dir` : + ```lua + root_pattern('sfdx-project.json') + ``` + + +## vls + +https://github.com/vlang/vls + +V language server. + +`v-language-server` can be installed by following the instructions [here](https://github.com/vlang/vls#installation). +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "v", "ls" } + ``` + - `filetypes` : + ```lua + { "vlang" } + ``` + - `root_dir` : + ```lua + root_pattern("v.mod", ".git") + ``` + + +## volar + +https://github.com/johnsoncodehk/volar/tree/20d713b/packages/vue-language-server + +Volar language server for Vue + +Volar can be installed via npm: + +```sh +npm install -g @volar/vue-language-server +``` + +Volar by default supports Vue 3 projects. Vue 2 projects need +[additional configuration](https://github.com/johnsoncodehk/volar/blob/master/extensions/vscode-vue-language-features/README.md?plain=1#L28-L63). + +**Take Over Mode** + +Volar can serve as a language server for both Vue and TypeScript via [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471). + +To enable Take Over Mode, override the default filetypes in `setup{}` as follows: + +```lua +require'lspconfig'.volar.setup{ + filetypes = {'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue', 'json'} +} +``` + +**Overriding the default TypeScript Server used by Volar** + +The default config looks for TS in the local `node_modules`. This can lead to issues +e.g. when working on a [monorepo](https://monorepo.tools/). The alternatives are: + +- use a global TypeScript Server installation + +```lua +require'lspconfig'.volar.setup{ + init_options = { + typescript = { + tsdk = '/path/to/.npm/lib/node_modules/typescript/lib' + -- Alternative location if installed as root: + -- tsdk = '/usr/local/lib/node_modules/typescript/lib' + } + } +} +``` + +- use a local server and fall back to a global TypeScript Server installation + +```lua +local util = require 'lspconfig.util' +local function get_typescript_server_path(root_dir) + + local global_ts = '/home/[yourusernamehere]/.npm/lib/node_modules/typescript/lib' + -- Alternative location if installed as root: + -- local global_ts = '/usr/local/lib/node_modules/typescript/lib' + local found_ts = '' + local function check_dir(path) + found_ts = util.path.join(path, 'node_modules', 'typescript', 'lib') + if util.path.exists(found_ts) then + return path + end + end + if util.search_ancestors(root_dir, check_dir) then + return found_ts + else + return global_ts + end +end + +require'lspconfig'.volar.setup{ + on_new_config = function(new_config, new_root_dir) + new_config.init_options.typescript.tsdk = get_typescript_server_path(new_root_dir) + end, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.volar.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vue-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "vue" } + ``` + - `init_options` : + ```lua + { + documentFeatures = { + documentColor = false, + documentFormatting = { + defaultPrintWidth = 100 + }, + documentSymbol = true, + foldingRange = true, + linkedEditingRange = true, + selectionRange = true + }, + languageFeatures = { + callHierarchy = true, + codeAction = true, + codeLens = true, + completion = { + defaultAttrNameCase = "kebabCase", + defaultTagNameCase = "both" + }, + definition = true, + diagnostics = true, + documentHighlight = true, + documentLink = true, + hover = true, + implementation = true, + references = true, + rename = true, + renameFileRefactoring = true, + schemaRequestService = true, + semanticTokens = false, + signatureHelp = true, + typeDefinition = true + }, + typescript = { + tsdk = "" + } + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## vuels + +https://github.com/vuejs/vetur/tree/master/server + +Vue language server(vls) +`vue-language-server` can be installed via `npm`: +```sh +npm install -g vls +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vuels.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vls" } + ``` + - `filetypes` : + ```lua + { "vue" } + ``` + - `init_options` : + ```lua + { + config = { + css = {}, + emmet = {}, + html = { + suggest = {} + }, + javascript = { + format = {} + }, + stylusSupremacy = {}, + typescript = { + format = {} + }, + vetur = { + completion = { + autoImport = false, + tagCasing = "kebab", + useScaffoldSnippets = false + }, + format = { + defaultFormatter = { + js = "none", + ts = "none" + }, + defaultFormatterOptions = {}, + scriptInitialIndent = false, + styleInitialIndent = false + }, + useWorkspaceDependencies = false, + validation = { + script = true, + style = true, + template = true + } + } + } + } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", "vue.config.js") + ``` + + +## wgsl_analyzer + +https://github.com/wgsl-analyzer/wgsl-analyzer + +`wgsl_analyzer` can be installed via `cargo`: +```sh +cargo install --git https://github.com/wgsl-analyzer/wgsl-analyzer wgsl_analyzer +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.wgsl_analyzer.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "wgsl_analyzer" } + ``` + - `filetypes` : + ```lua + { "wgsl" } + ``` + - `root_dir` : + ```lua + root_pattern(".git" + ``` + - `settings` : + ```lua + {} + ``` + + +## yamlls + +https://github.com/redhat-developer/yaml-language-server + +`yaml-language-server` can be installed via `yarn`: +```sh +yarn global add yaml-language-server +``` + +To use a schema for validation, there are two options: + +1. Add a modeline to the file. A modeline is a comment of the form: + +``` +# yaml-language-server: $schema= +``` + +where the relative filepath is the path relative to the open yaml file, and the absolute filepath +is the filepath relative to the filesystem root ('/' on unix systems) + +2. Associated a schema url, relative , or absolute (to root of project, not to filesystem root) path to +the a glob pattern relative to the detected project root. Check `:LspInfo` to determine the resolved project +root. + +```lua +require('lspconfig').yamlls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + ... -- other settings. note this overrides the lspconfig defaults. + schemas = { + ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*" + ["../path/relative/to/file.yml"] = "/.github/workflows/*" + ["/path/from/root/of/project"] = "/.github/workflows/*" + }, + }, + } +} +``` + +Currently, kubernetes is special-cased in yammls, see the following upstream issues: +* [#211](https://github.com/redhat-developer/yaml-language-server/issues/211). +* [#307](https://github.com/redhat-developer/yaml-language-server/issues/307). + +To override a schema to use a specific k8s schema version (for example, to use 1.18): + +```lua +require('lspconfig').yamlls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + ... -- other settings. note this overrides the lspconfig defaults. + schemas = { + ["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.18.0-standalone-strict/all.json"] = "/*.k8s.yaml", + ... -- other schemas + }, + }, + } +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.yamlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "yaml-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml", "yaml.docker-compose" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `settings` : + ```lua + { + redhat = { + telemetry = { + enabled = false + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## zk + +https://github.com/mickael-menu/zk + +A plain text note-taking assistant + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.zk.setup{} +``` +**Commands:** +- ZkIndex: Index +- ZkNew: ZkNew + +**Default values:** + - `cmd` : + ```lua + { "zk", "lsp" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + root_pattern(".zk") + ``` + + +## zls + +https://github.com/zigtools/zls + +Zig LSP implementation + Zig Language Server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.zls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "zls" } + ``` + - `filetypes` : + ```lua + { "zig", "zir" } + ``` + - `root_dir` : + ```lua + util.root_pattern("zls.json", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + + +vim:ft=markdown diff --git a/bundle/nvim-lspconfig-0.1.4/flake.lock b/bundle/nvim-lspconfig-0.1.4/flake.lock new file mode 100644 index 000000000..647f04e81 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/flake.lock @@ -0,0 +1,41 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1656928814, + "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1659522808, + "narHash": "sha256-HBcM19nGhI3IWwPNVlYb0MZ8VW6iKp4JbAVkeIHVykc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "168d1c578909dc143ba52dbed661c36e76b12b36", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/bundle/nvim-lspconfig-0.1.4/flake.nix b/bundle/nvim-lspconfig-0.1.4/flake.nix new file mode 100644 index 000000000..2f0785446 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/flake.nix @@ -0,0 +1,19 @@ +{ + description = "Quickstart configurations for the Nvim LSP client"; + + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let pkgs = nixpkgs.legacyPackages.${system}; in + rec { + devShell = pkgs.mkShell { + buildInputs = [ + pkgs.stylua + pkgs.luaPackages.luacheck + pkgs.selene + ]; + }; + } + ); +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig.lua new file mode 100644 index 000000000..cf6ac6339 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig.lua @@ -0,0 +1,34 @@ +local configs = require 'lspconfig.configs' + +local M = { + util = require 'lspconfig.util', +} + +function M.available_servers() + vim.deprecate('lspconfig.available_servers', 'lspconfig.util.available_servers', '0.1.4', 'lspconfig') + return M.util.available_servers() +end + +local mt = {} +function mt:__index(k) + if configs[k] == nil then + local success, config = pcall(require, 'lspconfig.server_configurations.' .. k) + if success then + configs[k] = config + else + vim.notify( + string.format( + '[lspconfig] Cannot access configuration for %s. Ensure this server is listed in ' + .. '`server_configurations.md` or added as a custom server.', + k + ), + vim.log.levels.WARN + ) + -- Return a dummy function for compatibility with user configs + return { setup = function() end } + end + end + return configs[k] +end + +return setmetatable(M, mt) diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/configs.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/configs.lua new file mode 100644 index 000000000..71d553c92 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/configs.lua @@ -0,0 +1,319 @@ +local util = require 'lspconfig.util' +local api, validate, lsp, uv, fn = vim.api, vim.validate, vim.lsp, vim.loop, vim.fn +local tbl_deep_extend = vim.tbl_deep_extend + +local configs = {} + +function configs.__newindex(t, config_name, config_def) + validate { + name = { config_name, 's' }, + default_config = { config_def.default_config, 't' }, + on_new_config = { config_def.on_new_config, 'f', true }, + on_attach = { config_def.on_attach, 'f', true }, + commands = { config_def.commands, 't', true }, + } + if config_def.commands then + for k, v in pairs(config_def.commands) do + validate { + ['command.name'] = { k, 's' }, + ['command.fn'] = { v[1], 'f' }, + } + end + else + config_def.commands = {} + end + + local M = {} + + local default_config = tbl_deep_extend('keep', config_def.default_config, util.default_config) + + -- Force this part. + default_config.name = config_name + + function M.setup(user_config) + local lsp_group = api.nvim_create_augroup('lspconfig', { clear = false }) + + validate { + cmd = { + user_config.cmd, + { 'f', 't' }, + true, + }, + root_dir = { user_config.root_dir, 'f', true }, + filetypes = { user_config.filetype, 't', true }, + on_new_config = { user_config.on_new_config, 'f', true }, + on_attach = { user_config.on_attach, 'f', true }, + commands = { user_config.commands, 't', true }, + } + if user_config.commands then + for k, v in pairs(user_config.commands) do + validate { + ['command.name'] = { k, 's' }, + ['command.fn'] = { v[1], 'f' }, + } + end + end + + local config = tbl_deep_extend('keep', user_config, default_config) + + if util.on_setup then + pcall(util.on_setup, config, user_config) + end + + if config.autostart == true then + local event + local pattern + if config.filetypes then + event = 'FileType' + pattern = table.concat(config.filetypes, ',') + else + event = 'BufReadPost' + pattern = '*' + end + api.nvim_create_autocmd(event, { + pattern = pattern, + callback = function() + M.manager.try_add() + end, + group = lsp_group, + desc = string.format( + 'Checks whether server %s should start a new instance or attach to an existing one.', + config.name + ), + }) + end + + local get_root_dir = config.root_dir + + function M.launch() + local root_dir + if get_root_dir then + local bufnr = api.nvim_get_current_buf() + local bufname = api.nvim_buf_get_name(bufnr) + if #bufname == 0 and not config.single_file_support then + return + elseif #bufname ~= 0 then + if not util.bufname_valid(bufname) then + return + end + root_dir = get_root_dir(util.path.sanitize(bufname), bufnr) + end + end + + if root_dir then + api.nvim_create_autocmd('BufReadPost', { + pattern = fn.fnameescape(root_dir) .. '/*', + callback = function() + M.manager.try_add_wrapper() + end, + group = lsp_group, + desc = string.format( + 'Checks whether server %s should attach to a newly opened buffer inside workspace %q.', + config.name, + root_dir + ), + }) + for _, bufnr in ipairs(api.nvim_list_bufs()) do + local bufname = api.nvim_buf_get_name(bufnr) + if util.bufname_valid(bufname) then + local buf_dir = util.path.sanitize(bufname) + if buf_dir:sub(1, root_dir:len()) == root_dir then + M.manager.try_add_wrapper(bufnr) + end + end + end + elseif config.single_file_support then + -- This allows on_new_config to use the parent directory of the file + -- Effectively this is the root from lspconfig's perspective, as we use + -- this to attach additional files in the same parent folder to the same server. + -- We just no longer send rootDirectory or workspaceFolders during initialization. + local bufname = api.nvim_buf_get_name(0) + if #bufname ~= 0 and not util.bufname_valid(bufname) then + return + end + local pseudo_root = #bufname == 0 and uv.cwd() or util.path.dirname(util.path.sanitize(bufname)) + local client_id = M.manager.add(pseudo_root, true) + lsp.buf_attach_client(api.nvim_get_current_buf(), client_id) + end + end + + -- Used by :LspInfo + M.get_root_dir = get_root_dir + M.filetypes = config.filetypes + M.handlers = config.handlers + M.cmd = config.cmd + M.autostart = config.autostart + + -- In the case of a reload, close existing things. + local reload = false + if M.manager then + for _, client in ipairs(M.manager.clients()) do + client.stop(true) + end + reload = true + M.manager = nil + end + + local make_config = function(root_dir) + local new_config = tbl_deep_extend('keep', vim.empty_dict(), config) + new_config.capabilities = tbl_deep_extend('keep', new_config.capabilities, { + workspace = { + configuration = true, + }, + }) + + if config_def.on_new_config then + pcall(config_def.on_new_config, new_config, root_dir) + end + if config.on_new_config then + pcall(config.on_new_config, new_config, root_dir) + end + + new_config.on_init = util.add_hook_after(new_config.on_init, function(client, result) + -- Handle offset encoding by default + if result.offsetEncoding then + client.offset_encoding = result.offsetEncoding + end + + -- Send `settings` to server via workspace/didChangeConfiguration + function client.workspace_did_change_configuration(settings) + if not settings then + return + end + if vim.tbl_isempty(settings) then + settings = { [vim.type_idx] = vim.types.dictionary } + end + return client.notify('workspace/didChangeConfiguration', { + settings = settings, + }) + end + if not vim.tbl_isempty(new_config.settings) then + client.workspace_did_change_configuration(new_config.settings) + end + end) + + -- Save the old _on_attach so that we can reference it via the BufEnter. + new_config._on_attach = new_config.on_attach + new_config.on_attach = vim.schedule_wrap(function(client, bufnr) + if bufnr == api.nvim_get_current_buf() then + M._setup_buffer(client.id, bufnr) + else + if api.nvim_buf_is_valid(bufnr) then + api.nvim_create_autocmd('BufEnter', { + callback = function() + M._setup_buffer(client.id, bufnr) + end, + group = lsp_group, + buffer = bufnr, + once = true, + desc = 'Reattaches the server with the updated configurations if changed.', + }) + end + end + end) + + new_config.root_dir = root_dir + new_config.workspace_folders = { + { + uri = vim.uri_from_fname(root_dir), + name = string.format('%s', root_dir), + }, + } + return new_config + end + + local manager = util.server_per_root_dir_manager(function(root_dir) + return make_config(root_dir) + end) + + -- Try to attach the buffer `bufnr` to a client using this config, creating + -- a new client if one doesn't already exist for `bufnr`. + function manager.try_add(bufnr) + bufnr = bufnr or api.nvim_get_current_buf() + + if api.nvim_buf_get_option(bufnr, 'buftype') == 'nofile' then + return + end + + local id + local root_dir + + local bufname = api.nvim_buf_get_name(bufnr) + if #bufname == 0 and not config.single_file_support then + return + elseif #bufname ~= 0 then + if not util.bufname_valid(bufname) then + return + end + end + local buf_path = util.path.sanitize(bufname) + + if get_root_dir then + root_dir = get_root_dir(buf_path, bufnr) + end + + if root_dir then + id = manager.add(root_dir, false) + elseif config.single_file_support then + local pseudo_root = #bufname == 0 and uv.cwd() or util.path.dirname(buf_path) + id = manager.add(pseudo_root, true) + end + + if id then + lsp.buf_attach_client(bufnr, id) + end + end + + -- Check that the buffer `bufnr` has a valid filetype according to + -- `config.filetypes`, then do `manager.try_add(bufnr)`. + function manager.try_add_wrapper(bufnr) + bufnr = bufnr or api.nvim_get_current_buf() + local buf_filetype = api.nvim_buf_get_option(bufnr, 'filetype') + if config.filetypes then + for _, filetype in ipairs(config.filetypes) do + if buf_filetype == filetype then + manager.try_add(bufnr) + return + end + end + -- `config.filetypes = nil` means all filetypes are valid. + else + manager.try_add(bufnr) + end + end + + M.manager = manager + M.make_config = make_config + if reload and config.autostart ~= false then + for _, bufnr in ipairs(api.nvim_list_bufs()) do + manager.try_add_wrapper(bufnr) + end + end + end + + function M._setup_buffer(client_id, bufnr) + local client = lsp.get_client_by_id(client_id) + if not client then + return + end + if client.config._on_attach then + client.config._on_attach(client, bufnr) + end + if client.config.commands and not vim.tbl_isempty(client.config.commands) then + M.commands = vim.tbl_deep_extend('force', M.commands, client.config.commands) + end + if not M.commands_created and not vim.tbl_isempty(M.commands) then + util.create_module_commands(config_name, M.commands) + end + end + + M.commands = config_def.commands + M.name = config_name + M.document_config = config_def + + rawset(t, config_name, M) + + return M +end + +return setmetatable({}, configs) diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/als.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/als.lua new file mode 100644 index 000000000..7d916adf6 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/als.lua @@ -0,0 +1,37 @@ +local util = require 'lspconfig.util' +local bin_name = 'ada_language_server' + +if vim.fn.has 'win32' == 1 then + bin_name = 'ada_language_server.exe' +end + +return { + default_config = { + cmd = { bin_name }, + filetypes = { 'ada' }, + root_dir = util.root_pattern('Makefile', '.git', '*.gpr', '*.adc'), + }, + docs = { + description = [[ +https://github.com/AdaCore/ada_language_server + +Installation instructions can be found [here](https://github.com/AdaCore/ada_language_server#Install). + +Can be configured by passing a "settings" object to `als.setup{}`: + +```lua +require('lspconfig').als.setup{ + settings = { + ada = { + projectFile = "project.gpr"; + scenarioVariables = { ... }; + } + } +} +``` +]], + default_config = { + root_dir = [[util.root_pattern("Makefile", ".git", "*.gpr", "*.adc")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/anakin_language_server.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/anakin_language_server.lua new file mode 100644 index 000000000..f0c281cc5 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/anakin_language_server.lua @@ -0,0 +1,78 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'anakinls' }, + filetypes = { 'python' }, + root_dir = function(fname) + local root_files = { + 'pyproject.toml', + 'setup.py', + 'setup.cfg', + 'requirements.txt', + 'Pipfile', + } + return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + settings = { + anakinls = { + pyflakes_errors = { + -- Full list: https://github.com/PyCQA/pyflakes/blob/master/pyflakes/messages.py + + 'ImportStarNotPermitted', + + 'UndefinedExport', + 'UndefinedLocal', + 'UndefinedName', + + 'DuplicateArgument', + 'MultiValueRepeatedKeyLiteral', + 'MultiValueRepeatedKeyVariable', + + 'FutureFeatureNotDefined', + 'LateFutureImport', + + 'ReturnOutsideFunction', + 'YieldOutsideFunction', + 'ContinueOutsideLoop', + 'BreakOutsideLoop', + + 'TwoStarredExpressions', + 'TooManyExpressionsInStarredAssignment', + + 'ForwardAnnotationSyntaxError', + 'RaiseNotImplemented', + + 'StringDotFormatExtraPositionalArguments', + 'StringDotFormatExtraNamedArguments', + 'StringDotFormatMissingArgument', + 'StringDotFormatMixingAutomatic', + 'StringDotFormatInvalidFormat', + + 'PercentFormatInvalidFormat', + 'PercentFormatMixedPositionalAndNamed', + 'PercentFormatUnsupportedFormat', + 'PercentFormatPositionalCountMismatch', + 'PercentFormatExtraNamedArguments', + 'PercentFormatMissingArgument', + 'PercentFormatExpectedMapping', + 'PercentFormatExpectedSequence', + 'PercentFormatStarRequiresSequence', + }, + }, + }, + }, + docs = { + description = [[ +https://pypi.org/project/anakin-language-server/ + +`anakin-language-server` is yet another Jedi Python language server. + +Available options: + +* Initialization: https://github.com/muffinmad/anakin-language-server#initialization-option +* Configuration: https://github.com/muffinmad/anakin-language-server#configuration-options + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/angularls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/angularls.lua new file mode 100644 index 000000000..325073504 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/angularls.lua @@ -0,0 +1,75 @@ +local util = require 'lspconfig.util' + +-- Angular requires a node_modules directory to probe for @angular/language-service and typescript +-- in order to use your projects configured versions. +-- This defaults to the vim cwd, but will get overwritten by the resolved root of the file. +local function get_probe_dir(root_dir) + local project_root = util.find_node_modules_ancestor(root_dir) + + return project_root and (project_root .. '/node_modules') or '' +end + +local default_probe_dir = get_probe_dir(vim.fn.getcwd()) + +local bin_name = 'ngserver' +local args = { + '--stdio', + '--tsProbeLocations', + default_probe_dir, + '--ngProbeLocations', + default_probe_dir, +} + +local cmd = { bin_name, unpack(args) } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, unpack(args) } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'typescript', 'html', 'typescriptreact', 'typescript.tsx' }, + -- Check for angular.json since that is the root of the project. + -- Don't check for tsconfig.json or package.json since there are multiple of these + -- in an angular monorepo setup. + root_dir = util.root_pattern 'angular.json', + }, + on_new_config = function(new_config, new_root_dir) + local new_probe_dir = get_probe_dir(new_root_dir) + + -- We need to check our probe directories because they may have changed. + new_config.cmd = { + 'ngserver', + '--stdio', + '--tsProbeLocations', + new_probe_dir, + '--ngProbeLocations', + new_probe_dir, + } + end, + docs = { + description = [[ +https://github.com/angular/vscode-ng-language-service + +`angular-language-server` can be installed via npm `npm install -g @angular/language-server`. + +Note, that if you override the default `cmd`, you must also update `on_new_config` to set `new_config.cmd` during startup. + +```lua +local project_library_path = "/path/to/project/lib" +local cmd = {"ngserver", "--stdio", "--tsProbeLocations", project_library_path , "--ngProbeLocations", project_library_path} + +require'lspconfig'.angularls.setup{ + cmd = cmd, + on_new_config = function(new_config,new_root_dir) + new_config.cmd = cmd + end, +} +``` + ]], + default_config = { + root_dir = [[root_pattern("angular.json")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ansiblels.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ansiblels.lua new file mode 100644 index 000000000..f6ad2912d --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ansiblels.lua @@ -0,0 +1,50 @@ +local util = require 'lspconfig.util' + +local bin_name = 'ansible-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + settings = { + ansible = { + python = { + interpreterPath = 'python', + }, + ansible = { + path = 'ansible', + }, + executionEnvironment = { + enabled = false, + }, + validation = { + enabled = true, + lint = { + enabled = true, + path = 'ansible-lint', + }, + }, + }, + }, + filetypes = { 'yaml.ansible' }, + root_dir = util.root_pattern('ansible.cfg', '.ansible-lint'), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/ansible/ansible-language-server + +Language server for the ansible configuration management tool. + +`ansible-language-server` can be installed via `npm`: + +```sh +npm install -g @ansible/ansible-language-server +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/antlersls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/antlersls.lua new file mode 100644 index 000000000..28fa0d0cc --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/antlersls.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +local bin_name = 'antlersls' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'html', 'antlers' }, + root_dir = util.root_pattern 'composer.json', + }, + docs = { + description = [[ +https://www.npmjs.com/package/antlers-language-server + +`antlersls` can be installed via `npm`: +```sh +npm install -g antlers-language-server +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/apex_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/apex_ls.lua new file mode 100644 index 000000000..76fff90f1 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/apex_ls.lua @@ -0,0 +1,46 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'apexcode' }, + root_dir = util.root_pattern 'sfdx-project.json', + on_new_config = function(config) + if not config.cmd and config.apex_jar_path then + config.cmd = { + 'java', + '-cp', + config.apex_jar_path, + '-Ddebug.internal.errors=true', + '-Ddebug.semantic.errors=' .. tostring(config.apex_enable_semantic_errors or false), + '-Ddebug.completion.statistics=' .. tostring(config.apex_enable_completion_statistics or false), + '-Dlwc.typegeneration.disabled=true', + } + if config.apex_jvm_max_heap then + table.insert(config.cmd, '-Xmx' .. config.apex_jvm_max_heap) + end + table.insert(config.cmd, 'apex.jorje.lsp.ApexLanguageServerLauncher') + end + end, + }, + docs = { + description = [[ +https://github.com/forcedotcom/salesforcedx-vscode + +Language server for Apex. + +For manual installation, download the JAR file from the [VSCode +extension](https://github.com/forcedotcom/salesforcedx-vscode/tree/develop/packages/salesforcedx-vscode-apex). + +```lua +require'lspconfig'.apex_ls.setup { + apex_jar_path = '/path/to/apex-jorje-lsp.jar', + apex_enable_semantic_errors = false, -- Whether to allow Apex Language Server to surface semantic errors + apex_enable_completion_statistics = false, -- Whether to allow Apex Language Server to collect telemetry on code completion usage +} +``` +]], + default_config = { + root_dir = [[root_pattern('sfdx-project.json')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/arduino_language_server.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/arduino_language_server.lua new file mode 100644 index 000000000..b7f529fff --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/arduino_language_server.lua @@ -0,0 +1,63 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'arduino' }, + root_dir = util.root_pattern '*.ino', + }, + docs = { + description = [[ +https://github.com/arduino/arduino-language-server + +Language server for Arduino + +The `arduino-language-server` can be installed by running: + +``` +go install github.com/arduino/arduino-language-server@latest +``` + +The `arduino-cli` tool must also be installed. Follow [these +installation instructions](https://arduino.github.io/arduino-cli/latest/installation/) for +your platform. + +After installing `arduino-cli`, follow [these +instructions](https://arduino.github.io/arduino-cli/latest/getting-started/#create-a-configuration-file) +for generating a configuration file if you haven't done so already, and make +sure you [install any relevant platforms +libraries](https://arduino.github.io/arduino-cli/latest/getting-started/#install-the-core-for-your-board). +Make sure to save the full path to the created `arduino-cli.yaml` file for later. + +The language server also requires `clangd` to be installed. Follow [these +installation instructions](https://clangd.llvm.org/installation) for your +platform. + +Next, you will need to decide which FQBN to use. +To identify the available FQBNs for boards you currently have connected, you may use the `arduino-cli` command, like so: + +```sh +$ arduino-cli board list +Port Protocol Type Board Name FQBN Core +/dev/ttyACM0 serial Serial Port (USB) Arduino Uno arduino:avr:uno arduino:avr + ^^^^^^^^^^^^^^^ +``` + +After all dependencies are installed you'll need to set the command for the +language server in your setup: + +```lua +require'lspconfig'.arduino_language_server.setup { + cmd = { + "arduino-language-server", + "-cli-config", "/path/to/arduino-cli.yaml", + "-fqbn", "arduino:avr:uno", + "-cli", "arduino-cli", + "-clangd", "clangd" + } +} +``` + +For further instruction about configuration options, run `arduino-language-server --help`. +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/asm_lsp.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/asm_lsp.lua new file mode 100644 index 000000000..102bcbab1 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/asm_lsp.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'asm-lsp' }, + filetypes = { 'asm', 'vmasm' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/bergercookie/asm-lsp + +Language Server for GAS/GO Assembly + +`asm-lsp` can be installed via cargo: +cargo install asm-lsp +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/astro.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/astro.lua new file mode 100644 index 000000000..b643e16dc --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/astro.lua @@ -0,0 +1,50 @@ +local util = require 'lspconfig.util' + +local bin_name = 'astro-ls' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +local function get_typescript_server_path(root_dir) + local project_root = util.find_node_modules_ancestor(root_dir) + return project_root and (util.path.join(project_root, 'node_modules', 'typescript', 'lib', 'tsserverlibrary.js')) + or '' +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'astro' }, + root_dir = util.root_pattern('package.json', 'tsconfig.json', 'jsconfig.json', '.git'), + init_options = { + typescript = { + serverPath = '', + }, + configuration = {}, + }, + on_new_config = function(new_config, new_root_dir) + if + new_config.init_options + and new_config.init_options.typescript + and new_config.init_options.typescript.serverPath == '' + then + new_config.init_options.typescript.serverPath = get_typescript_server_path(new_root_dir) + end + end, + }, + docs = { + description = [[ +https://github.com/withastro/language-tools/tree/main/packages/language-server + +`astro-ls` can be installed via `npm`: +```sh +npm install -g @astrojs/language-server +``` +]], + default_config = { + root_dir = [[root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/awk_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/awk_ls.lua new file mode 100644 index 000000000..ff1087dcd --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/awk_ls.lua @@ -0,0 +1,22 @@ +if vim.version().major == 0 and vim.version().minor < 7 then + vim.notify('The AWK language server requires nvim >= 0.7', vim.log.levels.ERROR) + return +end + +return { + default_config = { + cmd = { 'awk-language-server' }, + filetypes = { 'awk' }, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/Beaglefoot/awk-language-server/ + +`awk-language-server` can be installed via `npm`: +```sh +npm install -g awk-language-server +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/bashls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/bashls.lua new file mode 100644 index 000000000..3f25c76f4 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/bashls.lua @@ -0,0 +1,39 @@ +local util = require 'lspconfig.util' + +local bin_name = 'bash-language-server' +local cmd = { bin_name, 'start' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, 'start' } +end + +return { + default_config = { + cmd = cmd, + cmd_env = { + -- Prevent recursive scanning which will cause issues when opening a file + -- directly in the home directory (e.g. ~/foo.sh). + -- + -- Default upstream pattern is "**/*@(.sh|.inc|.bash|.command)". + GLOB_PATTERN = vim.env.GLOB_PATTERN or '*@(.sh|.inc|.bash|.command)', + }, + filetypes = { 'sh' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/mads-hartmann/bash-language-server + +`bash-language-server` can be installed via `npm`: +```sh +npm i -g bash-language-server +``` + +Language server for bash, written using tree sitter in typescript. +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/beancount.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/beancount.lua new file mode 100644 index 000000000..5258456c0 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/beancount.lua @@ -0,0 +1,24 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'beancount-language-server', '--stdio' }, + filetypes = { 'beancount', 'bean' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + init_options = { + -- this is the path to the beancout journal file + journalFile = '', + }, + }, + docs = { + description = [[ +https://github.com/polarmutex/beancount-language-server#installation + +See https://github.com/polarmutex/beancount-language-server#configuration for configuration options +]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/bicep.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/bicep.lua new file mode 100644 index 000000000..1ec703238 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/bicep.lua @@ -0,0 +1,47 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'bicep' }, + root_dir = util.find_git_ancestor, + init_options = {}, + }, + docs = { + description = [=[ +https://github.com/azure/bicep +Bicep language server + +Bicep language server can be installed by downloading and extracting a release of bicep-langserver.zip from [Bicep GitHub releases](https://github.com/Azure/bicep/releases). + +Bicep language server requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +Neovim does not have built-in support for the bicep filetype which is required for lspconfig to automatically launch the language server. + +Filetype detection can be added via an autocmd: +```lua +vim.cmd [[ autocmd BufNewFile,BufRead *.bicep set filetype=bicep ]] +``` + +**By default, bicep language server does not have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. + +```lua +local bicep_lsp_bin = "/path/to/bicep-langserver/Bicep.LangServer.dll" +require'lspconfig'.bicep.setup{ + cmd = { "dotnet", bicep_lsp_bin }; + ... +} +``` + +To download the latest release and place in /usr/local/bin/bicep-langserver: +```bash +(cd $(mktemp -d) \ + && curl -fLO https://github.com/Azure/bicep/releases/latest/download/bicep-langserver.zip \ + && rm -rf /usr/local/bin/bicep-langserver \ + && unzip -d /usr/local/bin/bicep-langserver bicep-langserver.zip) +``` +]=], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/blueprint_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/blueprint_ls.lua new file mode 100644 index 000000000..d8d36ebb8 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/blueprint_ls.lua @@ -0,0 +1,37 @@ +local util = require 'lspconfig.util' + +local bin_name = 'blueprint-compiler' +local cmd = { bin_name, 'lsp' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, 'start' } +end + +return { + default_config = { + cmd = cmd, + cmd_env = { + -- Prevent recursive scanning which will cause issues when opening a file + -- directly in the home directory (e.g. ~/foo.sh). + -- + -- Default upstream pattern is "**/*@(.sh|.inc|.bash|.command)". + GLOB_PATTERN = vim.env.GLOB_PATTERN or '*@(.blp)', + }, + filetypes = { 'blueprint' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://gitlab.gnome.org/jwestman/blueprint-compiler + +`blueprint-compiler` can be installed via your system package manager. + +Language server for the blurprint markup language, written in python and part +of the blueprint-compiler. +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/bsl_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/bsl_ls.lua new file mode 100644 index 000000000..fef15f927 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/bsl_ls.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'bsl', 'os' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ + https://github.com/1c-syntax/bsl-language-server + + Language Server Protocol implementation for 1C (BSL) - 1C:Enterprise 8 and OneScript languages. + + ]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/bufls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/bufls.lua new file mode 100644 index 000000000..aa25b4c0e --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/bufls.lua @@ -0,0 +1,33 @@ +local util = require 'lspconfig.util' + +local bin_name = 'bufls' +local cmd = { bin_name, 'serve' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, 'start' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'proto' }, + root_dir = function(fname) + return util.root_pattern('buf.work.yaml', '.git')(fname) + end, + }, + docs = { + description = [[ +https://github.com/bufbuild/buf-language-server + +`buf-language-server` can be installed via `go install`: +```sh +go install github.com/bufbuild/buf-language-server/cmd/bufls@latest +``` + +bufls is a Protobuf language server compatible with Buf modules and workspaces +]], + default_config = { + root_dir = [[root_pattern("buf.work.yaml", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ccls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ccls.lua new file mode 100644 index 000000000..3009a6415 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ccls.lua @@ -0,0 +1,50 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'compile_commands.json', + '.ccls', +} + +return { + default_config = { + cmd = { 'ccls' }, + filetypes = { 'c', 'cpp', 'objc', 'objcpp' }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) + end, + offset_encoding = 'utf-32', + -- ccls does not support sending a null root directory + single_file_support = false, + }, + docs = { + description = [[ +https://github.com/MaskRay/ccls/wiki + +ccls relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) specified +as compile_commands.json or, for simpler projects, a .ccls. +For details on how to automatically generate one using CMake look [here](https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html). Alternatively, you can use [Bear](https://github.com/rizsotto/Bear). + +Customization options are passed to ccls at initialization time via init_options, a list of available options can be found [here](https://github.com/MaskRay/ccls/wiki/Customization#initialization-options). For example: + +```lua +local lspconfig = require'lspconfig' +lspconfig.ccls.setup { + init_options = { + compilationDatabaseDirectory = "build"; + index = { + threads = 0; + }; + clang = { + excludeArgs = { "-frounding-math"} ; + }; + } +} + +``` + +]], + default_config = { + root_dir = [[root_pattern('compile_commands.json', '.ccls', '.git')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/clangd.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/clangd.lua new file mode 100644 index 000000000..732f556c1 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/clangd.lua @@ -0,0 +1,88 @@ +local util = require 'lspconfig.util' + +-- https://clangd.llvm.org/extensions.html#switch-between-sourceheader +local function switch_source_header(bufnr) + bufnr = util.validate_bufnr(bufnr) + local clangd_client = util.get_active_client_by_name(bufnr, 'clangd') + local params = { uri = vim.uri_from_bufnr(bufnr) } + if clangd_client then + clangd_client.request('textDocument/switchSourceHeader', params, function(err, result) + if err then + error(tostring(err)) + end + if not result then + print 'Corresponding file cannot be determined' + return + end + vim.api.nvim_command('edit ' .. vim.uri_to_fname(result)) + end, bufnr) + else + print 'method textDocument/switchSourceHeader is not supported by any servers active on the current buffer' + end +end + +local root_files = { + '.clangd', + '.clang-tidy', + '.clang-format', + 'compile_commands.json', + 'compile_flags.txt', + 'configure.ac', -- AutoTools +} + +local default_capabilities = { + textDocument = { + completion = { + editsNearCursor = true, + }, + }, + offsetEncoding = { 'utf-8', 'utf-16' }, +} + +return { + default_config = { + cmd = { 'clangd' }, + filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda', 'proto' }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + capabilities = default_capabilities, + }, + commands = { + ClangdSwitchSourceHeader = { + function() + switch_source_header(0) + end, + description = 'Switch between source/header', + }, + }, + docs = { + description = [[ +https://clangd.llvm.org/installation.html + +- **NOTE:** Clang >= 11 is recommended! See [#23](https://github.com/neovim/nvim-lsp/issues/23). +- If `compile_commands.json` lives in a build directory, you should + symlink it to the root of your source tree. + ``` + ln -s /path/to/myproject/build/compile_commands.json /path/to/myproject/ + ``` +- clangd relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) + specified as compile_commands.json, see https://clangd.llvm.org/installation#compile_commandsjson +]], + default_config = { + root_dir = [[ + root_pattern( + '.clangd', + '.clang-tidy', + '.clang-format', + 'compile_commands.json', + 'compile_flags.txt', + 'configure.ac', + '.git' + ) + ]], + capabilities = [[default capabilities, with offsetEncoding utf-8]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/clarity_lsp.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/clarity_lsp.lua new file mode 100644 index 000000000..72a619721 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/clarity_lsp.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'clarity-lsp' }, + filetypes = { 'clar', 'clarity' }, + root_dir = util.root_pattern '.git', + }, + docs = { + description = [[ +`clarity-lsp` is a language server for the Clarity language. Clarity is a decidable smart contract language that optimizes for predictability and security. Smart contracts allow developers to encode essential business logic on a blockchain. + +To learn how to configure the clarity language server, see the [clarity-lsp documentation](https://github.com/hirosystems/clarity-lsp). +]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/clojure_lsp.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/clojure_lsp.lua new file mode 100644 index 000000000..8bef32df4 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/clojure_lsp.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'clojure-lsp' }, + filetypes = { 'clojure', 'edn' }, + root_dir = util.root_pattern('project.clj', 'deps.edn', 'build.boot', 'shadow-cljs.edn', '.git'), + }, + docs = { + description = [[ +https://github.com/clojure-lsp/clojure-lsp + +Clojure Language Server +]], + default_config = { + root_dir = [[root_pattern("project.clj", "deps.edn", "build.boot", "shadow-cljs.edn", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/cmake.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/cmake.lua new file mode 100644 index 000000000..7f27fea0b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/cmake.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +local root_files = { 'CMakePresets.json', 'CTestConfig.cmake', '.git', 'build', 'cmake' } +return { + default_config = { + cmd = { 'cmake-language-server' }, + filetypes = { 'cmake' }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) + end, + single_file_support = true, + init_options = { + buildDirectory = 'build', + }, + }, + docs = { + description = [[ +https://github.com/regen100/cmake-language-server + +CMake LSP Implementation +]], + default_config = { + root_dir = [[root_pattern('CMakePresets.json', 'CTestConfig.cmake', '.git', 'build', 'cmake')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/codeqlls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/codeqlls.lua new file mode 100644 index 000000000..695041e44 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/codeqlls.lua @@ -0,0 +1,48 @@ +local util = require 'lspconfig.util' + +local workspace_folders = {} + +return { + default_config = { + cmd = { 'codeql', 'execute', 'language-server', '--check-errors', 'ON_CHANGE', '-q' }, + filetypes = { 'ql' }, + root_dir = util.root_pattern 'qlpack.yml', + log_level = vim.lsp.protocol.MessageType.Warning, + before_init = function(initialize_params) + table.insert(workspace_folders, { name = 'workspace', uri = initialize_params['rootUri'] }) + initialize_params['workspaceFolders'] = workspace_folders + end, + settings = { + search_path = vim.empty_dict(), + }, + }, + docs = { + description = [[ +Reference: +https://codeql.github.com/docs/codeql-cli/ + +Binaries: +https://github.com/github/codeql-cli-binaries + ]], + default_config = { + settings = { + search_path = [[list containing all search paths, eg: '~/codeql-home/codeql-repo']], + }, + }, + }, + on_new_config = function(config) + if type(config.settings.search_path) == 'table' and not vim.tbl_isempty(config.settings.search_path) then + local search_path = '--search-path=' + for _, path in ipairs(config.settings.search_path) do + search_path = search_path .. vim.fn.expand(path) .. ':' + table.insert(workspace_folders, { + name = 'workspace', + uri = string.format('file://%s', path), + }) + end + config.cmd = { 'codeql', 'execute', 'language-server', '--check-errors', 'ON_CHANGE', '-q', search_path } + else + config.cmd = { 'codeql', 'execute', 'language-server', '--check-errors', 'ON_CHANGE', '-q' } + end + end, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/crystalline.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/crystalline.lua new file mode 100644 index 000000000..ef4d6bca1 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/crystalline.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'crystalline' }, + filetypes = { 'crystal' }, + root_dir = util.root_pattern 'shard.yml' or util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/elbywan/crystalline + +Crystal language server. +]], + default_config = { + root_dir = [[root_pattern('shard.yml', '.git')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/csharp_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/csharp_ls.lua new file mode 100644 index 000000000..0952457b4 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/csharp_ls.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'csharp-ls' }, + root_dir = util.root_pattern('*.sln', '*.csproj', '*.fsproj', '.git'), + filetypes = { 'cs' }, + init_options = { + AutomaticWorkspaceInit = true, + }, + }, + docs = { + description = [[ +https://github.com/razzmatazz/csharp-language-server + +Language Server for C#. + +csharp-ls requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +The preferred way to install csharp-ls is with `dotnet tool install --global csharp-ls`. + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/cssls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/cssls.lua new file mode 100644 index 000000000..41c38e6af --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/cssls.lua @@ -0,0 +1,49 @@ +local util = require 'lspconfig.util' + +local bin_name = 'vscode-css-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'css', 'scss', 'less' }, + root_dir = util.root_pattern('package.json', '.git'), + single_file_support = true, + settings = { + css = { validate = true }, + scss = { validate = true }, + less = { validate = true }, + }, + }, + docs = { + description = [[ + +https://github.com/hrsh7th/vscode-langservers-extracted + +`css-languageserver` can be installed via `npm`: + +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-css-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.cssls.setup { + capabilities = capabilities, +} +``` +]], + default_config = { + root_dir = [[root_pattern("package.json", ".git") or bufdir]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/cssmodules_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/cssmodules_ls.lua new file mode 100644 index 000000000..3107b75d3 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/cssmodules_ls.lua @@ -0,0 +1,31 @@ +local util = require 'lspconfig.util' + +local bin_name = 'cssmodules-language-server' +local cmd = { bin_name } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact' }, + root_dir = util.find_package_json_ancestor, + }, + docs = { + description = [[ +https://github.com/antonk52/cssmodules-language-server + +Language server for autocompletion and go-to-definition functionality for CSS modules. + +You can install cssmodules-language-server via npm: +```sh +npm install -g cssmodules-language-server +``` + ]], + default_config = { + root_dir = [[root_pattern("package.json")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/cucumber_language_server.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/cucumber_language_server.lua new file mode 100644 index 000000000..07832061f --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/cucumber_language_server.lua @@ -0,0 +1,33 @@ +local util = require 'lspconfig.util' + +local bin_name = 'cucumber-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'cucumber' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://cucumber.io +https://github.com/cucumber/common +https://www.npmjs.com/package/@cucumber/language-server + +Language server for Cucumber. + +`cucumber-language-server` can be installed via `npm`: +```sh +npm install -g @cucumber/language-server +``` + ]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/dafny.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/dafny.lua new file mode 100644 index 000000000..cbd4bbed4 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/dafny.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'dfy', 'dafny' }, + root_dir = function(fname) + util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ + NeoVim support for the Dafny language server. + Please follow the instructions and compile the language server from source: + https://github.com/dafny-lang/language-server-csharp + + Note that there is no default cmd set. You must set it yourself. The recommended way is to use `{"dotnet", ""}`. +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/dagger.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/dagger.lua new file mode 100644 index 000000000..734249fa8 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/dagger.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'cuelsp' }, + filetypes = { 'cue' }, + root_dir = function(fname) + return util.root_pattern('cue.mod', '.git')(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/dagger/cuelsp + +Dagger's lsp server for cuelang. +]], + default_config = { + root_dir = [[root_pattern("cue.mod", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/dartls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/dartls.lua new file mode 100644 index 000000000..c6facdeda --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/dartls.lua @@ -0,0 +1,37 @@ +local util = require 'lspconfig.util' + +local cmd = ( + vim.fn.has 'win32' == 1 and { 'cmd.exe', '/C', 'dart', 'language-server', '--protocol=lsp' } + or { 'dart', 'language-server', '--protocol=lsp' } +) + +return { + default_config = { + cmd = cmd, + filetypes = { 'dart' }, + root_dir = util.root_pattern 'pubspec.yaml', + init_options = { + onlyAnalyzeProjectsWithOpenFiles = true, + suggestFromUnimportedLibraries = true, + closingLabels = true, + outline = true, + flutterOutline = true, + }, + settings = { + dart = { + completeFunctionCalls = true, + showTodos = true, + }, + }, + }, + docs = { + description = [[ +https://github.com/dart-lang/sdk/tree/master/pkg/analysis_server/tool/lsp_spec + +Language server for dart. +]], + default_config = { + root_dir = [[root_pattern("pubspec.yaml")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/denols.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/denols.lua new file mode 100644 index 000000000..1986a3ec6 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/denols.lua @@ -0,0 +1,121 @@ +local util = require 'lspconfig.util' +local lsp = vim.lsp + +local function buf_cache(bufnr, client) + local params = {} + params['referrer'] = { uri = vim.uri_from_bufnr(bufnr) } + params['uris'] = {} + client.request_sync('deno/cache', params) +end + +local function virtual_text_document_handler(uri, res, client) + if not res then + return nil + end + + local lines = vim.split(res.result, '\n') + local bufnr = vim.uri_to_bufnr(uri) + + local current_buf = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false) + if #current_buf ~= 0 then + return nil + end + + vim.api.nvim_buf_set_lines(bufnr, 0, -1, nil, lines) + vim.api.nvim_buf_set_option(bufnr, 'readonly', true) + vim.api.nvim_buf_set_option(bufnr, 'modified', false) + vim.api.nvim_buf_set_option(bufnr, 'modifiable', false) + lsp.buf_attach_client(bufnr, client.id) +end + +local function virtual_text_document(uri, client) + local params = { + textDocument = { + uri = uri, + }, + } + local result = client.request_sync('deno/virtualTextDocument', params) + virtual_text_document_handler(uri, result, client) +end + +local function denols_handler(err, result, ctx) + if not result or vim.tbl_isempty(result) then + return nil + end + + local client = vim.lsp.get_client_by_id(ctx.client_id) + for _, res in pairs(result) do + local uri = res.uri or res.targetUri + if uri:match '^deno:' then + virtual_text_document(uri, client) + res['uri'] = uri + res['targetUri'] = uri + end + end + + lsp.handlers[ctx.method](err, result, ctx) +end + +return { + default_config = { + cmd = { 'deno', 'lsp' }, + filetypes = { + 'javascript', + 'javascriptreact', + 'javascript.jsx', + 'typescript', + 'typescriptreact', + 'typescript.tsx', + }, + root_dir = util.root_pattern('deno.json', 'deno.jsonc', '.git'), + init_options = { + enable = true, + unstable = false, + }, + handlers = { + ['textDocument/definition'] = denols_handler, + ['textDocument/references'] = denols_handler, + ['workspace/executeCommand'] = function(err, result, context) + if context.params.command == 'deno.cache' then + buf_cache(context.bufnr, vim.lsp.get_client_by_id(context.client_id)) + else + lsp.handlers[context.method](err, result, context) + end + end, + }, + }, + commands = { + DenolsCache = { + function() + local clients = vim.lsp.get_active_clients() + for _, client in ipairs(clients) do + if client.name == 'denols' then + buf_cache(0, client) + break + end + end + end, + description = 'Cache a module and all of its dependencies.', + }, + }, + docs = { + description = [[ +https://github.com/denoland/deno + +Deno's built-in language server + +To appropriately highlight codefences returned from denols, you will need to augment vim.g.markdown_fenced languages + in your init.lua. Example: + +```lua +vim.g.markdown_fenced_languages = { + "ts=typescript" +} +``` + +]], + default_config = { + root_dir = [[root_pattern("deno.json", "deno.jsonc", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/dhall_lsp_server.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/dhall_lsp_server.lua new file mode 100644 index 000000000..af910f365 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/dhall_lsp_server.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'dhall-lsp-server' }, + filetypes = { 'dhall' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-lsp-server + +language server for dhall + +`dhall-lsp-server` can be installed via cabal: +```sh +cabal install dhall-lsp-server +``` +prebuilt binaries can be found [here](https://github.com/dhall-lang/dhall-haskell/releases). +]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/diagnosticls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/diagnosticls.lua new file mode 100644 index 000000000..8f0476b61 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/diagnosticls.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +local bin_name = 'diagnostic-languageserver' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + root_dir = util.find_git_ancestor, + single_file_support = true, + filetypes = {}, + }, + docs = { + description = [[ +https://github.com/iamcco/diagnostic-languageserver + +Diagnostic language server integrate with linters. +]], + default_config = { + filetypes = 'Empty by default, override to add filetypes', + root_dir = "Vim's starting directory", + init_options = 'Configuration from https://github.com/iamcco/diagnostic-languageserver#config--document', + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/dockerls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/dockerls.lua new file mode 100644 index 000000000..6d1cfc7d2 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/dockerls.lua @@ -0,0 +1,30 @@ +local util = require 'lspconfig.util' + +local bin_name = 'docker-langserver' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'dockerfile' }, + root_dir = util.root_pattern 'Dockerfile', + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/rcjsuen/dockerfile-language-server-nodejs + +`docker-langserver` can be installed via `npm`: +```sh +npm install -g dockerfile-language-server-nodejs +``` + ]], + default_config = { + root_dir = [[root_pattern("Dockerfile")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/dolmenls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/dolmenls.lua new file mode 100644 index 000000000..36ac87af7 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/dolmenls.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +local bin_name = 'dolmenls' +local cmd = { bin_name } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name } +end +return { + default_config = { + cmd = cmd, + filetypes = { 'smt2', 'tptp', 'p', 'cnf', 'icnf', 'zf' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/Gbury/dolmen/blob/master/doc/lsp.md + +`dolmenls` can be installed via `opam` +```sh +opam install dolmen_lsp +``` + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/dotls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/dotls.lua new file mode 100644 index 000000000..dff14b9cd --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/dotls.lua @@ -0,0 +1,27 @@ +local util = require 'lspconfig.util' + +local bin_name = 'dot-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'dot' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/nikeee/dot-language-server + +`dot-language-server` can be installed via `npm`: +```sh +npm install -g dot-language-server +``` + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/efm.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/efm.lua new file mode 100644 index 000000000..f5f74edc5 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/efm.lua @@ -0,0 +1,43 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'efm-langserver' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + + docs = { + description = [[ +https://github.com/mattn/efm-langserver + +General purpose Language Server that can use specified error message format generated from specified command. + +Requires at minimum EFM version [v0.0.38](https://github.com/mattn/efm-langserver/releases/tag/v0.0.38) to support +launching the language server on single files. If on an older version of EFM, disable single file support: + +```lua +require('lspconfig')['efm'].setup{ + settings = ..., -- You must populate this according to the EFM readme + filetypes = ..., -- Populate this according to the note below + single_file_support = false, -- This is the important line for supporting older version of EFM +} +``` + +Note: In order for neovim's built-in language server client to send the appropriate `languageId` to EFM, **you must +specify `filetypes` in your call to `setup{}`**. Otherwise `lspconfig` will launch EFM on the `BufEnter` instead +of the `FileType` autocommand, and the `filetype` variable used to populate the `languageId` will not yet be set. + +```lua +require('lspconfig')['efm'].setup{ + settings = ..., -- You must populate this according to the EFM readme + filetypes = { 'python','cpp','lua' } +} +``` + +]], + default_config = { + root_dir = [[util.root_pattern(".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/elixirls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/elixirls.lua new file mode 100644 index 000000000..1450b3e4a --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/elixirls.lua @@ -0,0 +1,39 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'elixir', 'eelixir', 'heex', 'surface' }, + root_dir = function(fname) + return util.root_pattern('mix.exs', '.git')(fname) or vim.loop.os_homedir() + end, + }, + docs = { + description = [[ +https://github.com/elixir-lsp/elixir-ls + +`elixir-ls` can be installed by following the instructions [here](https://github.com/elixir-lsp/elixir-ls#building-and-running). + +```bash +curl -fLO https://github.com/elixir-lsp/elixir-ls/releases/latest/download/elixir-ls.zip +unzip elixir-ls.zip -d /path/to/elixir-ls +# Unix +chmod +x /path/to/elixir-ls/language_server.sh +``` + +**By default, elixir-ls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of your unzipped elixir-ls. + +```lua +require'lspconfig'.elixirls.setup{ + -- Unix + cmd = { "/path/to/elixir-ls/language_server.sh" }; + -- Windows + cmd = { "/path/to/elixir-ls/language_server.bat" }; + ... +} +``` +]], + default_config = { + root_dir = [[root_pattern("mix.exs", ".git") or vim.loop.os_homedir()]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/elmls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/elmls.lua new file mode 100644 index 000000000..2718c88c7 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/elmls.lua @@ -0,0 +1,44 @@ +local util = require 'lspconfig.util' +local lsp = vim.lsp +local api = vim.api + +local bin_name = 'elm-language-server' +local cmd = { bin_name } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name } +end + +local default_capabilities = lsp.protocol.make_client_capabilities() +default_capabilities.offsetEncoding = { 'utf-8', 'utf-16' } +local elm_root_pattern = util.root_pattern 'elm.json' + +return { + default_config = { + cmd = cmd, + -- TODO(ashkan) if we comment this out, it will allow elmls to operate on elm.json. It seems like it could do that, but no other editor allows it right now. + filetypes = { 'elm' }, + root_dir = function(fname) + local filetype = api.nvim_buf_get_option(0, 'filetype') + if filetype == 'elm' or (filetype == 'json' and fname:match 'elm%.json$') then + return elm_root_pattern(fname) + end + end, + init_options = { + elmAnalyseTrigger = 'change', + }, + }, + docs = { + description = [[ +https://github.com/elm-tooling/elm-language-server#installation + +If you don't want to use Nvim to install it, then you can use: +```sh +npm install -g elm elm-test elm-format @elm-tooling/elm-language-server +``` +]], + default_config = { + root_dir = [[root_pattern("elm.json")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ember.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ember.lua new file mode 100644 index 000000000..e6ce1eae7 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ember.lua @@ -0,0 +1,30 @@ +local util = require 'lspconfig.util' + +local bin_name = 'ember-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'handlebars', 'typescript', 'javascript' }, + root_dir = util.root_pattern('ember-cli-build.js', '.git'), + }, + docs = { + description = [[ +https://github.com/lifeart/ember-language-server + +`ember-language-server` can be installed via `npm`: + +```sh +npm install -g @lifeart/ember-language-server +``` +]], + default_config = { + root_dir = [[root_pattern("ember-cli-build.js", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/emmet_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/emmet_ls.lua new file mode 100644 index 000000000..f2a37128f --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/emmet_ls.lua @@ -0,0 +1,31 @@ +local util = require 'lspconfig.util' + +local bin_name = 'emmet-ls' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'html', 'typescriptreact', 'javascriptreact', 'css', 'sass', 'scss', 'less', 'eruby' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/aca/emmet-ls + +Package can be installed via `npm`: +```sh +npm install -g emmet-ls +``` +]], + default_config = { + root_dir = 'git root', + single_file_support = true, + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/erg_language_server.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/erg_language_server.lua new file mode 100644 index 000000000..7f2daf700 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/erg_language_server.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'els' }, + filetypes = { 'erg' }, + root_dir = function(fname) + return util.root_pattern 'package.er'(fname) or util.find_git_ancestor(fname) + end, + }, + docs = { + description = [[ +https://github.com/erg-lang/erg-language-server + +ELS (erg-language-server) is a language server for the Erg programming language. + +`els` can be installed via `cargo`: + ```sh + cargo install els + ``` + ]], + default_config = { + root_dir = [[root_pattern("package.er") or find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/erlangls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/erlangls.lua new file mode 100644 index 000000000..cec192845 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/erlangls.lua @@ -0,0 +1,34 @@ +local util = require 'lspconfig.util' + +local cmd = { 'erlang_ls' } +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', 'erlang_ls.cmd' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'erlang' }, + root_dir = util.root_pattern('rebar.config', 'erlang.mk', '.git'), + single_file_support = true, + }, + docs = { + description = [[ +https://erlang-ls.github.io + +Language Server for Erlang. + +Clone [erlang_ls](https://github.com/erlang-ls/erlang_ls) +Compile the project with `make` and copy resulting binaries somewhere in your $PATH eg. `cp _build/*/bin/* ~/local/bin` + +Installation instruction can be found [here](https://github.com/erlang-ls/erlang_ls). + +Installation requirements: + - [Erlang OTP 21+](https://github.com/erlang/otp) + - [rebar3 3.9.1+](https://github.com/erlang/rebar3) +]], + default_config = { + root_dir = [[root_pattern('rebar.config', 'erlang.mk', '.git')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/esbonio.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/esbonio.lua new file mode 100644 index 000000000..ca681d406 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/esbonio.lua @@ -0,0 +1,55 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'python3', '-m', 'esbonio' }, + filetypes = { 'rst' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/swyddfa/esbonio + +Esbonio is a language server for [Sphinx](https://www.sphinx-doc.org/en/master/) documentation projects. +The language server can be installed via pip + +``` +pip install esbonio +``` + +Since Sphinx is highly extensible you will get best results if you install the language server in the same +Python environment as the one used to build your documentation. To ensure that the correct Python environment +is picked up, you can either launch `nvim` with the correct environment activated. + +``` +source env/bin/activate +nvim +``` + +Or you can modify the default `cmd` to include the full path to the Python interpreter. + +```lua +require'lspconfig'.esbonio.setup { + cmd = { '/path/to/virtualenv/bin/python', '-m', 'esbonio' } +} +``` + +Esbonio supports a number of config values passed as `init_options` on startup, for example. + +```lua +require'lspconfig'.esbonio.setup { + init_options = { + server = { + logLevel = "debug" + }, + sphinx = { + confDir = "/path/to/docs", + srcDir = "${confDir}/../docs-src" + } +} +``` + +A full list and explanation of the available options can be found [here](https://swyddfa.github.io/esbonio/docs/latest/en/lsp/getting-started.html#configuration) +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/eslint.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/eslint.lua new file mode 100644 index 000000000..92a44ac46 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/eslint.lua @@ -0,0 +1,195 @@ +local util = require 'lspconfig.util' +local lsp = vim.lsp +local is_windows = vim.fn.has 'win32' == 1 + +local function fix_all(opts) + opts = opts or {} + + local eslint_lsp_client = util.get_active_client_by_name(opts.bufnr, 'eslint') + if eslint_lsp_client == nil then + return + end + + local request + if opts.sync then + request = function(bufnr, method, params) + eslint_lsp_client.request_sync(method, params, nil, bufnr) + end + else + request = function(bufnr, method, params) + eslint_lsp_client.request(method, params, nil, bufnr) + end + end + + local bufnr = util.validate_bufnr(opts.bufnr or 0) + request(0, 'workspace/executeCommand', { + command = 'eslint.applyAllFixes', + arguments = { + { + uri = vim.uri_from_bufnr(bufnr), + version = lsp.util.buf_versions[bufnr], + }, + }, + }) +end + +local bin_name = 'vscode-eslint-language-server' +local cmd = { bin_name, '--stdio' } + +if is_windows then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +local root_file = { + '.eslintrc', + '.eslintrc.js', + '.eslintrc.cjs', + '.eslintrc.yaml', + '.eslintrc.yml', + '.eslintrc.json', + 'eslint.config.js', +} + +local root_with_package = util.find_package_json_ancestor(vim.fn.expand '%:p:h') + +if root_with_package then + -- only add package.json if it contains eslintConfig field + local path_sep = is_windows and '\\' or '/' + for line in io.lines(root_with_package .. path_sep .. 'package.json') do + if line:find 'eslintConfig' then + table.insert(root_file, 'package.json') + break + end + end +end + +return { + default_config = { + cmd = cmd, + filetypes = { + 'javascript', + 'javascriptreact', + 'javascript.jsx', + 'typescript', + 'typescriptreact', + 'typescript.tsx', + 'vue', + 'svelte', + 'astro', + }, + -- https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-file-formats + root_dir = util.root_pattern(unpack(root_file)), + -- Refer to https://github.com/Microsoft/vscode-eslint#settings-options for documentation. + settings = { + validate = 'on', + packageManager = 'npm', + useESLintClass = false, + experimental = { + useFlatConfig = false, + }, + codeActionOnSave = { + enable = false, + mode = 'all', + }, + format = true, + quiet = false, + onIgnoredFiles = 'off', + rulesCustomizations = {}, + run = 'onType', + problems = { + shortenToSingleLine = false, + }, + -- nodePath configures the directory in which the eslint server should start its node_modules resolution. + -- This path is relative to the workspace folder (root dir) of the server instance. + nodePath = '', + -- use the workspace folder location or the file location (if no workspace folder is open) as the working directory + workingDirectory = { mode = 'location' }, + codeAction = { + disableRuleComment = { + enable = true, + location = 'separateLine', + }, + showDocumentation = { + enable = true, + }, + }, + }, + on_new_config = function(config, new_root_dir) + -- The "workspaceFolder" is a VSCode concept. It limits how far the + -- server will traverse the file system when locating the ESLint config + -- file (e.g., .eslintrc). + config.settings.workspaceFolder = { + uri = new_root_dir, + name = vim.fn.fnamemodify(new_root_dir, ':t'), + } + + -- Support Yarn2 (PnP) projects + local pnp_cjs = util.path.join(new_root_dir, '.pnp.cjs') + local pnp_js = util.path.join(new_root_dir, '.pnp.js') + if util.path.exists(pnp_cjs) or util.path.exists(pnp_js) then + config.cmd = vim.list_extend({ 'yarn', 'exec' }, cmd) + end + end, + handlers = { + ['eslint/openDoc'] = function(_, result) + if not result then + return + end + local sysname = vim.loop.os_uname().sysname + if sysname:match 'Windows' then + os.execute(string.format('start %q', result.url)) + elseif sysname:match 'Linux' then + os.execute(string.format('xdg-open %q', result.url)) + else + os.execute(string.format('open %q', result.url)) + end + return {} + end, + ['eslint/confirmESLintExecution'] = function(_, result) + if not result then + return + end + return 4 -- approved + end, + ['eslint/probeFailed'] = function() + vim.notify('[lspconfig] ESLint probe failed.', vim.log.levels.WARN) + return {} + end, + ['eslint/noLibrary'] = function() + vim.notify('[lspconfig] Unable to find ESLint library.', vim.log.levels.WARN) + return {} + end, + }, + }, + commands = { + EslintFixAll = { + function() + fix_all { sync = true, bufnr = 0 } + end, + description = 'Fix all eslint problems for this buffer', + }, + }, + docs = { + description = [[ +https://github.com/hrsh7th/vscode-langservers-extracted + +`vscode-eslint-language-server` is a linting engine for JavaScript / Typescript. +It can be installed via `npm`: + +```sh +npm i -g vscode-langservers-extracted +``` + +`vscode-eslint-language-server` provides an `EslintFixAll` command that can be used to format a document on save: +```vim +autocmd BufWritePre *.tsx,*.ts,*.jsx,*.js EslintFixAll +``` + +See [vscode-eslint](https://github.com/microsoft/vscode-eslint/blob/55871979d7af184bf09af491b6ea35ebd56822cf/server/src/eslintServer.ts#L216-L229) for configuration options. + +Messages handled in lspconfig: `eslint/openDoc`, `eslint/confirmESLintExecution`, `eslint/probeFailed`, `eslint/noLibrary` + +Additional messages you can handle: `eslint/noConfig` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/fennel-ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/fennel-ls.lua new file mode 100644 index 000000000..f8030f902 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/fennel-ls.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'fennel-ls' }, + filetypes = { 'fennel' }, + root_dir = function(dir) + return util.find_git_ancestor(dir) + end, + settings = {}, + }, + docs = { + description = [[ +https://sr.ht/~xerool/fennel-ls/ + +A language server for fennel. +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/flow.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/flow.lua new file mode 100644 index 000000000..3ac59aaa2 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/flow.lua @@ -0,0 +1,27 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'npx', '--no-install', 'flow', 'lsp' }, + filetypes = { 'javascript', 'javascriptreact', 'javascript.jsx' }, + root_dir = util.root_pattern '.flowconfig', + }, + docs = { + description = [[ +https://flow.org/ +https://github.com/facebook/flow + +See below for how to setup Flow itself. +https://flow.org/en/docs/install/ + +See below for lsp command options. + +```sh +npx flow lsp --help +``` + ]], + default_config = { + root_dir = [[root_pattern(".flowconfig")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/flux_lsp.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/flux_lsp.lua new file mode 100644 index 000000000..3be9a1b11 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/flux_lsp.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'flux-lsp' }, + filetypes = { 'flux' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/influxdata/flux-lsp +`flux-lsp` can be installed via `cargo`: +```sh +cargo install --git https://github.com/influxdata/flux-lsp +``` +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/foam_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/foam_ls.lua new file mode 100644 index 000000000..1f0d7fc84 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/foam_ls.lua @@ -0,0 +1,31 @@ +local util = require 'lspconfig.util' +local bin_name = 'foam-ls' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'foam', 'OpenFOAM' }, + root_dir = function(fname) + return util.search_ancestors(fname, function(path) + if util.path.exists(util.path.join(path, 'system', 'controlDict')) then + return path + end + end) + end, + }, + docs = { + description = [[ +https://github.com/FoamScience/foam-language-server + +`foam-language-server` can be installed via `npm` +```sh +npm install -g foam-language-server +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/fortls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/fortls.lua new file mode 100644 index 000000000..41a000515 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/fortls.lua @@ -0,0 +1,36 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { + 'fortls', + '--notify_init', + '--hover_signature', + '--hover_language=fortran', + '--use_signature_help', + }, + filetypes = { 'fortran' }, + root_dir = function(fname) + return util.root_pattern '.fortls'(fname) or util.find_git_ancestor(fname) + end, + settings = {}, + }, + docs = { + description = [[ +https://github.com/gnikit/fortls + +fortls is a Fortran Language Server, the server can be installed via pip + +```sh +pip install fortls +``` + +Settings to the server can be passed either through the `cmd` option or through +a local configuration file e.g. `.fortls`. For more information +see the `fortls` [documentation](https://gnikit.github.io/fortls/options.html). + ]], + default_config = { + root_dir = [[root_pattern(".fortls")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/fsautocomplete.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/fsautocomplete.lua new file mode 100644 index 000000000..4858c044e --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/fsautocomplete.lua @@ -0,0 +1,32 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'fsautocomplete', '--adaptive-lsp-server-enabled' }, + root_dir = util.root_pattern('*.sln', '*.fsproj', '.git'), + filetypes = { 'fsharp' }, + init_options = { + AutomaticWorkspaceInit = true, + }, + }, + docs = { + description = [[ +https://github.com/fsharp/FsAutoComplete + +Language Server for F# provided by FsAutoComplete (FSAC). + +FsAutoComplete requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +The preferred way to install FsAutoComplete is with `dotnet tool install --global fsautocomplete`. + +Instructions to compile from source are found on the main [repository](https://github.com/fsharp/FsAutoComplete). + +You may also need to configure the filetype as Vim defaults to Forth for `*.fs` files: + +`autocmd BufNewFile,BufRead *.fs,*.fsx,*.fsi set filetype=fsharp` + +This is automatically done by plugins such as [PhilT/vim-fsharp](https://github.com/PhilT/vim-fsharp), [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp), and [adelarsq/neofsharp.vim](https://github.com/adelarsq/neofsharp.vim). + + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/fsharp_language_server.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/fsharp_language_server.lua new file mode 100644 index 000000000..1abc60686 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/fsharp_language_server.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'dotnet', 'FSharpLanguageServer.dll' }, + root_dir = util.root_pattern('*.sln', '*.fsproj', '.git'), + filetypes = { 'fsharp' }, + init_options = { + AutomaticWorkspaceInit = true, + }, + settings = {}, + }, + docs = { + description = [[ +F# Language Server +https://github.com/faldor20/fsharp-language-server + +An implementation of the language server protocol using the F# Compiler Service. + +Build the project from source and override the command path to location of DLL. + +If filetype determination is not already performed by an available plugin ([PhilT/vim-fsharp](https://github.com/PhilT/vim-fsharp), [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp), and [adelarsq/neofsharp.vim](https://github.com/adelarsq/neofsharp.vim). +), then the following must be added to initialization configuration: + + +`autocmd BufNewFile,BufRead *.fs,*.fsx,*.fsi set filetype=fsharp` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/fstar.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/fstar.lua new file mode 100644 index 000000000..d866c544b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/fstar.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'fstar.exe', '--lsp' }, + filetypes = { 'fstar' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/FStarLang/FStar + +LSP support is included in FStar. Make sure `fstar.exe` is in your PATH. +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/gdscript.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/gdscript.lua new file mode 100644 index 000000000..1491212a9 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/gdscript.lua @@ -0,0 +1,25 @@ +local util = require 'lspconfig.util' + +local cmd = { 'nc', 'localhost', '6008' } + +if vim.fn.has 'nvim-0.8' == 1 then + cmd = vim.lsp.rpc.connect('127.0.0.1', '6008') +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'gd', 'gdscript', 'gdscript3' }, + root_dir = util.root_pattern('project.godot', '.git'), + }, + docs = { + description = [[ +https://github.com/godotengine/godot + +Language server for GDScript, used by Godot Engine. +]], + default_config = { + root_dir = [[util.root_pattern("project.godot", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ghcide.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ghcide.lua new file mode 100644 index 000000000..7f9307b1e --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ghcide.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'ghcide', '--lsp' }, + filetypes = { 'haskell', 'lhaskell' }, + root_dir = util.root_pattern('stack.yaml', 'hie-bios', 'BUILD.bazel', 'cabal.config', 'package.yaml'), + }, + + docs = { + description = [[ +https://github.com/digital-asset/ghcide + +A library for building Haskell IDE tooling. +"ghcide" isn't for end users now. Use "haskell-language-server" instead of "ghcide". +]], + default_config = { + root_dir = [[root_pattern("stack.yaml", "hie-bios", "BUILD.bazel", "cabal.config", "package.yaml")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ghdl_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ghdl_ls.lua new file mode 100644 index 000000000..0f9e11868 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ghdl_ls.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'ghdl-ls' }, + filetypes = { 'vhdl' }, + root_dir = function(fname) + return util.root_pattern 'hdl-prj.json'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/ghdl/ghdl-language-server + +A language server for VHDL, using ghdl as its backend. + +`ghdl-ls` is part of pyghdl, for installation instructions see +[the upstream README](https://github.com/ghdl/ghdl/tree/master/pyGHDL/lsp). +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/gleam.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/gleam.lua new file mode 100644 index 000000000..ec5504ce9 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/gleam.lua @@ -0,0 +1,25 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'gleam', 'lsp' }, + filetypes = { 'gleam' }, + root_dir = function(fname) + return util.root_pattern('gleam.toml', '.git')(fname) + end, + }, + docs = { + description = [[ +https://github.com/gleam-lang/gleam + +A language server for Gleam Programming Language. +[Installation](https://gleam.run/getting-started/installing/) + +It can be i +]], + default_config = { + cmd = { 'gleam', 'lsp' }, + root_dir = [[root_pattern("gleam.toml", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/glint.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/glint.lua new file mode 100644 index 000000000..9c131d2f8 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/glint.lua @@ -0,0 +1,66 @@ +local util = require 'lspconfig.util' + +local bin_name = 'glint-language-server' +local cmd = { bin_name } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name } +end + +return { + default_config = { + cmd = cmd, + on_new_config = function(config, new_root_dir) + local project_root = util.find_node_modules_ancestor(new_root_dir) + -- Glint should not be installed globally. + local node_bin_path = util.path.join(project_root, 'node_modules', '.bin') + local path = node_bin_path .. util.path.path_separator .. vim.env.PATH + if config.cmd_env then + config.cmd_env.PATH = path + else + config.cmd_env = { PATH = path } + end + end, + filetypes = { + 'html.handlebars', + 'handlebars', + 'typescript', + 'typescript.glimmer', + 'javascript', + 'javascript.glimmer', + }, + root_dir = util.root_pattern( + '.glintrc.yml', + '.glintrc', + '.glintrc.json', + '.glintrc.js', + 'glint.config.js', + 'package.json' + ), + }, + docs = { + description = [[ + https://github.com/typed-ember/glint + + https://typed-ember.gitbook.io/glint/ + + `glint-language-server` is installed when adding `@glint/core` to your project's devDependencies: + + ```sh + npm install @glint/core --save-dev + ``` + + or + + ```sh + yarn add -D @glint/core + ``` + + or + + ```sh + pnpm add -D @glint/core + ``` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/glslls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/glslls.lua new file mode 100644 index 000000000..fd6de7f88 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/glslls.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'glslls', '--stdin' }, + filetypes = { 'glsl' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + capabilities = { + textDocument = { + completion = { + editsNearCursor = true, + }, + }, + offsetEncoding = { 'utf-8', 'utf-16' }, + }, + }, + docs = { + description = [[ +https://github.com/svenstaro/glsl-language-server + +Language server implementation for GLSL + +`glslls` can be compiled and installed manually, or, if your distribution has access to the AUR, +via the `glsl-language-server` AUR package + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/golangci_lint_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/golangci_lint_ls.lua new file mode 100644 index 000000000..21ed58f38 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/golangci_lint_ls.lua @@ -0,0 +1,34 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'golangci-lint-langserver' }, + filetypes = { 'go', 'gomod' }, + init_options = { + command = { 'golangci-lint', 'run', '--out-format', 'json' }, + }, + root_dir = function(fname) + return util.root_pattern 'go.work'(fname) or util.root_pattern('go.mod', '.golangci.yaml', '.git')(fname) + end, + }, + docs = { + description = [[ +Combination of both lint server and client + +https://github.com/nametake/golangci-lint-langserver +https://github.com/golangci/golangci-lint + + +Installation of binaries needed is done via + +``` +go install github.com/nametake/golangci-lint-langserver@latest +go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest +``` + +]], + default_config = { + root_dir = [[root_pattern('go.work') or root_pattern('go.mod', '.golangci.yaml', '.git')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/gopls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/gopls.lua new file mode 100644 index 000000000..8e899d437 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/gopls.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'gopls' }, + filetypes = { 'go', 'gomod', 'gowork', 'gotmpl' }, + root_dir = function(fname) + return util.root_pattern 'go.work'(fname) or util.root_pattern('go.mod', '.git')(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/golang/tools/tree/master/gopls + +Google's lsp server for golang. +]], + default_config = { + root_dir = [[root_pattern("go.mod", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/gradle_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/gradle_ls.lua new file mode 100644 index 000000000..47091b2db --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/gradle_ls.lua @@ -0,0 +1,48 @@ +local util = require 'lspconfig.util' + +local bin_name = 'gradle-language-server' +if vim.fn.has 'win32' == 1 then + bin_name = bin_name .. '.bat' +end + +local root_files = { + 'settings.gradle', -- Gradle (multi-project) +} + +local fallback_root_files = { + 'build.gradle', -- Gradle +} + +return { + default_config = { + filetypes = { 'groovy' }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) or util.root_pattern(unpack(fallback_root_files))(fname) + end, + cmd = { bin_name }, + -- gradle-language-server expects init_options.settings to be defined + init_options = { + settings = { + gradleWrapperEnabled = true, + }, + }, + }, + docs = { + description = [[ +https://github.com/microsoft/vscode-gradle + +Microsoft's lsp server for gradle files + +If you're setting this up manually, build vscode-gradle using `./gradlew installDist` and point `cmd` to the `gradle-language-server` generated in the build directory +]], + default_config = { + root_dir = [[root_pattern("settings.gradle")]], + cmd = { 'gradle-language-server' }, + init_options = { + settings = { + gradleWrapperEnabled = true, + }, + }, + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/grammarly.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/grammarly.lua new file mode 100644 index 000000000..2ab47e188 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/grammarly.lua @@ -0,0 +1,41 @@ +local util = require 'lspconfig.util' + +local bin_name = 'grammarly-languageserver' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'markdown' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + handlers = { + ['$/updateDocumentState'] = function() + return '' + end, + }, + init_options = { + clientId = 'client_BaDkMgx4X19X9UxxYRCXZo', + }, + }, + docs = { + description = [[ +https://github.com/znck/grammarly + +`grammarly-languageserver` can be installed via `npm`: + +```sh +npm i -g grammarly-languageserver +``` + +WARNING: Since this language server uses Grammarly's API, any document you open with it running is shared with them. Please evaluate their [privacy policy](https://www.grammarly.com/privacy-policy) before using this. +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/graphql.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/graphql.lua new file mode 100644 index 000000000..2d586c9ea --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/graphql.lua @@ -0,0 +1,33 @@ +local util = require 'lspconfig.util' + +local bin_name = 'graphql-lsp' +local cmd = { bin_name, 'server', '-m', 'stream' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, 'server', '-m', 'stream' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'graphql', 'typescriptreact', 'javascriptreact' }, + root_dir = util.root_pattern('.git', '.graphqlrc*', '.graphql.config.*', 'graphql.config.*'), + }, + + docs = { + description = [[ +https://github.com/graphql/graphiql/tree/main/packages/graphql-language-service-cli + +`graphql-lsp` can be installed via `npm`: + +```sh +npm install -g graphql-language-service-cli +``` + +Note that you must also have [the graphql package](https://github.com/graphql/graphql-js) installed and create a [GraphQL config file](https://www.graphql-config.com/docs/user/user-introduction). +]], + default_config = { + root_dir = [[util.root_pattern('.git', '.graphqlrc*', '.graphql.config.*', 'graphql.config.*')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/groovyls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/groovyls.lua new file mode 100644 index 000000000..b4182f4a3 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/groovyls.lua @@ -0,0 +1,36 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { + 'java', + '-jar', + 'groovy-language-server-all.jar', + }, + filetypes = { 'groovy' }, + root_dir = function(fname) + return util.root_pattern 'Jenkinsfile'(fname) or util.find_git_ancestor(fname) + end, + }, + docs = { + description = [[ +https://github.com/prominic/groovy-language-server.git + +Requirements: + - Linux/macOS (for now) + - Java 11+ + +`groovyls` can be installed by following the instructions [here](https://github.com/prominic/groovy-language-server.git#build). + +If you have installed groovy language server, you can set the `cmd` custom path as follow: + +```lua +require'lspconfig'.groovyls.setup{ + -- Unix + cmd = { "java", "-jar", "path/to/groovyls/groovy-language-server-all.jar" }, + ... +} +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/haxe_language_server.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/haxe_language_server.lua new file mode 100644 index 000000000..1589c7b04 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/haxe_language_server.lua @@ -0,0 +1,47 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'haxe-language-server' }, + filetypes = { 'haxe' }, + root_dir = util.root_pattern '*.hxml', + settings = { + haxe = { + executable = 'haxe', + }, + }, + init_options = { + displayArguments = { 'build.hxml' }, + }, + }, + docs = { + description = [[ +https://github.com/vshaxe/haxe-language-server + +The Haxe language server can be built by running the following commands from +the project's root directory: + + npm install + npx lix run vshaxe-build -t language-server + +This will create `bin/server.js`. Note that the server requires Haxe 3.4.0 or +higher. + +After building the language server, set the `cmd` setting in your setup +function: + +```lua +lspconfig.haxe_language_server.setup({ + cmd = {"node", "path/to/bin/server.js"}, +}) +``` + +By default, an HXML compiler arguments file named `build.hxml` is expected in +your project's root directory. If your file is named something different, +specify it using the `init_options.displayArguments` setting. +]], + default_config = { + root_dir = [[root_pattern("*.hxml")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/hdl_checker.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/hdl_checker.lua new file mode 100644 index 000000000..5cf294149 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/hdl_checker.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'hdl_checker', '--lsp' }, + filetypes = { 'vhdl', 'verilog', 'systemverilog' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/suoto/hdl_checker +Language server for hdl-checker. +Install using: `pip install hdl-checker --upgrade` +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/hhvm.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/hhvm.lua new file mode 100644 index 000000000..0e8ac5c5b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/hhvm.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'hh_client', 'lsp' }, + filetypes = { 'php', 'hack' }, + root_dir = util.root_pattern '.hhconfig', + }, + docs = { + description = [[ +Language server for programs written in Hack +https://hhvm.com/ +https://github.com/facebook/hhvm +See below for how to setup HHVM & typechecker: +https://docs.hhvm.com/hhvm/getting-started/getting-started + ]], + default_config = { + root_dir = [[root_pattern(".hhconfig")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/hie.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/hie.lua new file mode 100644 index 000000000..96148ad1c --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/hie.lua @@ -0,0 +1,34 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'hie-wrapper', '--lsp' }, + filetypes = { 'haskell' }, + root_dir = util.root_pattern('stack.yaml', 'package.yaml', '.git'), + }, + + docs = { + description = [[ +https://github.com/haskell/haskell-ide-engine + +the following init_options are supported (see https://github.com/haskell/haskell-ide-engine#configuration): +```lua +init_options = { + languageServerHaskell = { + hlintOn = bool; + maxNumberOfProblems = number; + diagnosticsDebounceDuration = number; + liquidOn = bool (default false); + completionSnippetsOn = bool (default true); + formatOnImportOn = bool (default true); + formattingProvider = string (default "brittany", alternate "floskell"); + } +} +``` + ]], + + default_config = { + root_dir = [[root_pattern("stack.yaml", "package.yaml", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/hls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/hls.lua new file mode 100644 index 000000000..54b45e989 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/hls.lua @@ -0,0 +1,55 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'haskell-language-server-wrapper', '--lsp' }, + filetypes = { 'haskell', 'lhaskell' }, + root_dir = function(filepath) + return ( + util.root_pattern('hie.yaml', 'stack.yaml', 'cabal.project')(filepath) + or util.root_pattern('*.cabal', 'package.yaml')(filepath) + ) + end, + single_file_support = true, + settings = { + haskell = { + formattingProvider = 'ormolu', + }, + }, + lspinfo = function(cfg) + local extra = {} + local function on_stdout(_, data, _) + local version = data[1] + table.insert(extra, 'version: ' .. version) + end + + local opts = { + cwd = cfg.cwd, + stdout_buffered = true, + on_stdout = on_stdout, + } + local chanid = vim.fn.jobstart({ cfg.cmd[1], '--version' }, opts) + vim.fn.jobwait { chanid } + return extra + end, + }, + + docs = { + description = [[ +https://github.com/haskell/haskell-language-server + +Haskell Language Server + ]], + + default_config = { + root_dir = [[ +function (filepath) + return ( + util.root_pattern('hie.yaml', 'stack.yaml', 'cabal.project')(filepath) + or util.root_pattern('*.cabal', 'package.yaml')(filepath) + ) +end + ]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/hoon_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/hoon_ls.lua new file mode 100644 index 000000000..80092db19 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/hoon_ls.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +local bin_name = 'hoon-language-server' +local cmd = { bin_name } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'hoon' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/urbit/hoon-language-server + +A language server for Hoon. + +The language server can be installed via `npm install -g @hoon-language-server` + +Start a fake ~zod with `urbit -F zod`. +Start the language server at the Urbit Dojo prompt with: `|start %language-server` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/html.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/html.lua new file mode 100644 index 000000000..2f8214f48 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/html.lua @@ -0,0 +1,48 @@ +local util = require 'lspconfig.util' + +local bin_name = 'vscode-html-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'html' }, + root_dir = util.root_pattern('package.json', '.git'), + single_file_support = true, + settings = {}, + init_options = { + provideFormatter = true, + embeddedLanguages = { css = true, javascript = true }, + configurationSection = { 'html', 'css', 'javascript' }, + }, + }, + docs = { + description = [[ +https://github.com/hrsh7th/vscode-langservers-extracted + +`vscode-html-language-server` can be installed via `npm`: +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-html-language-server` only provides completions when snippet support is enabled. +To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +The code-formatting feature of the lsp can be controlled with the `provideFormatter` option. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.html.setup { + capabilities = capabilities, +} +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/idris2_lsp.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/idris2_lsp.lua new file mode 100644 index 000000000..acb906e63 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/idris2_lsp.lua @@ -0,0 +1,41 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'idris2-lsp' }, + filetypes = { 'idris2' }, + root_dir = util.root_pattern '*.ipkg', + }, + docs = { + description = [[ +https://github.com/idris-community/idris2-lsp + +The Idris 2 language server. + +Plugins for the Idris 2 filetype include +[Idris2-Vim](https://github.com/edwinb/idris2-vim) (fewer features, stable) and +[Nvim-Idris2](https://github.com/ShinKage/nvim-idris2) (cutting-edge, +experimental). + +Idris2-Lsp requires a build of Idris 2 that includes the "Idris 2 API" package. +Package managers with known support for this build include the +[AUR](https://aur.archlinux.org/packages/idris2/) and +[Homebrew](https://formulae.brew.sh/formula/idris2#default). + +If your package manager does not support the Idris 2 API, you will need to build +Idris 2 from source. Refer to the +[the Idris 2 installation instructions](https://github.com/idris-lang/Idris2/blob/main/INSTALL.md) +for details. Steps 5 and 8 are listed as "optional" in that guide, but they are +necessary in order to make the Idris 2 API available. + +You need to install a version of Idris2-Lsp that is compatible with your +version of Idris 2. There should be a branch corresponding to every released +Idris 2 version after v0.4.0. Use the latest commit on that branch. For example, +if you have Idris v0.5.1, you should use the v0.5.1 branch of Idris2-Lsp. + +If your Idris 2 version is newer than the newest Idris2-Lsp branch, use the +latest commit on the `master` branch, and set a reminder to check the Idris2-Lsp +repo for the release of a compatible versioned branch. +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/intelephense.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/intelephense.lua new file mode 100644 index 000000000..c9e35b9dd --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/intelephense.lua @@ -0,0 +1,50 @@ +local util = require 'lspconfig.util' + +local bin_name = 'intelephense' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'php' }, + root_dir = function(pattern) + local cwd = vim.loop.cwd() + local root = util.root_pattern('composer.json', '.git')(pattern) + + -- prefer cwd if root is a descendant + return util.path.is_descendant(cwd, root) and cwd or root + end, + }, + docs = { + description = [[ +https://intelephense.com/ + +`intelephense` can be installed via `npm`: +```sh +npm install -g intelephense +``` +]], + default_config = { + root_dir = [[root_pattern("composer.json", ".git")]], + init_options = [[{ + storagePath = Optional absolute path to storage dir. Defaults to os.tmpdir(). + globalStoragePath = Optional absolute path to a global storage dir. Defaults to os.homedir(). + licenceKey = Optional licence key or absolute path to a text file containing the licence key. + clearCache = Optional flag to clear server state. State can also be cleared by deleting {storagePath}/intelephense + -- See https://github.com/bmewburn/intelephense-docs/blob/master/installation.md#initialisation-options + }]], + settings = [[{ + intelephense = { + files = { + maxSize = 1000000; + }; + }; + -- See https://github.com/bmewburn/intelephense-docs + }]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/java_language_server.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/java_language_server.lua new file mode 100644 index 000000000..3ddf4b1b4 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/java_language_server.lua @@ -0,0 +1,18 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'java' }, + root_dir = util.root_pattern('build.gradle', 'pom.xml', '.git'), + settings = {}, + }, + docs = { + description = [[ +https://github.com/georgewfraser/java-language-server + +Java language server + +Point `cmd` to `lang_server_linux.sh` or the equivalent script for macOS/Windows provided by java-language-server +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/jdtls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/jdtls.lua new file mode 100644 index 000000000..25422faf4 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/jdtls.lua @@ -0,0 +1,174 @@ +local util = require 'lspconfig.util' +local handlers = require 'vim.lsp.handlers' + +local env = { + HOME = vim.loop.os_homedir(), + XDG_CACHE_HOME = os.getenv 'XDG_CACHE_HOME', + JDTLS_JVM_ARGS = os.getenv 'JDTLS_JVM_ARGS', +} + +local function get_cache_dir() + return env.XDG_CACHE_HOME and env.XDG_CACHE_HOME or util.path.join(env.HOME, '.cache') +end + +local function get_jdtls_cache_dir() + return util.path.join(get_cache_dir(), 'jdtls') +end + +local function get_jdtls_config_dir() + return util.path.join(get_jdtls_cache_dir(), 'config') +end + +local function get_jdtls_workspace_dir() + return util.path.join(get_jdtls_cache_dir(), 'workspace') +end + +local function get_jdtls_jvm_args() + local args = {} + for a in string.gmatch((env.JDTLS_JVM_ARGS or ''), '%S+') do + local arg = string.format('--jvm-arg=%s', a) + table.insert(args, arg) + end + return unpack(args) +end + +-- TextDocument version is reported as 0, override with nil so that +-- the client doesn't think the document is newer and refuses to update +-- See: https://github.com/eclipse/eclipse.jdt.ls/issues/1695 +local function fix_zero_version(workspace_edit) + if workspace_edit and workspace_edit.documentChanges then + for _, change in pairs(workspace_edit.documentChanges) do + local text_document = change.textDocument + if text_document and text_document.version and text_document.version == 0 then + text_document.version = nil + end + end + end + return workspace_edit +end + +local function on_textdocument_codeaction(err, actions, ctx) + for _, action in ipairs(actions) do + -- TODO: (steelsojka) Handle more than one edit? + if action.command == 'java.apply.workspaceEdit' then -- 'action' is Command in java format + action.edit = fix_zero_version(action.edit or action.arguments[1]) + elseif type(action.command) == 'table' and action.command.command == 'java.apply.workspaceEdit' then -- 'action' is CodeAction in java format + action.edit = fix_zero_version(action.edit or action.command.arguments[1]) + end + end + + handlers[ctx.method](err, actions, ctx) +end + +local function on_textdocument_rename(err, workspace_edit, ctx) + handlers[ctx.method](err, fix_zero_version(workspace_edit), ctx) +end + +local function on_workspace_applyedit(err, workspace_edit, ctx) + handlers[ctx.method](err, fix_zero_version(workspace_edit), ctx) +end + +-- Non-standard notification that can be used to display progress +local function on_language_status(_, result) + local command = vim.api.nvim_command + command 'echohl ModeMsg' + command(string.format('echo "%s"', result.message)) + command 'echohl None' +end + +local root_files = { + -- Single-module projects + { + 'build.xml', -- Ant + 'pom.xml', -- Maven + 'settings.gradle', -- Gradle + 'settings.gradle.kts', -- Gradle + }, + -- Multi-module projects + { 'build.gradle', 'build.gradle.kts' }, +} + +return { + default_config = { + cmd = { + 'jdtls', + '-configuration', + get_jdtls_config_dir(), + '-data', + get_jdtls_workspace_dir(), + get_jdtls_jvm_args(), + }, + filetypes = { 'java' }, + root_dir = function(fname) + for _, patterns in ipairs(root_files) do + local root = util.root_pattern(unpack(patterns))(fname) + if root then + return root + end + end + end, + single_file_support = true, + init_options = { + workspace = get_jdtls_workspace_dir(), + jvm_args = {}, + os_config = nil, + }, + handlers = { + -- Due to an invalid protocol implementation in the jdtls we have to conform these to be spec compliant. + -- https://github.com/eclipse/eclipse.jdt.ls/issues/376 + ['textDocument/codeAction'] = on_textdocument_codeaction, + ['textDocument/rename'] = on_textdocument_rename, + ['workspace/applyEdit'] = on_workspace_applyedit, + ['language/status'] = vim.schedule_wrap(on_language_status), + ['$/progress'] = vim.schedule_wrap(on_language_status), + }, + }, + docs = { + description = [[ +https://projects.eclipse.org/projects/eclipse.jdt.ls + +Language server for Java. + +IMPORTANT: If you want all the features jdtls has to offer, [nvim-jdtls](https://github.com/mfussenegger/nvim-jdtls) +is highly recommended. If all you need is diagnostics, completion, imports, gotos and formatting and some code actions +you can keep reading here. + +For manual installation you can download precompiled binaries from the +[official downloads site](http://download.eclipse.org/jdtls/snapshots/?d) +and ensure that the `PATH` variable contains the `bin` directory of the extracted archive. + +```lua + -- init.lua + require'lspconfig'.jdtls.setup{} +``` + +You can also pass extra custom jvm arguments with the JDTLS_JVM_ARGS environment variable as a space separated list of arguments, +that will be converted to multiple --jvm-arg= args when passed to the jdtls script. This will allow for example tweaking +the jvm arguments or integration with external tools like lombok: + +```sh +export JDTLS_JVM_ARGS="-javaagent:$HOME/.local/share/java/lombok.jar" +``` + +For automatic installation you can use the following unofficial installers/launchers under your own risk: + - [jdtls-launcher](https://github.com/eruizc-dev/jdtls-launcher) (Includes lombok support by default) + ```lua + -- init.lua + require'lspconfig'.jdtls.setup{ cmd = { 'jdtls' } } + ``` + ]], + default_config = { + root_dir = [[{ + -- Single-module projects + { + 'build.xml', -- Ant + 'pom.xml', -- Maven + 'settings.gradle', -- Gradle + 'settings.gradle.kts', -- Gradle + }, + -- Multi-module projects + { 'build.gradle', 'build.gradle.kts' }, + } or vim.fn.getcwd()]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/jedi_language_server.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/jedi_language_server.lua new file mode 100644 index 000000000..30cf8f506 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/jedi_language_server.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'pyproject.toml', + 'setup.py', + 'setup.cfg', + 'requirements.txt', + 'Pipfile', +} + +return { + default_config = { + cmd = { 'jedi-language-server' }, + filetypes = { 'python' }, + root_dir = util.root_pattern(unpack(root_files)), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/pappasam/jedi-language-server + +`jedi-language-server`, a language server for Python, built on top of jedi + ]], + default_config = { + root_dir = "vim's starting directory", + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/jsonls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/jsonls.lua new file mode 100644 index 000000000..a62a715d0 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/jsonls.lua @@ -0,0 +1,48 @@ +local util = require 'lspconfig.util' + +local bin_name = 'vscode-json-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'json', 'jsonc' }, + init_options = { + provideFormatter = true, + }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + -- this language server config is in VSCode built-in package.json + description = [[ +https://github.com/hrsh7th/vscode-langservers-extracted + +vscode-json-language-server, a language server for JSON and JSON schema + +`vscode-json-language-server` can be installed via `npm`: +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-json-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.jsonls.setup { + capabilities = capabilities, +} +``` +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/jsonnet_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/jsonnet_ls.lua new file mode 100644 index 000000000..64e86cbd9 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/jsonnet_ls.lua @@ -0,0 +1,43 @@ +local util = require 'lspconfig.util' + +-- common jsonnet library paths +local function jsonnet_path(root_dir) + local paths = { + util.path.join(root_dir, 'lib'), + util.path.join(root_dir, 'vendor'), + } + return table.concat(paths, ':') +end + +return { + default_config = { + cmd = { 'jsonnet-language-server' }, + filetypes = { 'jsonnet', 'libsonnet' }, + root_dir = function(fname) + return util.root_pattern 'jsonnetfile.json'(fname) or util.find_git_ancestor(fname) + end, + on_new_config = function(new_config, root_dir) + if not new_config.cmd_env then + new_config.cmd_env = {} + end + if not new_config.cmd_env.JSONNET_PATH then + new_config.cmd_env.JSONNET_PATH = jsonnet_path(root_dir) + end + end, + }, + docs = { + description = [[ +https://github.com/grafana/jsonnet-language-server + +A Language Server Protocol (LSP) server for Jsonnet. + +The language server can be installed with `go`: +```sh +go install github.com/grafana/jsonnet-language-server@latest +``` +]], + default_config = { + root_dir = [[root_pattern("jsonnetfile.json")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/julials.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/julials.lua new file mode 100644 index 000000000..44360c71a --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/julials.lua @@ -0,0 +1,75 @@ +local util = require 'lspconfig.util' + +local cmd = { + 'julia', + '--startup-file=no', + '--history-file=no', + '-e', + [[ + # Load LanguageServer.jl: attempt to load from ~/.julia/environments/nvim-lspconfig + # with the regular load path as a fallback + ls_install_path = joinpath( + get(DEPOT_PATH, 1, joinpath(homedir(), ".julia")), + "environments", "nvim-lspconfig" + ) + pushfirst!(LOAD_PATH, ls_install_path) + using LanguageServer + popfirst!(LOAD_PATH) + depot_path = get(ENV, "JULIA_DEPOT_PATH", "") + project_path = let + dirname(something( + ## 1. Finds an explicitly set project (JULIA_PROJECT) + Base.load_path_expand(( + p = get(ENV, "JULIA_PROJECT", nothing); + p === nothing ? nothing : isempty(p) ? nothing : p + )), + ## 2. Look for a Project.toml file in the current working directory, + ## or parent directories, with $HOME as an upper boundary + Base.current_project(), + ## 3. First entry in the load path + get(Base.load_path(), 1, nothing), + ## 4. Fallback to default global environment, + ## this is more or less unreachable + Base.load_path_expand("@v#.#"), + )) + end + @info "Running language server" VERSION pwd() project_path depot_path + server = LanguageServer.LanguageServerInstance(stdin, stdout, project_path, depot_path) + server.runlinter = true + run(server) + ]], +} + +return { + default_config = { + cmd = cmd, + filetypes = { 'julia' }, + root_dir = function(fname) + return util.root_pattern 'Project.toml'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/julia-vscode/julia-vscode + +LanguageServer.jl can be installed with `julia` and `Pkg`: +```sh +julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.add("LanguageServer")' +``` +where `~/.julia/environments/nvim-lspconfig` is the location where +the default configuration expects LanguageServer.jl to be installed. + +To update an existing install, use the following command: +```sh +julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.update()' +``` + +Note: In order to have LanguageServer.jl pick up installed packages or dependencies in a +Julia project, you must make sure that the project is instantiated: +```sh +julia --project=/path/to/my/project -e 'using Pkg; Pkg.instantiate()' +``` + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/kotlin_language_server.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/kotlin_language_server.lua new file mode 100644 index 000000000..a955fe637 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/kotlin_language_server.lua @@ -0,0 +1,71 @@ +local util = require 'lspconfig.util' + +local bin_name = 'kotlin-language-server' +if vim.fn.has 'win32' == 1 then + bin_name = bin_name .. '.bat' +end + +--- The presence of one of these files indicates a project root directory +-- +-- These are configuration files for the various build systems supported by +-- Kotlin. I am not sure whether the language server supports Ant projects, +-- but I'm keeping it here as well since Ant does support Kotlin. +local root_files = { + 'settings.gradle', -- Gradle (multi-project) + 'settings.gradle.kts', -- Gradle (multi-project) + 'build.xml', -- Ant + 'pom.xml', -- Maven +} + +local fallback_root_files = { + 'build.gradle', -- Gradle + 'build.gradle.kts', -- Gradle +} + +return { + default_config = { + filetypes = { 'kotlin' }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) or util.root_pattern(unpack(fallback_root_files))(fname) + end, + cmd = { bin_name }, + }, + docs = { + description = [[ + A kotlin language server which was developed for internal usage and + released afterwards. Maintaining is not done by the original author, + but by fwcd. + + It is built via gradle and developed on github. + Source and additional description: + https://github.com/fwcd/kotlin-language-server + + This server requires vim to be aware of the kotlin-filetype. + You could refer for this capability to: + https://github.com/udalov/kotlin-vim (recommended) + Note that there is no LICENSE specified yet. + ]], + default_config = { + root_dir = [[root_pattern("settings.gradle")]], + cmd = { 'kotlin-language-server' }, + capabilities = [[ + smart code completion, + diagnostics, + hover, + document symbols, + definition lookup, + method signature help, + dependency resolution, + additional plugins from: https://github.com/fwcd + + Snipped of License (refer to source for full License): + + The MIT License (MIT) + + Copyright (c) 2016 George Fraser + Copyright (c) 2018 fwcd + + ]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/lean3ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/lean3ls.lua new file mode 100644 index 000000000..b35a6932b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/lean3ls.lua @@ -0,0 +1,54 @@ +local util = require 'lspconfig.util' + +local bin_name = 'lean-language-server' +local args = { '--stdio', '--', '-M', '4096', '-T', '100000' } +local cmd = { bin_name, unpack(args) } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, unpack(args) } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'lean3' }, + offset_encoding = 'utf-32', + root_dir = function(fname) + fname = util.path.sanitize(fname) + -- check if inside elan stdlib + local stdlib_dir + do + local _, endpos = fname:find '/lean/library' + if endpos then + stdlib_dir = fname:sub(1, endpos) + end + end + + return util.root_pattern 'leanpkg.toml'(fname) + or util.root_pattern 'leanpkg.path'(fname) + or stdlib_dir + or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/leanprover/lean-client-js/tree/master/lean-language-server + +Lean installation instructions can be found +[here](https://leanprover-community.github.io/get_started.html#regular-install). + +Once Lean is installed, you can install the Lean 3 language server by running +```sh +npm install -g lean-language-server +``` + +Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim), +that plugin fully handles the setup of the Lean language server, +and you shouldn't set up `lean3ls` both with it and `lspconfig`. + ]], + default_config = { + root_dir = [[root_pattern("leanpkg.toml") or root_pattern(".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/leanls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/leanls.lua new file mode 100644 index 000000000..208598af9 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/leanls.lua @@ -0,0 +1,77 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'lake', 'serve', '--' }, + filetypes = { 'lean' }, + root_dir = function(fname) + -- check if inside elan stdlib + fname = util.path.sanitize(fname) + local stdlib_dir + do + local _, endpos = fname:find '/src/lean' + if endpos then + stdlib_dir = fname:sub(1, endpos) + end + end + if not stdlib_dir then + local _, endpos = fname:find '/lib/lean' + if endpos then + stdlib_dir = fname:sub(1, endpos) + end + end + + return util.root_pattern('lakefile.lean', 'lean-toolchain', 'leanpkg.toml')(fname) + or stdlib_dir + or util.find_git_ancestor(fname) + end, + options = { + -- Only Lake 3.0+ supports lake serve, so for old enough Lean 4, + -- or core Lean itself, this command (typically using the in-built + -- Lean 4 language server) will be used instead. + no_lake_lsp_cmd = { 'lean', '--server' }, + }, + on_new_config = function(config, root_dir) + local use_lake_serve = false + if util.path.exists(util.path.join(root_dir, 'lakefile.lean')) then + local lake_version = '' + local lake_job = vim.fn.jobstart({ 'lake', '--version' }, { + on_stdout = function(_, d, _) + lake_version = table.concat(d, '\n') + end, + stdout_buffered = true, + }) + if lake_job > 0 and vim.fn.jobwait({ lake_job })[1] == 0 then + local major = lake_version:match 'Lake version (%d).' + if major and tonumber(major) >= 3 then + use_lake_serve = true + end + end + end + if not use_lake_serve then + config.cmd = config.options.no_lake_lsp_cmd + end + -- add root dir as command-line argument for `ps aux` + table.insert(config.cmd, root_dir) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/leanprover/lean4 + +Lean installation instructions can be found +[here](https://leanprover-community.github.io/get_started.html#regular-install). + +The Lean 4 language server is built-in with a Lean 4 install +(and can be manually run with, e.g., `lean --server`). + +Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim), +that plugin fully handles the setup of the Lean language server, +and you shouldn't set up `leanls` both with it and `lspconfig`. + ]], + default_config = { + root_dir = [[root_pattern("lakefile.lean", "lean-toolchain", "leanpkg.toml", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/lelwel_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/lelwel_ls.lua new file mode 100644 index 000000000..ac8c45605 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/lelwel_ls.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'lelwel-ls' }, + filetypes = { 'llw' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/0x2a-42/lelwel + +Language server for lelwel grammars. + +You can install `lelwel-ls` via cargo: +```sh +cargo install --features="lsp" lelwel +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/lemminx.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/lemminx.lua new file mode 100644 index 000000000..eb1ccaa8b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/lemminx.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'lemminx' }, + filetypes = { 'xml', 'xsd', 'xsl', 'xslt', 'svg' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/eclipse/lemminx + +The easiest way to install the server is to get a binary from https://github.com/redhat-developer/vscode-xml/releases and place it on your PATH. + +NOTE to macOS users: Binaries from unidentified developers are blocked by default. If you trust the downloaded binary, run it once, cancel the prompt, then remove the binary from Gatekeeper quarantine with `xattr -d com.apple.quarantine lemminx`. It should now run without being blocked. + +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ltex.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ltex.lua new file mode 100644 index 000000000..0aeb38742 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ltex.lua @@ -0,0 +1,47 @@ +local util = require 'lspconfig.util' + +local language_id_mapping = { + bib = 'bibtex', + plaintex = 'tex', + rnoweb = 'sweave', + rst = 'restructuredtext', + tex = 'latex', + xhtml = 'xhtml', +} + +local bin_name = 'ltex-ls' +if vim.fn.has 'win32' == 1 then + bin_name = bin_name .. '.bat' +end + +return { + default_config = { + cmd = { bin_name }, + filetypes = { 'bib', 'gitcommit', 'markdown', 'org', 'plaintex', 'rst', 'rnoweb', 'tex' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + get_language_id = function(_, filetype) + local language_id = language_id_mapping[filetype] + if language_id then + return language_id + else + return filetype + end + end, + }, + docs = { + description = [=[ +https://github.com/valentjn/ltex-ls + +LTeX Language Server: LSP language server for LanguageTool 🔍✔️ with support for LaTeX 🎓, Markdown 📝, and others + +To install, download the latest [release](https://github.com/valentjn/ltex-ls/releases) and ensure `ltex-ls` is on your path. + +To support org files or R sweave, users can define a custom filetype autocommand (or use a plugin which defines these filetypes): + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.org set filetype=org ]] +``` +]=], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/luau_lsp.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/luau_lsp.lua new file mode 100644 index 000000000..c916114a0 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/luau_lsp.lua @@ -0,0 +1,27 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'luau-lsp', 'lsp' }, + filetypes = { 'luau' }, + root_dir = util.find_git_ancestor, + }, + docs = { + [[ +https://github.com/JohnnyMorganz/luau-lsp + +Language server for the [Luau](https://luau-lang.org/) language. + +`luau-lsp` can be installed by downloading one of the release assets available at https://github.com/JohnnyMorganz/luau-lsp. + +You might also have to set up automatic filetype detection for Luau files, for example like so: + +```vim +autocmd BufRead,BufNewFile *.luau setf luau +``` +]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/m68k.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/m68k.lua new file mode 100644 index 000000000..9e96d8475 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/m68k.lua @@ -0,0 +1,36 @@ +local util = require 'lspconfig.util' + +local bin_name = 'm68k-lsp-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'asm68k' }, + root_dir = util.root_pattern('Makefile', '.git'), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/grahambates/m68k-lsp + +Language server for Motorola 68000 family assembly + +`m68k-lsp-server` can be installed via `npm`: + +```sh +npm install -g m68k-lsp-server +``` + +Ensure you are using the 68k asm syntax variant in Neovim. + +```lua +vim.g.asmsyntax = 'asm68k' +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/marksman.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/marksman.lua new file mode 100644 index 000000000..113cb1e39 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/marksman.lua @@ -0,0 +1,30 @@ +local util = require 'lspconfig.util' + +local bin_name = 'marksman' +local cmd = { bin_name, 'server' } + +return { + default_config = { + cmd = cmd, + filetypes = { 'markdown' }, + root_dir = function(fname) + local root_files = { '.marksman.toml' } + return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/artempyanykh/marksman + +Marksman is a Markdown LSP server providing completion, cross-references, diagnostics, and more. + +Marksman works on MacOS, Linux, and Windows and is distributed as a self-contained binary for each OS. + +Pre-built binaries can be downloaded from https://github.com/artempyanykh/marksman/releases +]], + default_config = { + root_dir = [[root_pattern(".git", ".marksman.toml")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/metals.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/metals.lua new file mode 100644 index 000000000..1242f51b7 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/metals.lua @@ -0,0 +1,40 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'metals' }, + filetypes = { 'scala' }, + root_dir = util.root_pattern('build.sbt', 'build.sc', 'build.gradle', 'pom.xml'), + message_level = vim.lsp.protocol.MessageType.Log, + init_options = { + statusBarProvider = 'show-message', + isHttpEnabled = true, + compilerOptions = { + snippetAutoIndent = false, + }, + }, + capabilities = { + workspace = { + configuration = false, + }, + }, + }, + docs = { + description = [[ +https://scalameta.org/metals/ + +Scala language server with rich IDE features. + +See full instructions in the Metals documentation: + +https://scalameta.org/metals/docs/editors/vim#using-an-alternative-lsp-client + +Note: that if you're using [nvim-metals](https://github.com/scalameta/nvim-metals), that plugin fully handles the setup and installation of Metals, and you shouldn't set up Metals both with it and `lspconfig`. + +To install Metals, make sure to have [coursier](https://get-coursier.io/docs/cli-installation) installed, and once you do you can install the latest Metals with `cs install metals`. +]], + default_config = { + root_dir = [[util.root_pattern("build.sbt", "build.sc", "build.gradle", "pom.xml")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/millet.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/millet.lua new file mode 100644 index 000000000..0b7d29949 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/millet.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'millet' }, + filetypes = { 'sml' }, + root_dir = util.root_pattern 'millet.toml', + }, + docs = { + description = [[ +https://github.com/azdavis/millet + +Millet, a language server for Standard ML + +To use with nvim: + +1. Install a Rust toolchain: https://rustup.rs +2. Clone the repo +3. Run `cargo build --release --bin lang-srv` +4. Move `target/release/lang-srv` to somewhere on your $PATH as `millet` + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/mint.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/mint.lua new file mode 100644 index 000000000..7fde1c406 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/mint.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'mint', 'ls' }, + filetypes = { 'mint' }, + root_dir = function(fname) + return util.root_pattern 'mint.json'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://www.mint-lang.com + +Install Mint using the [instructions](https://www.mint-lang.com/install). +The language server is included since version 0.12.0. +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/mlir_lsp_server.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/mlir_lsp_server.lua new file mode 100644 index 000000000..22a712688 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/mlir_lsp_server.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'mlir-lsp-server' }, + filetypes = { 'mlir' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://mlir.llvm.org/docs/Tools/MLIRLSP/#mlir-lsp-language-server--mlir-lsp-server= + +The Language Server for the LLVM MLIR language + +`mlir-lsp-server` can be installed at the llvm-project repository (https://github.com/llvm/llvm-project) +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/mlir_pdll_lsp_server.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/mlir_pdll_lsp_server.lua new file mode 100644 index 000000000..e24d634fb --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/mlir_pdll_lsp_server.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'mlir-pdll-lsp-server' }, + filetypes = { 'pdll' }, + root_dir = function(fname) + return util.root_pattern 'pdll_compile_commands.yml'(fname) or util.find_git_ancestor(fname) + end, + }, + docs = { + description = [[ +https://mlir.llvm.org/docs/Tools/MLIRLSP/#pdll-lsp-language-server--mlir-pdll-lsp-server + +The Language Server for the LLVM PDLL language + +`mlir-pdll-lsp-server` can be installed at the llvm-project repository (https://github.com/llvm/llvm-project) +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/mm0_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/mm0_ls.lua new file mode 100644 index 000000000..513bbeb95 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/mm0_ls.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'mm0-rs', 'server' }, + root_dir = util.find_git_ancestor, + filetypes = { 'metamath-zero' }, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/digama0/mm0 + +Language Server for the metamath-zero theorem prover. + +Requires [mm0-rs](https://github.com/digama0/mm0/tree/master/mm0-rs) to be installed +and available on the `PATH`. + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/move_analyzer.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/move_analyzer.lua new file mode 100644 index 000000000..ab9774577 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/move_analyzer.lua @@ -0,0 +1,31 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'move-analyzer' }, + filetypes = { 'move' }, + root_dir = function(fname) + local move_package_dir = util.root_pattern 'Move.toml'(fname) + return move_package_dir + end, + }, + commands = {}, + docs = { + description = [[ +https://github.com/move-language/move/tree/main/language/move-analyzer + +Language server for Move + +The `move-analyzer` can be installed by running: + +``` +cargo install --git https://github.com/move-language/move move-analyzer +``` + +See [`move-analyzer`'s doc](https://github.com/move-language/move/blob/1b258a06e3c7d2bc9174578aac92cca3ac19de71/language/move-analyzer/editors/code/README.md#how-to-install) for details. + ]], + default_config = { + root_dir = [[root_pattern("Move.toml")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/neocmake.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/neocmake.lua new file mode 100644 index 000000000..3839bdbbc --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/neocmake.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +local root_files = { '.git', 'build', 'cmake' } +return { + default_config = { + cmd = { 'neocmakelsp', '--stdio' }, + filetypes = { 'cmake' }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/Decodetalkers/neocmakelsp + +CMake LSP Implementation +]], + default_config = { + root_dir = [[root_pattern('.git', 'cmake')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/nickel_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/nickel_ls.lua new file mode 100644 index 000000000..391abfee6 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/nickel_ls.lua @@ -0,0 +1,37 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'nls' }, + filetypes = { 'ncl', 'nickel' }, + root_dir = util.find_git_ancestor, + }, + + docs = { + description = [[ +Nickel Language Server + +https://github.com/tweag/nickel + +`nls` can be installed with nix, or cargo, from the Nickel repository. +```sh +git clone https://github.com/tweag/nickel.git +``` + +Nix: +```sh +cd nickel +nix-env -f . -i +``` + +cargo: +```sh +cd nickel/lsp/nls +cargo install --path . +``` + +In order to have lspconfig detect Nickel filetypes (a prerequisite for autostarting a server), +install the [Nickel vim plugin](https://github.com/nickel-lang/vim-nickel). + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/nil_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/nil_ls.lua new file mode 100644 index 000000000..ff7ebba20 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/nil_ls.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'nil' }, + filetypes = { 'nix' }, + single_file_support = true, + root_dir = util.root_pattern('flake.nix', '.git'), + }, + docs = { + description = [[ +https://github.com/oxalica/nil + +A new language server for Nix Expression Language. + +If you are using Nix with Flakes support, run `nix profile install github:oxalica/nil` to install. +Check the repository README for more information. + ]], + default_config = { + root_dir = [[root_pattern("flake.nix", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/nimls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/nimls.lua new file mode 100644 index 000000000..3c1aeb2be --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/nimls.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'nimlsp' }, + filetypes = { 'nim' }, + root_dir = function(fname) + return util.root_pattern '*.nimble'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/PMunch/nimlsp + +`nimlsp` can be installed via the `nimble` package manager: + +```sh +nimble install nimlsp +``` + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ntt.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ntt.lua new file mode 100644 index 000000000..0f68a89db --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ntt.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' +local bin_name = 'ntt' + +return { + default_config = { + cmd = { bin_name, 'langserver' }, + filetypes = { 'ttcn' }, + root_dir = util.root_pattern '.git', + }, + docs = { + description = [[ +https://github.com/nokia/ntt +Installation instructions can be found [here](https://github.com/nokia/ntt#Install). +Can be configured by passing a "settings" object to `ntt.setup{}`: +```lua +require('lspconfig').ntt.setup{ + settings = { + ntt = { + } + } +} +``` +]], + default_config = { + root_dir = [[util.root_pattern(".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/nxls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/nxls.lua new file mode 100644 index 000000000..7c4517edd --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/nxls.lua @@ -0,0 +1,31 @@ +local util = require 'lspconfig.util' + +local bin_name = 'nxls' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'json', 'jsonc' }, + root_dir = util.root_pattern('nx.json', '.git'), + }, + docs = { + description = [[ +https://github.com/nrwl/nx-console/tree/master/apps/nxls + +nxls, a language server for Nx Workspaces + +`nxls` can be installed via `npm`: +```sh +npm i -g nxls +``` +]], + default_config = { + root_dir = [[util.root_pattern]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ocamlls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ocamlls.lua new file mode 100644 index 000000000..fcc25dbc5 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ocamlls.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +local bin_name = 'ocaml-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end +return { + default_config = { + cmd = cmd, + filetypes = { 'ocaml', 'reason' }, + root_dir = util.root_pattern('*.opam', 'esy.json', 'package.json'), + }, + docs = { + description = [[ +https://github.com/ocaml-lsp/ocaml-language-server + +`ocaml-language-server` can be installed via `npm` +```sh +npm install -g ocaml-language-server +``` + ]], + default_config = { + root_dir = [[root_pattern("*.opam", "esy.json", "package.json")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ocamllsp.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ocamllsp.lua new file mode 100644 index 000000000..71db1f5b7 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ocamllsp.lua @@ -0,0 +1,38 @@ +local util = require 'lspconfig.util' + +local language_id_of = { + menhir = 'ocaml.menhir', + ocaml = 'ocaml', + ocamlinterface = 'ocaml.interface', + ocamllex = 'ocaml.ocamllex', + reason = 'reason', + dune = 'dune', +} + +local get_language_id = function(_, ftype) + return language_id_of[ftype] +end + +return { + default_config = { + cmd = { 'ocamllsp' }, + filetypes = { 'ocaml', 'ocaml.menhir', 'ocaml.interface', 'ocaml.ocamllex', 'reason', 'dune' }, + root_dir = util.root_pattern('*.opam', 'esy.json', 'package.json', '.git', 'dune-project', 'dune-workspace'), + get_language_id = get_language_id, + }, + docs = { + description = [[ +https://github.com/ocaml/ocaml-lsp + +`ocaml-lsp` can be installed as described in [installation guide](https://github.com/ocaml/ocaml-lsp#installation). + +To install the lsp server in a particular opam switch: +```sh +opam install ocaml-lsp-server +``` + ]], + default_config = { + root_dir = [[root_pattern("*.opam", "esy.json", "package.json", ".git", "dune-project", "dune-workspace")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ols.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ols.lua new file mode 100644 index 000000000..65dd085c7 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ols.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'ols' }, + filetypes = { 'odin' }, + root_dir = util.root_pattern('ols.json', '.git'), + single_file_support = true, + }, + docs = { + description = [[ + https://github.com/DanielGavin/ols + + `Odin Language Server`. + ]], + default_config = { + root_dir = [[util.root_pattern("ols.json", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/omnisharp.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/omnisharp.lua new file mode 100644 index 000000000..0ad8b6a19 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/omnisharp.lua @@ -0,0 +1,139 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + -- Enables support for reading code style, naming convention and analyzer + -- settings from .editorconfig. + enable_editorconfig_support = true, + + -- If true, MSBuild project system will only load projects for files that + -- were opened in the editor. This setting is useful for big C# codebases + -- and allows for faster initialization of code navigation features only + -- for projects that are relevant to code that is being edited. With this + -- setting enabled OmniSharp may load fewer projects and may thus display + -- incomplete reference lists for symbols. + enable_ms_build_load_projects_on_demand = false, + + -- Enables support for roslyn analyzers, code fixes and rulesets. + enable_roslyn_analyzers = false, + + -- Specifies whether 'using' directives should be grouped and sorted during + -- document formatting. + organize_imports_on_format = false, + + -- Enables support for showing unimported types and unimported extension + -- methods in completion lists. When committed, the appropriate using + -- directive will be added at the top of the current file. This option can + -- have a negative impact on initial completion responsiveness, + -- particularly for the first few completion sessions after opening a + -- solution. + enable_import_completion = false, + + -- Specifies whether to include preview versions of the .NET SDK when + -- determining which version to use for project loading. + sdk_include_prereleases = true, + + -- Only run analyzers against open files when 'enableRoslynAnalyzers' is + -- true + analyze_open_documents_only = false, + + filetypes = { 'cs', 'vb' }, + root_dir = function(fname) + return util.root_pattern '*.sln'(fname) or util.root_pattern '*.csproj'(fname) + end, + on_new_config = function(new_config, new_root_dir) + table.insert(new_config.cmd, '-z') -- https://github.com/OmniSharp/omnisharp-vscode/pull/4300 + vim.list_extend(new_config.cmd, { '-s', new_root_dir }) + vim.list_extend(new_config.cmd, { '--hostPID', tostring(vim.fn.getpid()) }) + table.insert(new_config.cmd, 'DotNet:enablePackageRestore=false') + vim.list_extend(new_config.cmd, { '--encoding', 'utf-8' }) + table.insert(new_config.cmd, '--languageserver') + + if new_config.enable_editorconfig_support then + table.insert(new_config.cmd, 'FormattingOptions:EnableEditorConfigSupport=true') + end + + if new_config.organize_imports_on_format then + table.insert(new_config.cmd, 'FormattingOptions:OrganizeImports=true') + end + + if new_config.enable_ms_build_load_projects_on_demand then + table.insert(new_config.cmd, 'MsBuild:LoadProjectsOnDemand=true') + end + + if new_config.enable_roslyn_analyzers then + table.insert(new_config.cmd, 'RoslynExtensionsOptions:EnableAnalyzersSupport=true') + end + + if new_config.enable_import_completion then + table.insert(new_config.cmd, 'RoslynExtensionsOptions:EnableImportCompletion=true') + end + + if new_config.sdk_include_prereleases then + table.insert(new_config.cmd, 'Sdk:IncludePrereleases=true') + end + + if new_config.analyze_open_documents_only then + table.insert(new_config.cmd, 'RoslynExtensionsOptions:AnalyzeOpenDocumentsOnly=true') + end + end, + init_options = {}, + }, + docs = { + description = [[ +https://github.com/omnisharp/omnisharp-roslyn +OmniSharp server based on Roslyn workspaces + +`omnisharp-roslyn` can be installed by downloading and extracting a release from [here](https://github.com/OmniSharp/omnisharp-roslyn/releases). +OmniSharp can also be built from source by following the instructions [here](https://github.com/omnisharp/omnisharp-roslyn#downloading-omnisharp). + +OmniSharp requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +**By default, omnisharp-roslyn doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. + +```lua +require'lspconfig'.omnisharp.setup { + cmd = { "dotnet", "/path/to/omnisharp/OmniSharp.dll" }, + + -- Enables support for reading code style, naming convention and analyzer + -- settings from .editorconfig. + enable_editorconfig_support = true, + + -- If true, MSBuild project system will only load projects for files that + -- were opened in the editor. This setting is useful for big C# codebases + -- and allows for faster initialization of code navigation features only + -- for projects that are relevant to code that is being edited. With this + -- setting enabled OmniSharp may load fewer projects and may thus display + -- incomplete reference lists for symbols. + enable_ms_build_load_projects_on_demand = false, + + -- Enables support for roslyn analyzers, code fixes and rulesets. + enable_roslyn_analyzers = false, + + -- Specifies whether 'using' directives should be grouped and sorted during + -- document formatting. + organize_imports_on_format = false, + + -- Enables support for showing unimported types and unimported extension + -- methods in completion lists. When committed, the appropriate using + -- directive will be added at the top of the current file. This option can + -- have a negative impact on initial completion responsiveness, + -- particularly for the first few completion sessions after opening a + -- solution. + enable_import_completion = false, + + -- Specifies whether to include preview versions of the .NET SDK when + -- determining which version to use for project loading. + sdk_include_prereleases = true, + + -- Only run analyzers against open files when 'enableRoslynAnalyzers' is + -- true + analyze_open_documents_only = false, +} +``` +]], + default_config = { + root_dir = [[root_pattern(".sln") or root_pattern(".csproj")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/opencl_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/opencl_ls.lua new file mode 100644 index 000000000..dc88d24c4 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/opencl_ls.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'opencl-language-server' }, + filetypes = { 'opencl' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/Galarius/opencl-language-server + +Build instructions can be found [here](https://github.com/Galarius/opencl-language-server/blob/main/_dev/build.md). + +Prebuilt binaries are available for Linux, macOS and Windows [here](https://github.com/Galarius/opencl-language-server/releases). +]], + default_config = { + root_dir = [[util.root_pattern(".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/openscad_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/openscad_ls.lua new file mode 100644 index 000000000..e5ca9cac5 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/openscad_ls.lua @@ -0,0 +1,32 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'openscad-language-server' }, + filetypes = { 'openscad' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [=[ +https://github.com/dzhu/openscad-language-server + +A Language Server Protocol server for OpenSCAD + +You can build and install `openscad-language-server` binary with `cargo`: +```sh +cargo install openscad-language-server +``` + +Vim does not have built-in syntax for the `openscad` filetype currently. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.scad set filetype=openscad ]] +``` + +or by installing a filetype plugin such as https://github.com/sirtaj/vim-openscad +]=], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/pasls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/pasls.lua new file mode 100644 index 000000000..19ef8486f --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/pasls.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'pasls' }, + filetypes = { 'pascal' }, + root_dir = util.root_pattern('*.lpi', '*.lpk', '.git'), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/genericptr/pascal-language-server + +An LSP server implementation for Pascal variants that are supported by Free Pascal, including Object Pascal. It uses CodeTools from Lazarus as backend. + +First set `cmd` to the Pascal lsp binary. + +Customization options are passed to pasls as environment variables for example in your `.bashrc`: +```bash +export FPCDIR='/usr/lib/fpc/src' # FPC source directory (This is the only required option for the server to work). +export PP='/usr/lib/fpc/3.2.2/ppcx64' # Path to the Free Pascal compiler executable. +export LAZARUSDIR='/usr/lib/lazarus' # Path to the Lazarus sources. +export FPCTARGET='' # Target operating system for cross compiling. +export FPCTARGETCPU='x86_64' # Target CPU for cross compiling. +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/perlls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/perlls.lua new file mode 100644 index 000000000..5d241a5d6 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/perlls.lua @@ -0,0 +1,39 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { + 'perl', + '-MPerl::LanguageServer', + '-e', + 'Perl::LanguageServer::run', + '--', + '--port 13603', + '--nostdio 0', + '--version 2.1.0', + }, + settings = { + perl = { + perlCmd = 'perl', + perlInc = ' ', + fileFilter = { '.pm', '.pl' }, + ignoreDirs = '.git', + }, + }, + filetypes = { 'perl' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/richterger/Perl-LanguageServer/tree/master/clients/vscode/perl + +`Perl-LanguageServer`, a language server for Perl. + +To use the language server, ensure that you have Perl::LanguageServer installed and perl command is on your path. +]], + default_config = { + root_dir = "vim's starting directory", + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/perlnavigator.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/perlnavigator.lua new file mode 100644 index 000000000..7ba389552 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/perlnavigator.lua @@ -0,0 +1,39 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = {}, + filetypes = { 'perl' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/bscan/PerlNavigator + +A Perl language server + +**By default, perlnavigator doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. +You have to install the language server manually. + +Clone the PerlNavigator repo, install based on the [instructions](https://github.com/bscan/PerlNavigator#installation-for-other-editors), +and point `cmd` to `server.js` inside the `server/out` directory: + +```lua +cmd = {'node', '/server/out/server.js', '--stdio'} +``` + +At minimum, you will need `perl` in your path. If you want to use a non-standard `perl` you will need to set your configuration like so: +```lua +settings = { + perlnavigator = { + perlPath = '/some/odd/location/my-perl' + } +} +``` + +The `contributes.configuration.properties` section of `perlnavigator`'s `package.json` has all available configuration settings. All +settings have a reasonable default, but, at minimum, you may want to point `perlnavigator` at your `perltidy` and `perlcritic` configurations. +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/perlpls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/perlpls.lua new file mode 100644 index 000000000..332602812 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/perlpls.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'pls' }, + settings = { + perl = { + perlcritic = { enabled = false }, + syntax = { enabled = true }, + }, + }, + filetypes = { 'perl' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/FractalBoy/perl-language-server +https://metacpan.org/pod/PLS + +`PLS`, another language server for Perl. + +To use the language server, ensure that you have PLS installed and that it is in your path +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/phan.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/phan.lua new file mode 100644 index 000000000..bb5242e62 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/phan.lua @@ -0,0 +1,40 @@ +local util = require 'lspconfig.util' + +local cmd = { + 'phan', + '-m', + 'json', + '--no-color', + '--no-progress-bar', + '-x', + '-u', + '-S', + '--language-server-on-stdin', + '--allow-polyfill-parser', +} + +return { + default_config = { + cmd = cmd, + filetypes = { 'php' }, + single_file_support = true, + root_dir = function(pattern) + local cwd = vim.loop.cwd() + local root = util.root_pattern('composer.json', '.git')(pattern) + + -- prefer cwd if root is a descendant + return util.path.is_descendant(cwd, root) and cwd or root + end, + }, + docs = { + description = [[ +https://github.com/phan/phan + +Installation: https://github.com/phan/phan#getting-started +]], + default_config = { + cmd = cmd, + root_dir = [[root_pattern("composer.json", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/phpactor.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/phpactor.lua new file mode 100644 index 000000000..5a1f0d10e --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/phpactor.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'phpactor', 'language-server' }, + filetypes = { 'php' }, + root_dir = function(pattern) + local cwd = vim.loop.cwd() + local root = util.root_pattern('composer.json', '.git')(pattern) + + -- prefer cwd if root is a descendant + return util.path.is_descendant(cwd, root) and cwd or root + end, + }, + docs = { + description = [[ +https://github.com/phpactor/phpactor + +Installation: https://phpactor.readthedocs.io/en/master/usage/standalone.html#global-installation +]], + default_config = { + cmd = { 'phpactor', 'language-server' }, + root_dir = [[root_pattern("composer.json", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/please.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/please.lua new file mode 100644 index 000000000..085d1e700 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/please.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'plz', 'tool', 'lps' }, + filetypes = { 'bzl' }, + root_dir = util.root_pattern '.plzconfig', + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/thought-machine/please + +High-performance extensible build system for reproducible multi-language builds. + +The `plz` binary will automatically install the LSP for you on first run +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/powershell_es.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/powershell_es.lua new file mode 100644 index 000000000..ac723f436 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/powershell_es.lua @@ -0,0 +1,72 @@ +local util = require 'lspconfig.util' + +local temp_path = vim.fn.stdpath 'cache' + +local function make_cmd(new_config) + if new_config.bundle_path ~= nil then + local command_fmt = + [[%s/PowerShellEditorServices/Start-EditorServices.ps1 -BundledModulesPath %s -LogPath %s/powershell_es.log -SessionDetailsPath %s/powershell_es.session.json -FeatureFlags @() -AdditionalModules @() -HostName nvim -HostProfileId 0 -HostVersion 1.0.0 -Stdio -LogLevel Normal]] + local command = command_fmt:format(new_config.bundle_path, new_config.bundle_path, temp_path, temp_path) + return { new_config.shell, '-NoLogo', '-NoProfile', '-Command', command } + end +end + +return { + default_config = { + shell = 'pwsh', + on_new_config = function(new_config, _) + -- Don't overwrite cmd if already set + if not new_config.cmd then + new_config.cmd = make_cmd(new_config) + end + end, + + filetypes = { 'ps1' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/PowerShell/PowerShellEditorServices + +Language server for PowerShell. + +To install, download and extract PowerShellEditorServices.zip +from the [releases](https://github.com/PowerShell/PowerShellEditorServices/releases). +To configure the language server, set the property `bundle_path` to the root +of the extracted PowerShellEditorServices.zip. + +The default configuration doesn't set `cmd` unless `bundle_path` is specified. + +```lua +require'lspconfig'.powershell_es.setup{ + bundle_path = 'c:/w/PowerShellEditorServices', +} +``` + +By default the languageserver is started in `pwsh` (PowerShell Core). This can be changed by specifying `shell`. + +```lua +require'lspconfig'.powershell_es.setup{ + bundle_path = 'c:/w/PowerShellEditorServices', + shell = 'powershell.exe', +} +``` + +Note that the execution policy needs to be set to `Unrestricted` for the languageserver run under PowerShell + +If necessary, specific `cmd` can be defined instead of `bundle_path`. +See [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices#stdio) +to learn more. + +```lua +require'lspconfig'.powershell_es.setup{ + cmd = {'pwsh', '-NoLogo', '-NoProfile', '-Command', "c:/PSES/Start-EditorServices.ps1 ..."} +} +``` +]], + default_config = { + root_dir = 'git root or current directory', + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/prismals.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/prismals.lua new file mode 100644 index 000000000..f330e2539 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/prismals.lua @@ -0,0 +1,34 @@ +local util = require 'lspconfig.util' + +local bin_name = 'prisma-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'prisma' }, + settings = { + prisma = { + prismaFmtBinPath = '', + }, + }, + root_dir = util.root_pattern('.git', 'package.json'), + }, + docs = { + description = [[ +Language Server for the Prisma JavaScript and TypeScript ORM + +`@prisma/language-server` can be installed via npm +```sh +npm install -g @prisma/language-server +``` +]], + default_config = { + root_dir = [[root_pattern(".git", "package.json")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/prolog_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/prolog_ls.lua new file mode 100644 index 000000000..91b4ba3b1 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/prolog_ls.lua @@ -0,0 +1,27 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { + 'swipl', + '-g', + 'use_module(library(lsp_server)).', + '-g', + 'lsp_server:main', + '-t', + 'halt', + '--', + 'stdio', + }, + filetypes = { 'prolog' }, + root_dir = util.root_pattern 'pack.pl', + single_file_support = true, + }, + docs = { + description = [[ + https://github.com/jamesnvc/lsp_server + + Language Server Protocol server for SWI-Prolog + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/prosemd_lsp.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/prosemd_lsp.lua new file mode 100644 index 000000000..048e4b494 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/prosemd_lsp.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'prosemd-lsp', '--stdio' }, + filetypes = { 'markdown' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/kitten/prosemd-lsp + +An experimental LSP for Markdown. + +Please see the manual installation instructions: https://github.com/kitten/prosemd-lsp#manual-installation +]], + default_config = { + root_dir = util.find_git_ancestor, + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/psalm.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/psalm.lua new file mode 100644 index 000000000..01f758192 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/psalm.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +local bin_name = 'psalm-language-server' + +if vim.fn.has 'win32' == 1 then + bin_name = bin_name .. '.bat' +end + +return { + default_config = { + cmd = { bin_name }, + filetypes = { 'php' }, + root_dir = util.root_pattern('psalm.xml', 'psalm.xml.dist'), + }, + docs = { + description = [[ +https://github.com/vimeo/psalm + +Can be installed with composer. +```sh +composer global require vimeo/psalm +``` +]], + default_config = { + cmd = { 'psalm-language-server' }, + root_dir = [[root_pattern("psalm.xml", "psalm.xml.dist")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/puppet.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/puppet.lua new file mode 100644 index 000000000..18a1532cc --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/puppet.lua @@ -0,0 +1,38 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'manifests', + '.puppet-lint.rc', + 'hiera.yaml', + '.git', +} + +return { + default_config = { + cmd = { 'puppet-languageserver', '--stdio' }, + filetypes = { 'puppet' }, + root_dir = util.root_pattern(unpack(root_files)), + single_file_support = true, + }, + docs = { + description = [[ +LSP server for Puppet. + +Installation: + +- Clone the editor-services repository: + https://github.com/puppetlabs/puppet-editor-services + +- Navigate into that directory and run: `bundle install` + +- Install the 'puppet-lint' gem: `gem install puppet-lint` + +- Add that repository to $PATH. + +- Ensure you can run `puppet-languageserver` from outside the editor-services directory. +]], + default_config = { + root_dir = [[root_pattern("manifests", ".puppet-lint.rc", "hiera.yaml", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/purescriptls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/purescriptls.lua new file mode 100644 index 000000000..7010d57df --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/purescriptls.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +local bin_name = 'purescript-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'purescript' }, + root_dir = util.root_pattern('bower.json', 'psc-package.json', 'spago.dhall', 'flake.nix', 'shell.nix'), + }, + docs = { + description = [[ +https://github.com/nwolverson/purescript-language-server + +The `purescript-language-server` can be added to your project and `$PATH` via + +* JavaScript package manager such as npm, pnpm, Yarn, et al. +* Nix under the `nodePackages` and `nodePackages_latest` package sets +]], + default_config = { + root_dir = [[root_pattern('spago.dhall', 'psc-package.json', 'bower.json', 'flake.nix', 'shell.nix'),]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/pylsp.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/pylsp.lua new file mode 100644 index 000000000..d76b2ea33 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/pylsp.lua @@ -0,0 +1,48 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'pylsp' }, + filetypes = { 'python' }, + root_dir = function(fname) + local root_files = { + 'pyproject.toml', + 'setup.py', + 'setup.cfg', + 'requirements.txt', + 'Pipfile', + } + return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/python-lsp/python-lsp-server + +A Python 3.6+ implementation of the Language Server Protocol. + +See the [project's README](https://github.com/python-lsp/python-lsp-server) for installation instructions. + +Configuration options are documented [here](https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md). +In order to configure an option, it must be translated to a nested Lua table and included in the `settings` argument to the `setup{}` function. +For example, in order to set the `pylsp.plugins.pycodestyle.ignore` option: +```lua +require'lspconfig'.pylsp.setup{ + settings = { + pylsp = { + plugins = { + pycodestyle = { + ignore = {'W391'}, + maxLineLength = 100 + } + } + } + } +} +``` + +Note: This is a community fork of `pyls`. + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/pyre.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/pyre.lua new file mode 100644 index 000000000..5c2f8fb73 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/pyre.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'pyre', 'persistent' }, + filetypes = { 'python' }, + root_dir = util.root_pattern '.pyre_configuration', + }, + docs = { + description = [[ +https://pyre-check.org/ + +`pyre` a static type checker for Python 3. + +`pyre` offers an extremely limited featureset. It currently only supports diagnostics, +which are triggered on save. + +Do not report issues for missing features in `pyre` to `lspconfig`. + +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/pyright.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/pyright.lua new file mode 100644 index 000000000..a198477f4 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/pyright.lua @@ -0,0 +1,56 @@ +local util = require 'lspconfig.util' + +local bin_name = 'pyright-langserver' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +local root_files = { + 'pyproject.toml', + 'setup.py', + 'setup.cfg', + 'requirements.txt', + 'Pipfile', + 'pyrightconfig.json', +} + +local function organize_imports() + local params = { + command = 'pyright.organizeimports', + arguments = { vim.uri_from_bufnr(0) }, + } + vim.lsp.buf.execute_command(params) +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'python' }, + root_dir = util.root_pattern(unpack(root_files)), + single_file_support = true, + settings = { + python = { + analysis = { + autoSearchPaths = true, + useLibraryCodeForTypes = true, + diagnosticMode = 'workspace', + }, + }, + }, + }, + commands = { + PyrightOrganizeImports = { + organize_imports, + description = 'Organize Imports', + }, + }, + docs = { + description = [[ +https://github.com/microsoft/pyright + +`pyright`, a static type checker and language server for python +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/qml_lsp.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/qml_lsp.lua new file mode 100644 index 000000000..0f334a321 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/qml_lsp.lua @@ -0,0 +1,16 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'qml-lsp' }, + filetypes = { 'qmljs' }, + root_dir = util.root_pattern '*.qml', + }, + docs = { + description = [[ +https://invent.kde.org/sdk/qml-lsp + +LSP implementation for QML (autocompletion, live linting, etc. in editors) + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/qmlls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/qmlls.lua new file mode 100644 index 000000000..e5a900658 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/qmlls.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'qmlls' }, + filetypes = { 'qmljs' }, + root_dir = function(fname) + return util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/qt/qtdeclarative + +LSP implementation for QML (autocompletion, live linting, etc. in editors), + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/quick_lint_js.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/quick_lint_js.lua new file mode 100644 index 000000000..29daa966e --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/quick_lint_js.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'quick-lint-js', '--lsp-server' }, + filetypes = { 'javascript' }, + root_dir = util.root_pattern('package.json', 'jsconfig.json', '.git'), + single_file_support = true, + }, + docs = { + description = [[ +https://quick-lint-js.com/ + +quick-lint-js finds bugs in JavaScript programs. + +See installation [instructions](https://quick-lint-js.com/install/) +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/r_language_server.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/r_language_server.lua new file mode 100644 index 000000000..7e1e3f38a --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/r_language_server.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'R', '--slave', '-e', 'languageserver::run()' }, + filetypes = { 'r', 'rmd' }, + root_dir = function(fname) + return util.find_git_ancestor(fname) or vim.loop.os_homedir() + end, + log_level = vim.lsp.protocol.MessageType.Warning, + }, + docs = { + description = [[ +[languageserver](https://github.com/REditorSupport/languageserver) is an +implementation of the Microsoft's Language Server Protocol for the R +language. + +It is released on CRAN and can be easily installed by + +```R +install.packages("languageserver") +``` +]], + default_config = { + root_dir = [[root_pattern(".git") or os_homedir]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/racket_langserver.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/racket_langserver.lua new file mode 100644 index 000000000..25bd0ab1f --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/racket_langserver.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'racket', '--lib', 'racket-langserver' }, + filetypes = { 'racket', 'scheme' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +[https://github.com/jeapostrophe/racket-langserver](https://github.com/jeapostrophe/racket-langserver) + +The Racket language server. This project seeks to use +[DrRacket](https://github.com/racket/drracket)'s public API to provide +functionality that mimics DrRacket's code tools as closely as possible. + +Install via `raco`: `raco pkg install racket-langserver` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/reason_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/reason_ls.lua new file mode 100644 index 000000000..75028c7c8 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/reason_ls.lua @@ -0,0 +1,16 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'reason-language-server' }, + filetypes = { 'reason' }, + root_dir = util.root_pattern('bsconfig.json', '.git'), + }, + docs = { + description = [[ +Reason language server + +You can install reason language server from [reason-language-server](https://github.com/jaredly/reason-language-server) repository. +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/relay_lsp.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/relay_lsp.lua new file mode 100644 index 000000000..7b8492932 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/relay_lsp.lua @@ -0,0 +1,117 @@ +local util = require 'lspconfig.util' +local log = require 'vim.lsp.log' + +local bin_name = 'relay-compiler' +local cmd = { bin_name, 'lsp' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, 'lsp' } +end + +return { + default_config = { + -- (default: false) Whether or not we should automatically start the + -- Relay Compiler in watch mode when you open a project + auto_start_compiler = false, + + -- (default: nil) Path to a relay config relative to the `root_dir`. + -- Without this, the compiler will search for your config. This is + -- helpful if your relay project is in a nested directory. + path_to_config = nil, + + cmd = cmd, + filetypes = { + 'javascript', + 'javascriptreact', + 'javascript.jsx', + 'typescript', + 'typescriptreact', + 'typescript.tsx', + }, + root_dir = util.root_pattern('relay.config.*', 'package.json'), + on_new_config = function(config, root_dir) + local project_root = util.find_node_modules_ancestor(root_dir) + local node_bin_path = util.path.join(project_root, 'node_modules', '.bin') + local compiler_cmd = { util.path.join(node_bin_path, bin_name), '--watch' } + local path = node_bin_path .. util.path.path_separator .. vim.env.PATH + if config.cmd_env then + config.cmd_env.PATH = path + else + config.cmd_env = { PATH = path } + end + + if config.path_to_config then + config.path_to_config = util.path.sanitize(config.path_to_config) + local path_to_config = util.path.join(root_dir, config.path_to_config) + if util.path.exists(path_to_config) then + vim.list_extend(config.cmd, { config.path_to_config }) + vim.list_extend(compiler_cmd, { config.path_to_config }) + else + log.error "[Relay LSP] Can't find Relay config file. Fallback to the default location..." + end + end + if config.auto_start_compiler then + vim.fn.jobstart(compiler_cmd, { + on_exit = function() + log.info '[Relay LSP] Relay Compiler exited' + end, + cwd = project_root, + }) + end + end, + handlers = { + ['window/showStatus'] = function(_, result) + if not result then + return {} + end + local log_message = string.format('[Relay LSP] %q', result.message) + if result.type == 1 then + log.error(log_message) + end + if result.type == 2 then + log.warn(log_message) + end + if result.type == 3 then + log.info(log_message) + end + return {} + end, + }, + }, + docs = { + description = [[ + https://github.com/facebook/relay + `Relay` is a JavaScript framework for building data-driven React applications + + Setup: + + - Make sure you have a Relay config file somewhere in your project. + - We support standard config file formats (`.yml`, `.js`, `.json`), and the the `relay` field in your `package.json` + - Make sure you have the `relay-compiler` installed in your project. The bare minimum is v13. + - Make sure you are able to run the `relay-compiler` command from the command line. If `yarn relay-compiler` works, it's very likely that the LSP will work. + - Remove / disable any conflicting GraphQL LSPs you have installed. + + Relay LSP is a part of the Relay Compiler binary and available when adding `relay-compiler` to your project's devDependencies. + + ```lua + require'lspconfig'.relay_lsp.setup { + -- (default: false) Whether or not we should automatically start + -- the Relay Compiler in watch mode when you open a project + auto_start_compiler = false, + + + -- (default: null) Path to a relay config relative to the + -- `root_dir`. Without this, the compiler will search for your + -- config. This is helpful if your relay project is in a nested + -- directory. + path_to_config = nil, + } + ``` + ]], + default_config = { + root_dir = [[root_pattern("relay.config.*", "package.json")]], + auto_start_compiler = false, + path_to_config = nil, + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/remark_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/remark_ls.lua new file mode 100644 index 000000000..4ef37177c --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/remark_ls.lua @@ -0,0 +1,50 @@ +local util = require 'lspconfig.util' + +local bin_name = 'remark-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'markdown' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/remarkjs/remark-language-server + +`remark-language-server` can be installed via `npm`: +```sh +npm install -g remark-language-server +``` + +`remark-language-server` uses the same +[configuration files](https://github.com/remarkjs/remark/tree/main/packages/remark-cli#example-config-files-json-yaml-js) +as `remark-cli`. + +This uses a plugin based system. Each plugin needs to be installed locally using `npm` or `yarn`. + +For example, given the following `.remarkrc.json`: + +```json +{ + "presets": [ + "remark-preset-lint-recommended" + ] +} +``` + +`remark-preset-lint-recommended` needs to be installed in the local project: + +```sh +npm install remark-preset-lint-recommended +``` + +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/rescriptls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/rescriptls.lua new file mode 100644 index 000000000..1c80ada14 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/rescriptls.lua @@ -0,0 +1,42 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = {}, + filetypes = { 'rescript' }, + root_dir = util.root_pattern('bsconfig.json', '.git'), + settings = {}, + }, + docs = { + description = [[ +https://github.com/rescript-lang/rescript-vscode + +ReScript language server + +**By default, rescriptls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. +You have to install the language server manually. + +You can use the bundled language server inside the [vim-rescript](https://github.com/rescript-lang/vim-rescript) repo. + +Clone the vim-rescript repo and point `cmd` to `server.js` inside `server/out` directory: + +```lua +cmd = {'node', '/server/out/server.js', '--stdio'} + +``` + +If you have vim-rescript installed you can also use that installation. for example if you're using packer.nvim you can set cmd to something like this: + +```lua +cmd = { + 'node', + '/home/username/.local/share/nvim/site/pack/packer/start/vim-rescript/server/out/server.js', + '--stdio' +} +``` + +Another option is to use vscode extension [release](https://github.com/rescript-lang/rescript-vscode/releases). +Take a look at [here](https://github.com/rescript-lang/rescript-vscode#use-with-other-editors) for instructions. +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/rls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/rls.lua new file mode 100644 index 000000000..363b81d2a --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/rls.lua @@ -0,0 +1,42 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'rls' }, + filetypes = { 'rust' }, + root_dir = util.root_pattern 'Cargo.toml', + }, + docs = { + description = [[ +https://github.com/rust-lang/rls + +rls, a language server for Rust + +See https://github.com/rust-lang/rls#setup to setup rls itself. +See https://github.com/rust-lang/rls#configuration for rls-specific settings. +All settings listed on the rls configuration section of the readme +must be set under settings.rust as follows: + +```lua +nvim_lsp.rls.setup { + settings = { + rust = { + unstable_features = true, + build_on_save = false, + all_features = true, + }, + }, +} +``` + +If you want to use rls for a particular build, eg nightly, set cmd as follows: + +```lua +cmd = {"rustup", "run", "nightly", "rls"} +``` + ]], + default_config = { + root_dir = [[root_pattern("Cargo.toml")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/rnix.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/rnix.lua new file mode 100644 index 000000000..aa7f00ed1 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/rnix.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'rnix-lsp' }, + filetypes = { 'nix' }, + root_dir = function(fname) + return util.find_git_ancestor(fname) or vim.loop.os_homedir() + end, + settings = {}, + init_options = {}, + }, + docs = { + description = [[ +https://github.com/nix-community/rnix-lsp + +A language server for Nix providing basic completion and formatting via nixpkgs-fmt. + +To install manually, run `cargo install rnix-lsp`. If you are using nix, rnix-lsp is in nixpkgs. + +This server accepts configuration via the `settings` key. + + ]], + default_config = { + root_dir = "vim's starting directory", + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/robotframework_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/robotframework_ls.lua new file mode 100644 index 000000000..7cb772b72 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/robotframework_ls.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'robotframework_ls' }, + filetypes = { 'robot' }, + root_dir = function(fname) + return util.root_pattern('robotidy.toml', 'pyproject.toml')(fname) or util.find_git_ancestor(fname) + end, + }, + docs = { + description = [[ +https://github.com/robocorp/robotframework-lsp + +Language Server Protocol implementation for Robot Framework. +]], + default_config = { + root_dir = "util.root_pattern('robotidy.toml', 'pyproject.toml')(fname) or util.find_git_ancestor(fname)", + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/rome.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/rome.lua new file mode 100644 index 000000000..1e426a7fe --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/rome.lua @@ -0,0 +1,42 @@ +local util = require 'lspconfig.util' + +local bin_name = 'rome' +local cmd = { bin_name, 'lsp-proxy' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, 'lsp-proxy' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { + 'javascript', + 'javascriptreact', + 'json', + 'typescript', + 'typescript.tsx', + 'typescriptreact', + }, + root_dir = function(fname) + return util.find_package_json_ancestor(fname) + or util.find_node_modules_ancestor(fname) + or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://rome.tools + +Language server for the Rome Frontend Toolchain. + +```sh +npm install [-g] rome +``` +]], + default_config = { + root_dir = [[root_pattern('package.json', 'node_modules', '.git')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ruby_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ruby_ls.lua new file mode 100644 index 000000000..ef4902564 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/ruby_ls.lua @@ -0,0 +1,48 @@ +local util = require 'lspconfig.util' + +local bin_name = 'ruby-lsp' + +-- defaults to stdio +local cmd = { bin_name } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'ruby' }, + root_dir = util.root_pattern('Gemfile', '.git'), + init_options = { + enabledFeatures = { + 'codeActions', + 'diagnostics', + 'documentHighlights', + 'documentSymbols', + 'formatting', + 'inlayHint', + }, + }, + }, + docs = { + description = [[ +https://shopify.github.io/ruby-lsp/ + +This gem is an implementation of the language server protocol specification for +Ruby, used to improve editor features. + +Install the gem. There's no need to require it, since the server is used as a +standalone executable. + +```sh +group :development do + gem "ruby-lsp", require: false +end +``` + ]], + default_config = { + root_dir = [[root_pattern("Gemfile", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/rust_analyzer.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/rust_analyzer.lua new file mode 100644 index 000000000..4e95ce873 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/rust_analyzer.lua @@ -0,0 +1,82 @@ +local util = require 'lspconfig.util' + +local function reload_workspace(bufnr) + bufnr = util.validate_bufnr(bufnr) + vim.lsp.buf_request(bufnr, 'rust-analyzer/reloadWorkspace', nil, function(err) + if err then + error(tostring(err)) + end + vim.notify 'Cargo workspace reloaded' + end) +end + +return { + default_config = { + cmd = { 'rust-analyzer' }, + filetypes = { 'rust' }, + root_dir = function(fname) + local cargo_crate_dir = util.root_pattern 'Cargo.toml'(fname) + local cmd = { 'cargo', 'metadata', '--no-deps', '--format-version', '1' } + if cargo_crate_dir ~= nil then + cmd[#cmd + 1] = '--manifest-path' + cmd[#cmd + 1] = util.path.join(cargo_crate_dir, 'Cargo.toml') + end + local cargo_metadata = '' + local cargo_metadata_err = '' + local cm = vim.fn.jobstart(cmd, { + on_stdout = function(_, d, _) + cargo_metadata = table.concat(d, '\n') + end, + on_stderr = function(_, d, _) + cargo_metadata_err = table.concat(d, '\n') + end, + stdout_buffered = true, + stderr_buffered = true, + }) + if cm > 0 then + cm = vim.fn.jobwait({ cm })[1] + else + cm = -1 + end + local cargo_workspace_dir = nil + if cm == 0 then + cargo_workspace_dir = vim.json.decode(cargo_metadata)['workspace_root'] + if cargo_workspace_dir ~= nil then + cargo_workspace_dir = util.path.sanitize(cargo_workspace_dir) + end + else + vim.notify( + string.format('[lspconfig] cmd (%q) failed:\n%s', table.concat(cmd, ' '), cargo_metadata_err), + vim.log.levels.WARN + ) + end + return cargo_workspace_dir + or cargo_crate_dir + or util.root_pattern 'rust-project.json'(fname) + or util.find_git_ancestor(fname) + end, + settings = { + ['rust-analyzer'] = {}, + }, + }, + commands = { + CargoReload = { + function() + reload_workspace(0) + end, + description = 'Reload current cargo workspace', + }, + }, + docs = { + description = [[ +https://github.com/rust-analyzer/rust-analyzer + +rust-analyzer (aka rls 2.0), a language server for Rust + +See [docs](https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/user#settings) for extra settings. + ]], + default_config = { + root_dir = [[root_pattern("Cargo.toml", "rust-project.json")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/salt_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/salt_ls.lua new file mode 100644 index 000000000..65d1d3223 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/salt_ls.lua @@ -0,0 +1,24 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'salt_lsp_server' }, + filetypes = { 'sls' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +Language server for Salt configuration files. +https://github.com/dcermak/salt-lsp + +The language server can be installed with `pip`: +```sh +pip install salt-lsp +``` + ]], + default_config = { + root_dir = [[root_pattern('.git')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/scheme_langserver.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/scheme_langserver.lua new file mode 100644 index 000000000..0eaaa289d --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/scheme_langserver.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' +local bin_name = 'scheme-langserver' +local cmd = { bin_name } +local root_files = { + 'Akku.manifest', + '.git', +} + +return { + default_config = { + cmd = cmd, + filetypes = { 'scheme' }, + root_dir = util.root_pattern(unpack(root_files)), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/ufo5260987423/scheme-langserver +`scheme-langserver`, a language server protocol implementation for scheme. +And for nvim user, please add .sls to scheme file extension list. +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/scry.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/scry.lua new file mode 100644 index 000000000..8350a439b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/scry.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'scry' }, + filetypes = { 'crystal' }, + root_dir = function(fname) + return util.root_pattern 'shard.yml'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/crystal-lang-tools/scry + +Crystal language server. +]], + default_config = { + root_dir = [[root_pattern('shard.yml', '.git')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/serve_d.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/serve_d.lua new file mode 100644 index 000000000..09d1b108c --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/serve_d.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'serve-d' }, + filetypes = { 'd' }, + root_dir = util.root_pattern('dub.json', 'dub.sdl', '.git'), + }, + docs = { + description = [[ + https://github.com/Pure-D/serve-d + + `Microsoft language server protocol implementation for D using workspace-d.` + Download a binary from https://github.com/Pure-D/serve-d/releases and put it in your $PATH. + ]], + default_config = { + root_dir = [[util.root_pattern("dub.json", "dub.sdl", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/sixtyfps.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/sixtyfps.lua new file mode 100644 index 000000000..da90fe309 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/sixtyfps.lua @@ -0,0 +1,28 @@ +return { + default_config = { + cmd = { 'sixtyfps-lsp' }, + filetypes = { 'sixtyfps' }, + single_file_support = true, + }, + docs = { + description = [=[ +https://github.com/sixtyfpsui/sixtyfps +`SixtyFPS`'s language server + +You can build and install `sixtyfps-lsp` binary with `cargo`: +```sh +cargo install sixtyfps-lsp +``` + +Vim does not have built-in syntax for the `sixtyfps` filetype currently. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.60 set filetype=sixtyfps ]] +``` + +or by installing a filetype plugin such as https://github.com/RustemB/sixtyfps-vim +]=], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/slint_lsp.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/slint_lsp.lua new file mode 100644 index 000000000..e921cb68e --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/slint_lsp.lua @@ -0,0 +1,26 @@ +return { + default_config = { + cmd = { 'slint-lsp' }, + filetypes = { 'slint' }, + single_file_support = true, + }, + docs = { + description = [=[ +https://github.com/slint-ui/slint +`Slint`'s language server + +You can build and install `slint-lsp` binary with `cargo`: +```sh +cargo install slint-lsp +``` + +Vim does not have built-in syntax for the `slint` filetype at this time. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.slint set filetype=slint ]] +``` +]=], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/smarty_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/smarty_ls.lua new file mode 100644 index 000000000..2a7c6ca9f --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/smarty_ls.lua @@ -0,0 +1,46 @@ +local util = require 'lspconfig.util' + +local bin_name = 'smarty-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'smarty' }, + root_dir = function(pattern) + local cwd = vim.loop.cwd() + local root = util.root_pattern('composer.json', '.git')(pattern) + + -- prefer cwd if root is a descendant + return util.path.is_descendant(cwd, root) and cwd or root + end, + settings = { + smarty = { + pluginDirs = {}, + }, + css = { + validate = true, + }, + }, + init_options = { + storageDir = nil, + }, + }, + docs = { + description = [[ +https://github.com/landeaux/vscode-smarty-langserver-extracted + +Language server for Smarty. + +`smarty-language-server` can be installed via `npm`: + +```sh +npm i -g vscode-smarty-langserver-extracted +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/solang.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/solang.lua new file mode 100644 index 000000000..be1d1ecab --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/solang.lua @@ -0,0 +1,27 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'solang', '--language-server', '--target', 'ewasm' }, + filetypes = { 'solidity' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +A language server for Solidity + +See the [documentation](https://solang.readthedocs.io/en/latest/installing.html) for installation instructions. + +The language server only provides the following capabilities: +* Syntax highlighting +* Diagnostics +* Hover + +There is currently no support for completion, goto definition, references, or other functionality. + +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/solargraph.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/solargraph.lua new file mode 100644 index 000000000..4fba4009c --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/solargraph.lua @@ -0,0 +1,38 @@ +local util = require 'lspconfig.util' + +local bin_name = 'solargraph' +local cmd = { bin_name, 'stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, 'stdio' } +end + +return { + default_config = { + cmd = cmd, + settings = { + solargraph = { + diagnostics = true, + }, + }, + init_options = { formatting = true }, + filetypes = { 'ruby' }, + root_dir = util.root_pattern('Gemfile', '.git'), + }, + docs = { + description = [[ +https://solargraph.org/ + +solargraph, a language server for Ruby + +You can install solargraph via gem install. + +```sh +gem install --user-install solargraph +``` + ]], + default_config = { + root_dir = [[root_pattern("Gemfile", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/solc.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/solc.lua new file mode 100644 index 000000000..9ae3948d2 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/solc.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'solc', '--lsp' }, + filetypes = { 'solidity' }, + root_dir = util.root_pattern('hardhat.config.*', '.git'), + }, + docs = { + description = [[ +https://docs.soliditylang.org/en/latest/installing-solidity.html + +solc is the native language server for the Solidity language. +]], + default_config = { + root_dir = [[root_pattern('hardhat.config.*', '.git')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/solidity.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/solidity.lua new file mode 100644 index 000000000..4e254bd94 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/solidity.lua @@ -0,0 +1,49 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'solidity-ls', '--stdio' }, + filetypes = { 'solidity' }, + root_dir = util.root_pattern('.git', 'package.json'), + settings = { solidity = { includePath = '', remapping = {} } }, + }, + docs = { + description = [[ +https://github.com/qiuxiang/solidity-ls + +npm i solidity-ls -g + +Make sure that solc is installed and it's the same version of the file. solc-select is recommended. + +Solidity language server is a LSP with autocomplete, go to definition and diagnostics. + +If you use brownie, use this root_dir: +root_dir = util.root_pattern('brownie-config.yaml', '.git') + +on includePath, you can add an extra path to search for external libs, on remapping you can remap lib <> path, like: + +```lua +{ solidity = { includePath = '/Users/your_user/.brownie/packages/', remapping = { ["@OpenZeppelin/"] = 'OpenZeppelin/openzeppelin-contracts@4.6.0/' } } } +``` + +**For brownie users** +Change the root_dir to: + +```lua +root_pattern("brownie-config.yaml", ".git") +``` + +The best way of using it is to have a package.json in your project folder with the packages that you will use. +After installing with package.json, just create a `remappings.txt` with: + +``` +@OpenZeppelin/=node_modules/OpenZeppelin/openzeppelin-contracts@4.6.0/ +``` + +You can omit the node_modules as well. +]], + default_config = { + root_dir = [[root_pattern("package.json", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/solidity_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/solidity_ls.lua new file mode 100644 index 000000000..4d4c4902d --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/solidity_ls.lua @@ -0,0 +1,24 @@ +local util = require 'lspconfig.util' + +local bin_name = 'solidity-language-server' +if vim.fn.has 'win32' == 1 then + bin_name = bin_name .. '.cmd' +end + +return { + default_config = { + cmd = { bin_name, '--stdio' }, + filetypes = { 'solidity' }, + root_dir = util.root_pattern('.git', 'package.json'), + }, + docs = { + description = [[ +npm install -g solidity-language-server + +solidity-language-server is a language server for the solidity language ported from the vscode solidity extension +]], + default_config = { + root_dir = [[root_pattern(".git", "package.json")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/sorbet.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/sorbet.lua new file mode 100644 index 000000000..86d344360 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/sorbet.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'srb', 'tc', '--lsp' }, + filetypes = { 'ruby' }, + root_dir = util.root_pattern('Gemfile', '.git'), + }, + docs = { + description = [[ +https://sorbet.org + +Sorbet is a fast, powerful type checker designed for Ruby. + +You can install Sorbet via gem install. You might also be interested in how to set +Sorbet up for new projects: https://sorbet.org/docs/adopting. + +```sh +gem install sorbet +``` + ]], + default_config = { + root_dir = [[root_pattern("Gemfile", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/sourcekit.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/sourcekit.lua new file mode 100644 index 000000000..d90b30aeb --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/sourcekit.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'sourcekit-lsp' }, + filetypes = { 'swift', 'c', 'cpp', 'objective-c', 'objective-cpp' }, + root_dir = util.root_pattern('Package.swift', '.git'), + }, + docs = { + description = [[ +https://github.com/apple/sourcekit-lsp + +Language server for Swift and C/C++/Objective-C. + ]], + default_config = { + root_dir = [[root_pattern("Package.swift", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/sourcery.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/sourcery.lua new file mode 100644 index 000000000..bde18a15d --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/sourcery.lua @@ -0,0 +1,83 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'pyproject.toml', + 'setup.py', + 'setup.cfg', + 'requirements.txt', + 'Pipfile', + 'pyrightconfig.json', +} + +local token_in_auth_file = function() + local is_windows = vim.fn.has 'win32' == 1 + local path_sep = is_windows and '\\' or '/' + + local config_home = is_windows and vim.fn.getenv 'APPDATA' or vim.fn.expand '~/.config' + local auth_file_path = config_home .. path_sep .. 'sourcery' .. path_sep .. 'auth.yaml' + + if vim.fn.filereadable(auth_file_path) == 1 then + local content = vim.fn.readfile(auth_file_path) + for _, line in ipairs(content) do + if line:match 'sourcery_token: (.+)' then + return true + end + end + end + + return false +end + +return { + default_config = { + cmd = { 'sourcery', 'lsp' }, + filetypes = { 'python' }, + init_options = { + editor_version = 'vim', + extension_version = 'vim.lsp', + token = nil, + }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + on_new_config = function(new_config, _) + if not new_config.init_options.token and not token_in_auth_file() then + local notify = vim.notify_once or vim.notify + notify( + '[lspconfig] The authentication token must be provided in config.init_options or configured via "sourcery login"', + vim.log.levels.ERROR + ) + end + end, + docs = { + description = [[ +https://github.com/sourcery-ai/sourcery + +Refactor Python instantly using the power of AI. + +It requires the init_options param to be populated as shown below and will respond with the list of ServerCapabilities that it supports: + +```lua +require'lspconfig'.sourcery.setup { + init_options = { + --- The Sourcery token for authenticating the user. + --- This is retrieved from the Sourcery website and must be + --- provided by each user. The extension must provide a + --- configuration option for the user to provide this value. + token = , + + --- The extension's name and version as defined by the extension. + extension_version = 'vim.lsp', + + --- The editor's name and version as defined by the editor. + editor_version = 'vim', + }, +} +``` + +Alternatively, you can login to sourcery by running `sourcery login` with sourcery-cli. +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/spectral.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/spectral.lua new file mode 100644 index 000000000..e21b6cb5b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/spectral.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +local bin_name = 'spectral-language-server' + +return { + default_config = { + cmd = { bin_name, '--stdio' }, + filetypes = { 'yaml', 'json', 'yml' }, + root_dir = util.root_pattern('.spectral.yaml', '.spectral.yml', '.spectral.json', '.spectral.js'), + single_file_support = true, + settings = { + enable = true, + run = 'onType', + validateLanguages = { 'yaml', 'json', 'yml' }, + }, + }, + docs = { + description = [[ +https://github.com/luizcorreia/spectral-language-server + `A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v2 & v3.` + +`spectral-language-server` can be installed via `npm`: +```sh +npm i -g spectral-language-server +``` +See [vscode-spectral](https://github.com/stoplightio/vscode-spectral#extension-settings) for configuration options. +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/sqlls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/sqlls.lua new file mode 100644 index 000000000..434a7ce8f --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/sqlls.lua @@ -0,0 +1,18 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'sql-language-server', 'up', '--method', 'stdio' }, + filetypes = { 'sql', 'mysql' }, + root_dir = util.root_pattern '.sqllsrc.json', + settings = {}, + }, + docs = { + description = [[ +https://github.com/joe-re/sql-language-server + +This LSP can be installed via `npm`. Find further instructions on manual installation of the sql-language-server at [joe-re/sql-language-server](https://github.com/joe-re/sql-language-server). +
+ ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/sqls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/sqls.lua new file mode 100644 index 000000000..268025392 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/sqls.lua @@ -0,0 +1,25 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'sqls' }, + filetypes = { 'sql', 'mysql' }, + root_dir = util.root_pattern 'config.yml', + single_file_support = true, + settings = {}, + }, + docs = { + description = [[ +https://github.com/lighttiger2505/sqls + +```lua +require'lspconfig'.sqls.setup{ + cmd = {"path/to/command", "-config", "path/to/config.yml"}; + ... +} +``` +Sqls can be installed via `go get github.com/lighttiger2505/sqls`. Instructions for compiling Sqls from the source can be found at [lighttiger2505/sqls](https://github.com/lighttiger2505/sqls). + + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/starlark-rust.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/starlark-rust.lua new file mode 100644 index 000000000..36b828f14 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/starlark-rust.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig/util' + +return { + default_config = { + cmd = { 'starlark', '--lsp' }, + filetypes = { 'star', 'bzl', 'BUILD.bazel' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/facebookexperimental/starlark-rust/ +The LSP part of `starlark-rust` is not currently documented, + but the implementation works well for linting. +This gives valuable warnings for potential issues in the code, +but does not support refactorings. + +It can be installed with cargo: https://crates.io/crates/starlark +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/steep.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/steep.lua new file mode 100644 index 000000000..367c78009 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/steep.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'steep', 'langserver' }, + filetypes = { 'ruby', 'eruby' }, + root_dir = util.root_pattern('Steepfile', '.git'), + }, + docs = { + description = [[ +https://github.com/soutaro/steep + +`steep` is a static type checker for Ruby. + +You need `Steepfile` to make it work. Generate it with `steep init`. +]], + default_config = { + root_dir = [[root_pattern("Steepfile", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/stylelint_lsp.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/stylelint_lsp.lua new file mode 100644 index 000000000..d471d2673 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/stylelint_lsp.lua @@ -0,0 +1,54 @@ +local util = require 'lspconfig.util' + +local bin_name = 'stylelint-lsp' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { + 'css', + 'less', + 'scss', + 'sugarss', + 'vue', + 'wxss', + 'javascript', + 'javascriptreact', + 'typescript', + 'typescriptreact', + }, + root_dir = util.root_pattern('.stylelintrc', 'package.json'), + settings = {}, + }, + docs = { + description = [[ +https://github.com/bmatcuk/stylelint-lsp + +`stylelint-lsp` can be installed via `npm`: + +```sh +npm i -g stylelint-lsp +``` + +Can be configured by passing a `settings.stylelintplus` object to `stylelint_lsp.setup`: + +```lua +require'lspconfig'.stylelint_lsp.setup{ + settings = { + stylelintplus = { + -- see available options in stylelint-lsp documentation + } + } +} +``` +]], + default_config = { + root_dir = [[ root_pattern('.stylelintrc', 'package.json') ]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/sumneko_lua.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/sumneko_lua.lua new file mode 100644 index 000000000..0f89bbd63 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/sumneko_lua.lua @@ -0,0 +1,91 @@ +local util = require 'lspconfig.util' + +local root_files = { + '.luarc.json', + '.luarc.jsonc', + '.luacheckrc', + '.stylua.toml', + 'stylua.toml', + 'selene.toml', + 'selene.yml', +} + +local bin_name = 'lua-language-server' +local cmd = { bin_name } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'lua' }, + root_dir = function(fname) + local root = util.root_pattern(unpack(root_files))(fname) + if root and root ~= vim.env.HOME then + return root + end + root = util.root_pattern 'lua/'(fname) + if root then + return root .. '/lua/' + end + return util.find_git_ancestor(fname) + end, + single_file_support = true, + log_level = vim.lsp.protocol.MessageType.Warning, + settings = { Lua = { telemetry = { enable = false } } }, + }, + docs = { + description = [[ +https://github.com/sumneko/lua-language-server + +Lua language server. + +`lua-language-server` can be installed by following the instructions [here](https://github.com/sumneko/lua-language-server/wiki/Getting-Started#command-line). + +The default `cmd` assumes that the `lua-language-server` binary can be found in `$PATH`. + +If you primarily use `lua-language-server` for Neovim, and want to provide completions, +analysis, and location handling for plugins on runtime path, you can use the following +settings. + +Note: that these settings will meaningfully increase the time until `lua-language-server` can service +initial requests (completion, location) upon starting as well as time to first diagnostics. +Completion results will include a workspace indexing progress message until the server has finished indexing. + +```lua +require'lspconfig'.sumneko_lua.setup { + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT', + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = {'vim'}, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = vim.api.nvim_get_runtime_file("", true), + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + }, + }, +} +``` + +See `lua-language-server`'s [documentation](https://github.com/sumneko/lua-language-server/blob/master/locale/en-us/setting.lua) for an explanation of the above fields: +* [Lua.runtime.path](https://github.com/sumneko/lua-language-server/blob/076dd3e5c4e03f9cef0c5757dfa09a010c0ec6bf/locale/en-us/setting.lua#L5-L13) +* [Lua.workspace.library](https://github.com/sumneko/lua-language-server/blob/076dd3e5c4e03f9cef0c5757dfa09a010c0ec6bf/locale/en-us/setting.lua#L77-L78) + +]], + default_config = { + root_dir = [[root_pattern(".luarc.json", ".luarc.jsonc", ".luacheckrc", ".stylua.toml", "stylua.toml", "selene.toml", "selene.yml", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/svelte.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/svelte.lua new file mode 100644 index 000000000..64ed468f4 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/svelte.lua @@ -0,0 +1,31 @@ +local util = require 'lspconfig.util' + +local bin_name = 'svelteserver' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'svelte' }, + root_dir = util.root_pattern('package.json', '.git'), + }, + docs = { + description = [[ +https://github.com/sveltejs/language-tools/tree/master/packages/language-server + +Note: assuming that [tsserver](#tsserver) is setup, full JavaScript/TypeScript support (find references, rename, etc of symbols in Svelte files when working in JS/TS files) requires per-project installation and configuration of [typescript-svelte-plugin](https://github.com/sveltejs/language-tools/tree/master/packages/typescript-plugin#usage). + +`svelte-language-server` can be installed via `npm`: +```sh +npm install -g svelte-language-server +``` +]], + default_config = { + root_dir = [[root_pattern("package.json", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/svlangserver.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/svlangserver.lua new file mode 100644 index 000000000..72eef65be --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/svlangserver.lua @@ -0,0 +1,65 @@ +local util = require 'lspconfig.util' + +local bin_name = 'svlangserver' +local cmd = { bin_name } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name } +end + +local function build_index() + local params = { + command = 'systemverilog.build_index', + } + vim.lsp.buf.execute_command(params) +end + +local function report_hierarchy() + local params = { + command = 'systemverilog.report_hierarchy', + arguments = { vim.fn.expand '' }, + } + vim.lsp.buf.execute_command(params) +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'verilog', 'systemverilog' }, + root_dir = function(fname) + return util.root_pattern '.svlangserver'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + settings = { + systemverilog = { + includeIndexing = { '*.{v,vh,sv,svh}', '**/*.{v,vh,sv,svh}' }, + }, + }, + }, + commands = { + SvlangserverBuildIndex = { + build_index, + description = 'Instructs language server to rerun indexing', + }, + SvlangserverReportHierarchy = { + report_hierarchy, + description = 'Generates hierarchy for the given module', + }, + }, + docs = { + description = [[ +https://github.com/imc-trading/svlangserver + +Language server for SystemVerilog. + +`svlangserver` can be installed via `npm`: + +```sh +$ npm install -g @imc-trading/svlangserver +``` +]], + default_config = { + root_dir = [[root_pattern(".svlangserver", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/svls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/svls.lua new file mode 100644 index 000000000..ff4d8102e --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/svls.lua @@ -0,0 +1,24 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'svls' }, + filetypes = { 'verilog', 'systemverilog' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/dalance/svls + +Language server for verilog and SystemVerilog + +`svls` can be installed via `cargo`: + ```sh + cargo install svls + ``` + ]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/syntax_tree.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/syntax_tree.lua new file mode 100644 index 000000000..13f8df899 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/syntax_tree.lua @@ -0,0 +1,37 @@ +local util = require 'lspconfig.util' + +local bin_name = 'stree' +local cmd = { bin_name, 'lsp' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, 'lsp' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'ruby' }, + root_dir = function(fname) + return util.root_pattern '.streerc'(fname) or util.root_pattern('Gemfile', '.git')(fname) + end, + }, + docs = { + description = [[ +https://ruby-syntax-tree.github.io/syntax_tree/ + +A fast Ruby parser and formatter. + +Syntax Tree is a suite of tools built on top of the internal CRuby parser. It +provides the ability to generate a syntax tree from source, as well as the +tools necessary to inspect and manipulate that syntax tree. It can be used to +build formatters, linters, language servers, and more. + +```sh +gem install syntax_tree +``` + ]], + default_config = { + root_dir = [[root_pattern(".streerc", "Gemfile", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/tailwindcss.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/tailwindcss.lua new file mode 100644 index 000000000..9247a1fdb --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/tailwindcss.lua @@ -0,0 +1,127 @@ +local util = require 'lspconfig.util' + +local bin_name = 'tailwindcss-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + -- filetypes copied and adjusted from tailwindcss-intellisense + filetypes = { + -- html + 'aspnetcorerazor', + 'astro', + 'astro-markdown', + 'blade', + 'django-html', + 'htmldjango', + 'edge', + 'eelixir', -- vim ft + 'elixir', + 'ejs', + 'erb', + 'eruby', -- vim ft + 'gohtml', + 'haml', + 'handlebars', + 'hbs', + 'html', + -- 'HTML (Eex)', + -- 'HTML (EEx)', + 'html-eex', + 'heex', + 'jade', + 'leaf', + 'liquid', + 'markdown', + 'mdx', + 'mustache', + 'njk', + 'nunjucks', + 'php', + 'razor', + 'slim', + 'twig', + -- css + 'css', + 'less', + 'postcss', + 'sass', + 'scss', + 'stylus', + 'sugarss', + -- js + 'javascript', + 'javascriptreact', + 'reason', + 'rescript', + 'typescript', + 'typescriptreact', + -- mixed + 'vue', + 'svelte', + }, + init_options = { + userLanguages = { + eelixir = 'html-eex', + eruby = 'erb', + }, + }, + settings = { + tailwindCSS = { + validate = true, + lint = { + cssConflict = 'warning', + invalidApply = 'error', + invalidScreen = 'error', + invalidVariant = 'error', + invalidConfigPath = 'error', + invalidTailwindDirective = 'error', + recommendedVariantOrder = 'warning', + }, + classAttributes = { + 'class', + 'className', + 'classList', + 'ngClass', + }, + }, + }, + on_new_config = function(new_config) + if not new_config.settings then + new_config.settings = {} + end + if not new_config.settings.editor then + new_config.settings.editor = {} + end + if not new_config.settings.editor.tabSize then + -- set tab size for hover + new_config.settings.editor.tabSize = vim.lsp.util.get_effective_tabstop() + end + end, + root_dir = function(fname) + return util.root_pattern('tailwind.config.js', 'tailwind.config.ts')(fname) + or util.root_pattern('postcss.config.js', 'postcss.config.ts')(fname) + or util.find_package_json_ancestor(fname) + or util.find_node_modules_ancestor(fname) + or util.find_git_ancestor(fname) + end, + }, + docs = { + description = [[ +https://github.com/tailwindlabs/tailwindcss-intellisense + +Tailwind CSS Language Server can be installed via npm: +```sh +npm install -g @tailwindcss/language-server +``` +]], + default_config = { + root_dir = [[root_pattern('tailwind.config.js', 'tailwind.config.ts', 'postcss.config.js', 'postcss.config.ts', 'package.json', 'node_modules', '.git')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/taplo.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/taplo.lua new file mode 100644 index 000000000..e1a935304 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/taplo.lua @@ -0,0 +1,27 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'taplo', 'lsp', 'stdio' }, + filetypes = { 'toml' }, + root_dir = function(fname) + return util.root_pattern '*.toml'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://taplo.tamasfe.dev/cli/usage/language-server.html + +Language server for Taplo, a TOML toolkit. + +`taplo-cli` can be installed via `cargo`: +```sh +cargo install --features lsp --locked taplo-cli +``` + ]], + default_config = { + root_dir = [[root_pattern("*.toml", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/tblgen_lsp_server.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/tblgen_lsp_server.lua new file mode 100644 index 000000000..73022d4a2 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/tblgen_lsp_server.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'tblgen-lsp-server' }, + filetypes = { 'tablegen' }, + root_dir = function(fname) + return util.root_pattern 'tablegen_compile_commands.yml'(fname) or util.find_git_ancestor(fname) + end, + }, + docs = { + description = [[ +https://mlir.llvm.org/docs/Tools/MLIRLSP/#tablegen-lsp-language-server--tblgen-lsp-server + +The Language Server for the LLVM TableGen language + +`tblgen-lsp-server` can be installed at the llvm-project repository (https://github.com/llvm/llvm-project) +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/teal_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/teal_ls.lua new file mode 100644 index 000000000..b554addab --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/teal_ls.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { + 'teal-language-server', + -- use this to enable logging in /tmp/teal-language-server.log + -- "logging=on", + }, + filetypes = { + 'teal', + -- "lua", -- Also works for lua, but you may get type errors that cannot be resolved within lua itself + }, + root_dir = util.root_pattern('tlconfig.lua', '.git'), + }, + docs = { + description = [[ +https://github.com/teal-language/teal-language-server + +Install with: +``` +luarocks install --dev teal-language-server +``` +]], + default_config = { + root_dir = [[root_pattern("tlconfig.lua", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/terraform_lsp.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/terraform_lsp.lua new file mode 100644 index 000000000..48a6fc587 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/terraform_lsp.lua @@ -0,0 +1,43 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'terraform-lsp' }, + filetypes = { 'terraform', 'hcl' }, + root_dir = util.root_pattern('.terraform', '.git'), + }, + docs = { + description = [[ +https://github.com/juliosueiras/terraform-lsp + +Terraform language server +Download a released binary from +https://github.com/juliosueiras/terraform-lsp/releases. + +From https://github.com/hashicorp/terraform-ls#terraform-ls-vs-terraform-lsp: + +Both HashiCorp and the maintainer of terraform-lsp expressed interest in +collaborating on a language server and are working towards a _long-term_ +goal of a single stable and feature-complete implementation. + +For the time being both projects continue to exist, giving users the +choice: + +- `terraform-ls` providing + - overall stability (by relying only on public APIs) + - compatibility with any provider and any Terraform >=0.12.0 currently + less features + - due to project being younger and relying on public APIs which may + not offer the same functionality yet + +- `terraform-lsp` providing + - currently more features + - compatibility with a single particular Terraform (0.12.20 at time of writing) + - configs designed for other 0.12 versions may work, but interpretation may be inaccurate + - less stability (due to reliance on Terraform's own internal packages) +]], + default_config = { + root_dir = [[root_pattern(".terraform", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/terraformls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/terraformls.lua new file mode 100644 index 000000000..3eb4a1c8b --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/terraformls.lua @@ -0,0 +1,42 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'terraform-ls', 'serve' }, + filetypes = { 'terraform' }, + root_dir = util.root_pattern('.terraform', '.git'), + }, + docs = { + description = [[ +https://github.com/hashicorp/terraform-ls + +Terraform language server +Download a released binary from https://github.com/hashicorp/terraform-ls/releases. + +From https://github.com/hashicorp/terraform-ls#terraform-ls-vs-terraform-lsp: + +Both HashiCorp and the maintainer of terraform-lsp expressed interest in +collaborating on a language server and are working towards a _long-term_ +goal of a single stable and feature-complete implementation. + +For the time being both projects continue to exist, giving users the +choice: + +- `terraform-ls` providing + - overall stability (by relying only on public APIs) + - compatibility with any provider and any Terraform >=0.12.0 currently + less features + - due to project being younger and relying on public APIs which may + not offer the same functionality yet + +- `terraform-lsp` providing + - currently more features + - compatibility with a single particular Terraform (0.12.20 at time of writing) + - configs designed for other 0.12 versions may work, but interpretation may be inaccurate + - less stability (due to reliance on Terraform's own internal packages) +]], + default_config = { + root_dir = [[root_pattern(".terraform", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/texlab.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/texlab.lua new file mode 100644 index 000000000..6eb9d99a7 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/texlab.lua @@ -0,0 +1,126 @@ +local util = require 'lspconfig.util' + +local texlab_build_status = vim.tbl_add_reverse_lookup { + Success = 0, + Error = 1, + Failure = 2, + Cancelled = 3, +} + +local texlab_forward_status = vim.tbl_add_reverse_lookup { + Success = 0, + Error = 1, + Failure = 2, + Unconfigured = 3, +} + +local function buf_build(bufnr) + bufnr = util.validate_bufnr(bufnr) + local texlab_client = util.get_active_client_by_name(bufnr, 'texlab') + local params = { + textDocument = { uri = vim.uri_from_bufnr(bufnr) }, + } + if texlab_client then + texlab_client.request('textDocument/build', params, function(err, result) + if err then + error(tostring(err)) + end + print('Build ' .. texlab_build_status[result.status]) + end, bufnr) + else + print 'method textDocument/build is not supported by any servers active on the current buffer' + end +end + +local function buf_search(bufnr) + bufnr = util.validate_bufnr(bufnr) + local texlab_client = util.get_active_client_by_name(bufnr, 'texlab') + local params = { + textDocument = { uri = vim.uri_from_bufnr(bufnr) }, + position = { line = vim.fn.line '.' - 1, character = vim.fn.col '.' }, + } + if texlab_client then + texlab_client.request('textDocument/forwardSearch', params, function(err, result) + if err then + error(tostring(err)) + end + print('Search ' .. texlab_forward_status[result.status]) + end, bufnr) + else + print 'method textDocument/forwardSearch is not supported by any servers active on the current buffer' + end +end + +-- bufnr isn't actually required here, but we need a valid buffer in order to +-- be able to find the client for buf_request. +-- TODO find a client by looking through buffers for a valid client? +-- local function build_cancel_all(bufnr) +-- bufnr = util.validate_bufnr(bufnr) +-- local params = { token = "texlab-build-*" } +-- lsp.buf_request(bufnr, 'window/progress/cancel', params, function(err, method, result, client_id) +-- if err then error(tostring(err)) end +-- print("Cancel result", vim.inspect(result)) +-- end) +-- end + +return { + default_config = { + cmd = { 'texlab' }, + filetypes = { 'tex', 'plaintex', 'bib' }, + root_dir = function(fname) + return util.root_pattern '.latexmkrc'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + settings = { + texlab = { + rootDirectory = nil, + build = { + executable = 'latexmk', + args = { '-pdf', '-interaction=nonstopmode', '-synctex=1', '%f' }, + onSave = false, + forwardSearchAfter = false, + }, + auxDirectory = '.', + forwardSearch = { + executable = nil, + args = {}, + }, + chktex = { + onOpenAndSave = false, + onEdit = false, + }, + diagnosticsDelay = 300, + latexFormatter = 'latexindent', + latexindent = { + ['local'] = nil, -- local is a reserved keyword + modifyLineBreaks = false, + }, + bibtexFormatter = 'texlab', + formatterLineLength = 80, + }, + }, + }, + commands = { + TexlabBuild = { + function() + buf_build(0) + end, + description = 'Build the current buffer', + }, + TexlabForward = { + function() + buf_search(0) + end, + description = 'Forward search from current position', + }, + }, + docs = { + description = [[ +https://github.com/latex-lsp/texlab + +A completion engine built from scratch for (La)TeX. + +See https://github.com/latex-lsp/texlab/wiki/Configuration for configuration options. +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/tflint.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/tflint.lua new file mode 100644 index 000000000..de2a1d8ce --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/tflint.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'tflint', '--langserver' }, + filetypes = { 'terraform' }, + root_dir = util.root_pattern('.terraform', '.git', '.tflint.hcl'), + }, + docs = { + description = [[ +https://github.com/terraform-linters/tflint + +A pluggable Terraform linter that can act as lsp server. +Installation instructions can be found in https://github.com/terraform-linters/tflint#installation. +]], + default_config = { + root_dir = [[root_pattern(".terraform", ".git", ".tflint.hcl")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/theme_check.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/theme_check.lua new file mode 100644 index 000000000..94d677408 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/theme_check.lua @@ -0,0 +1,31 @@ +local util = require 'lspconfig.util' + +local bin_name = 'theme-check-language-server' + +return { + default_config = { + cmd = { bin_name, '--stdio' }, + filetypes = { 'liquid' }, + root_dir = util.root_pattern '.theme-check.yml', + settings = {}, + }, + docs = { + description = [[ +https://github.com/Shopify/shopify-cli + +`theme-check-language-server` is bundled with `shopify-cli` or it can also be installed via + +https://github.com/Shopify/theme-check#installation + +**NOTE:** +If installed via Homebrew, `cmd` must be set to 'theme-check-liquid-server' + +```lua +require lspconfig.theme_check.setup { + cmd = { 'theme-check-liquid-server' } +} +``` + +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/tilt_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/tilt_ls.lua new file mode 100644 index 000000000..c6656513e --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/tilt_ls.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'tilt', 'lsp', 'start' }, + filetypes = { 'tiltfile' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/tilt-dev/tilt + +Tilt language server. + +You might need to add filetype detection manually: + +```vim +autocmd BufRead Tiltfile setf=tiltfile +``` +]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/tsserver.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/tsserver.lua new file mode 100644 index 000000000..efbb544b6 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/tsserver.lua @@ -0,0 +1,60 @@ +local util = require 'lspconfig.util' + +local bin_name = 'typescript-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + init_options = { hostInfo = 'neovim' }, + cmd = cmd, + filetypes = { + 'javascript', + 'javascriptreact', + 'javascript.jsx', + 'typescript', + 'typescriptreact', + 'typescript.tsx', + }, + root_dir = function(fname) + return util.root_pattern 'tsconfig.json'(fname) + or util.root_pattern('package.json', 'jsconfig.json', '.git')(fname) + end, + }, + docs = { + description = [[ +https://github.com/theia-ide/typescript-language-server + +`typescript-language-server` depends on `typescript`. Both packages can be installed via `npm`: +```sh +npm install -g typescript typescript-language-server +``` + +To configure typescript language server, add a +[`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or +[`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to the root of your +project. + +Here's an example that disables type checking in JavaScript files. + +```json +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "checkJs": false + }, + "exclude": [ + "node_modules" + ] +} +``` +]], + default_config = { + root_dir = [[root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/turtle_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/turtle_ls.lua new file mode 100644 index 000000000..0e58e9561 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/turtle_ls.lua @@ -0,0 +1,51 @@ +local util = require 'lspconfig.util' + +local bin_name = 'turtle-language-server' +local bin_path = os.getenv 'NVM_BIN' +local full_path +if bin_path == nil then + local paths = {} + local sep = ':' + if vim.fn.has 'win32' == 1 then + sep = ';' + end + local path = os.getenv 'PATH' + if path ~= nil then + for str in string.gmatch(path, '([^' .. sep .. ']+)') do + table.insert(paths, str) + end + end + for _, p in ipairs(paths) do + local candidate = util.path.join(p, bin_name) + if util.path.is_file(candidate) then + full_path = candidate + break + end + end +else + full_path = util.path.join(bin_path, bin_name) +end + +local cmd = { 'node', full_path, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', 'node', full_path, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'turtle', 'ttl' }, + root_dir = function(fname) + return util.find_git_ancestor(fname) + end, + }, + docs = { + description = [[ +https://github.com/stardog-union/stardog-language-servers/tree/master/packages/turtle-language-server +`turtle-language-server`, An editor-agnostic server providing language intelligence (diagnostics, hover tooltips, etc.) for the W3C standard Turtle RDF syntax via the Language Server Protocol. +installable via npm install -g turtle-language-server or yarn global add turtle-language-server. +requires node. +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/typeprof.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/typeprof.lua new file mode 100644 index 000000000..ab9dc8ef9 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/typeprof.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'typeprof', '--lsp', '--stdio' }, + filetypes = { 'ruby', 'eruby' }, + root_dir = util.root_pattern('Gemfile', '.git'), + }, + docs = { + description = [[ +https://github.com/ruby/typeprof + +`typeprof` is the built-in analysis and LSP tool for Ruby 3.1+. + ]], + default_config = { + root_dir = [[root_pattern("Gemfile", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/unison.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/unison.lua new file mode 100644 index 000000000..7cc655f70 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/unison.lua @@ -0,0 +1,17 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'nc', 'localhost', os.getenv 'UNISON_LSP_PORT' or '5757' }, + filetypes = { 'unison' }, + root_dir = util.root_pattern '*.u', + settings = {}, + }, + docs = { + description = [[ +https://github.com/unisonweb/unison/blob/trunk/docs/language-server.markdown + + + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/vala_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/vala_ls.lua new file mode 100644 index 000000000..842c561d4 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/vala_ls.lua @@ -0,0 +1,40 @@ +local util = require 'lspconfig.util' + +local meson_matcher = function(path) + local pattern = 'meson.build' + local f = vim.fn.glob(util.path.join(path, pattern)) + if f == '' then + return nil + end + for line in io.lines(f) do + -- skip meson comments + if not line:match '^%s*#.*' then + local str = line:gsub('%s+', '') + if str ~= '' then + if str:match '^project%(' then + return path + else + break + end + end + end + end +end + +return { + default_config = { + cmd = { 'vala-language-server' }, + filetypes = { 'vala', 'genie' }, + root_dir = function(fname) + local root = util.search_ancestors(fname, meson_matcher) + return root or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = 'https://github.com/Prince781/vala-language-server', + default_config = { + root_dir = [[root_pattern("meson.build", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/vdmj.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/vdmj.lua new file mode 100644 index 000000000..90dca2d87 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/vdmj.lua @@ -0,0 +1,134 @@ +local util = require 'lspconfig.util' + +local function get_default_mavenrepo() + local repo = util.path.join(vim.env.HOME, '.m2', 'repository', 'dk', 'au', 'ece', 'vdmj') + if util.path.exists(repo) then + return repo + else + return util.path.join(vim.env.HOME, '.m2', 'repository', 'com', 'fujitsu') + end +end + +local function get_jar_path(config, package, version) + return util.path.join(config.options.mavenrepo, package, version, package .. '-' .. version .. '.jar') +end + +local function with_precision(version, is_high_precision) + return is_high_precision and version:gsub('([%d.]+)', '%1-P') or version +end + +local function get_latest_installed_version(repo) + local path = util.path.join(repo, 'lsp') + local sort = vim.fn.sort + + local subdirs = function(file) + local stat = vim.loop.fs_stat(util.path.join(path, file)) + return stat.type == 'directory' and 1 or 0 + end + + local candidates = vim.fn.readdir(path, subdirs) + local sorted = sort(sort(candidates, 'l'), 'N') + return sorted[#sorted] +end + +-- Special case, as vdmj store particular settings under root_dir/.vscode +local function find_vscode_ancestor(startpath) + return util.search_ancestors(startpath, function(path) + if util.path.is_dir(util.path.join(path, '.vscode')) then + return path + end + end) +end + +return { + default_config = { + cmd = { 'java' }, + filetypes = { 'vdmsl', 'vdmpp', 'vdmrt' }, + root_dir = function(fname) + return util.find_git_ancestor(fname) or find_vscode_ancestor(fname) + end, + options = { + java = vim.env.JAVA_HOME and util.path.join(vim.env.JAVA_HOME, 'bin', 'java') or 'java', + java_opts = { '-Xmx3000m', '-Xss1m' }, + annotation_paths = {}, + mavenrepo = get_default_mavenrepo(), + logfile = util.path.join(vim.fn.stdpath 'cache', 'vdm-lsp.log'), + debugger_port = -1, + high_precision = false, + }, + }, + docs = { + description = [[ +https://github.com/nickbattle/vdmj + +The VDMJ language server can be installed by cloning the VDMJ repository and +running `mvn clean install`. + +Various options are provided to configure the language server (see below). In +particular: +- `annotation_paths` is a list of folders and/or jar file paths for annotations +that should be used with the language server; +- any value of `debugger_port` less than zero will disable the debugger; note +that if a non-zero value is used, only one instance of the server can be active +at a time. + +More settings for VDMJ can be changed in a file called `vdmj.properties` under +`root_dir/.vscode`. For a description of the available settings, see +[Section 7 of the VDMJ User Guide](https://raw.githubusercontent.com/nickbattle/vdmj/master/vdmj/documentation/UserGuide.pdf). + +Note: proof obligations and combinatorial testing are not currently supported +by neovim. +]], + default_config = { + cmd = 'Generated from the options given', + root_dir = 'util.find_git_ancestor(fname) or find_vscode_ancestor(fname)', + options = { + java = '$JAVA_HOME/bin/java', + java_opts = { '-Xmx3000m', '-Xss1m' }, + annotation_paths = {}, + mavenrepo = '$HOME/.m2/repository/dk/au/ece/vdmj', + version = 'The latest version installed in `mavenrepo`', + logfile = "path.join(vim.fn.stdpath 'cache', 'vdm-lsp.log')", + debugger_port = -1, + high_precision = false, + }, + }, + }, + on_new_config = function(config, root_dir) + local version = with_precision( + config.options.version or get_latest_installed_version(config.options.mavenrepo), + config.options.high_precision + ) + + local classpath = table.concat({ + get_jar_path(config, 'vdmj', version), + get_jar_path(config, 'annotations', version), + get_jar_path(config, 'lsp', version), + util.path.join(root_dir, '.vscode'), + unpack(config.options.annotation_paths), + }, ':') + + local java_cmd = { + config.options.java, + config.options.java_opts, + '-Dlsp.log.filename=' .. config.options.logfile, + '-cp', + classpath, + } + + local dap = {} + + if config.options.debugger_port >= 0 then + -- TODO: LS will fail to start if port is already in use + dap = { '-dap', tostring(config.options.debugger_port) } + end + + local vdmj_cmd = { + 'lsp.LSPServerStdio', + '-' .. vim.bo.filetype, + dap, + } + + config.cmd = vim.tbl_flatten { java_cmd, vdmj_cmd } + end, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/verible.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/verible.lua new file mode 100644 index 000000000..3c4823a87 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/verible.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'verible-verilog-ls' }, + filetypes = { 'systemverilog', 'verilog' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/chipsalliance/verible + +A linter and formatter for verilog and SystemVerilog files. + +Release binaries can be downloaded from [here](https://github.com/chipsalliance/verible/releases) +and placed in a directory on PATH. + +See https://github.com/chipsalliance/verible/tree/master/verilog/tools/ls/README.md for options. + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/veridian.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/veridian.lua new file mode 100644 index 000000000..231d0c056 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/veridian.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'veridian' }, + filetypes = { 'systemverilog', 'verilog' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/vivekmalneedi/veridian + +A SystemVerilog LanguageServer. + +Download the latest release for your OS from the releases page + +# install with slang feature, if C++17 compiler is available +cargo install --git https://github.com/vivekmalneedi/veridian.git --all-features +# install if C++17 compiler is not available +cargo install --git https://github.com/vivekmalneedi/veridian.git + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/vimls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/vimls.lua new file mode 100644 index 000000000..9b33d3a64 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/vimls.lua @@ -0,0 +1,41 @@ +local util = require 'lspconfig.util' + +local bin_name = 'vim-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'vim' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + init_options = { + isNeovim = true, + iskeyword = '@,48-57,_,192-255,-#', + vimruntime = '', + runtimepath = '', + diagnostic = { enable = true }, + indexes = { + runtimepath = true, + gap = 100, + count = 3, + projectRootPatterns = { 'runtime', 'nvim', '.git', 'autoload', 'plugin' }, + }, + suggest = { fromVimruntime = true, fromRuntimepath = true }, + }, + }, + docs = { + description = [[ +https://github.com/iamcco/vim-language-server + +You can install vim-language-server via npm: +```sh +npm install -g vim-language-server +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/visualforce_ls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/visualforce_ls.lua new file mode 100644 index 000000000..c48bcaa2d --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/visualforce_ls.lua @@ -0,0 +1,38 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'visualforce' }, + root_dir = util.root_pattern 'sfdx-project.json', + init_options = { + embeddedLanguages = { + css = true, + javascript = true, + }, + }, + }, + docs = { + description = [[ +https://github.com/forcedotcom/salesforcedx-vscode + +Language server for Visualforce. + +For manual installation, download the .vsix archive file from the +[forcedotcom/salesforcedx-vscode](https://github.com/forcedotcom/salesforcedx-vscode) +GitHub releases. Then, configure `cmd` to run the Node script at the unpacked location: + +```lua +require'lspconfig'.visualforce_ls.setup { + cmd = { + 'node', + '/path/to/unpacked/archive/extension/node_modules/@salesforce/salesforcedx-visualforce-language-server/out/src/visualforceServer.js', + '--stdio' + } +} +``` +]], + default_config = { + root_dir = [[root_pattern('sfdx-project.json')]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/vls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/vls.lua new file mode 100644 index 000000000..9400648cb --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/vls.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'v', 'ls' }, + filetypes = { 'vlang' }, + root_dir = util.root_pattern('v.mod', '.git'), + }, + docs = { + description = [[ +https://github.com/vlang/vls + +V language server. + +`v-language-server` can be installed by following the instructions [here](https://github.com/vlang/vls#installation). +``` +]], + default_config = { + root_dir = [[root_pattern("v.mod", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/volar.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/volar.lua new file mode 100644 index 000000000..a7f38ade8 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/volar.lua @@ -0,0 +1,148 @@ +local util = require 'lspconfig.util' + +local function get_typescript_server_path(root_dir) + local project_root = util.find_node_modules_ancestor(root_dir) + return project_root and (util.path.join(project_root, 'node_modules', 'typescript', 'lib')) or '' +end + +-- https://github.com/johnsoncodehk/volar/blob/20d713b/packages/shared/src/types.ts +local volar_init_options = { + typescript = { + tsdk = '', + }, + languageFeatures = { + implementation = true, + -- not supported - https://github.com/neovim/neovim/pull/14122 + semanticTokens = false, + references = true, + definition = true, + typeDefinition = true, + callHierarchy = true, + hover = true, + rename = true, + renameFileRefactoring = true, + signatureHelp = true, + codeAction = true, + completion = { + defaultTagNameCase = 'both', + defaultAttrNameCase = 'kebabCase', + }, + schemaRequestService = true, + documentHighlight = true, + documentLink = true, + codeLens = true, + diagnostics = true, + }, + documentFeatures = { + -- not supported - https://github.com/neovim/neovim/pull/13654 + documentColor = false, + selectionRange = true, + foldingRange = true, + linkedEditingRange = true, + documentSymbol = true, + documentFormatting = { + defaultPrintWidth = 100, + }, + }, +} + +local bin_name = 'vue-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end +return { + default_config = { + cmd = cmd, + filetypes = { 'vue' }, + root_dir = util.root_pattern 'package.json', + init_options = volar_init_options, + on_new_config = function(new_config, new_root_dir) + if + new_config.init_options + and new_config.init_options.typescript + and new_config.init_options.typescript.tsdk == '' + then + new_config.init_options.typescript.tsdk = get_typescript_server_path(new_root_dir) + end + end, + }, + docs = { + description = [[ +https://github.com/johnsoncodehk/volar/tree/20d713b/packages/vue-language-server + +Volar language server for Vue + +Volar can be installed via npm: + +```sh +npm install -g @volar/vue-language-server +``` + +Volar by default supports Vue 3 projects. Vue 2 projects need +[additional configuration](https://github.com/johnsoncodehk/volar/blob/master/extensions/vscode-vue-language-features/README.md?plain=1#L28-L63). + +**Take Over Mode** + +Volar can serve as a language server for both Vue and TypeScript via [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471). + +To enable Take Over Mode, override the default filetypes in `setup{}` as follows: + +```lua +require'lspconfig'.volar.setup{ + filetypes = {'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue', 'json'} +} +``` + +**Overriding the default TypeScript Server used by Volar** + +The default config looks for TS in the local `node_modules`. This can lead to issues +e.g. when working on a [monorepo](https://monorepo.tools/). The alternatives are: + +- use a global TypeScript Server installation + +```lua +require'lspconfig'.volar.setup{ + init_options = { + typescript = { + tsdk = '/path/to/.npm/lib/node_modules/typescript/lib' + -- Alternative location if installed as root: + -- tsdk = '/usr/local/lib/node_modules/typescript/lib' + } + } +} +``` + +- use a local server and fall back to a global TypeScript Server installation + +```lua +local util = require 'lspconfig.util' +local function get_typescript_server_path(root_dir) + + local global_ts = '/home/[yourusernamehere]/.npm/lib/node_modules/typescript/lib' + -- Alternative location if installed as root: + -- local global_ts = '/usr/local/lib/node_modules/typescript/lib' + local found_ts = '' + local function check_dir(path) + found_ts = util.path.join(path, 'node_modules', 'typescript', 'lib') + if util.path.exists(found_ts) then + return path + end + end + if util.search_ancestors(root_dir, check_dir) then + return found_ts + else + return global_ts + end +end + +require'lspconfig'.volar.setup{ + on_new_config = function(new_config, new_root_dir) + new_config.init_options.typescript.tsdk = get_typescript_server_path(new_root_dir) + end, +} +``` + ]], + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/vuels.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/vuels.lua new file mode 100644 index 000000000..d3d2d92e6 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/vuels.lua @@ -0,0 +1,68 @@ +local util = require 'lspconfig.util' + +local bin_name = 'vls' +local cmd = { bin_name } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'vue' }, + root_dir = util.root_pattern('package.json', 'vue.config.js'), + init_options = { + config = { + vetur = { + useWorkspaceDependencies = false, + validation = { + template = true, + style = true, + script = true, + }, + completion = { + autoImport = false, + useScaffoldSnippets = false, + tagCasing = 'kebab', + }, + format = { + defaultFormatter = { + js = 'none', + ts = 'none', + }, + defaultFormatterOptions = {}, + scriptInitialIndent = false, + styleInitialIndent = false, + }, + }, + css = {}, + html = { + suggest = {}, + }, + javascript = { + format = {}, + }, + typescript = { + format = {}, + }, + emmet = {}, + stylusSupremacy = {}, + }, + }, + }, + docs = { + description = [[ +https://github.com/vuejs/vetur/tree/master/server + +Vue language server(vls) +`vue-language-server` can be installed via `npm`: +```sh +npm install -g vls +``` +]], + default_config = { + root_dir = [[root_pattern("package.json", "vue.config.js")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/wgsl_analyzer.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/wgsl_analyzer.lua new file mode 100644 index 000000000..859373eae --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/wgsl_analyzer.lua @@ -0,0 +1,30 @@ +local util = require 'lspconfig.util' + +local bin_name = 'wgsl_analyzer' +local cmd = { bin_name } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'wgsl' }, + root_dir = util.root_pattern '.git', + settings = {}, + }, + docs = { + description = [[ +https://github.com/wgsl-analyzer/wgsl-analyzer + +`wgsl_analyzer` can be installed via `cargo`: +```sh +cargo install --git https://github.com/wgsl-analyzer/wgsl-analyzer wgsl_analyzer +``` +]], + default_config = { + root_dir = [[root_pattern(".git"]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/yamlls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/yamlls.lua new file mode 100644 index 000000000..52d8e6f6d --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/yamlls.lua @@ -0,0 +1,87 @@ +local util = require 'lspconfig.util' + +local bin_name = 'yaml-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'yaml', 'yaml.docker-compose' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + settings = { + -- https://github.com/redhat-developer/vscode-redhat-telemetry#how-to-disable-telemetry-reporting + redhat = { telemetry = { enabled = false } }, + }, + }, + docs = { + description = [[ +https://github.com/redhat-developer/yaml-language-server + +`yaml-language-server` can be installed via `yarn`: +```sh +yarn global add yaml-language-server +``` + +To use a schema for validation, there are two options: + +1. Add a modeline to the file. A modeline is a comment of the form: + +``` +# yaml-language-server: $schema= +``` + +where the relative filepath is the path relative to the open yaml file, and the absolute filepath +is the filepath relative to the filesystem root ('/' on unix systems) + +2. Associated a schema url, relative , or absolute (to root of project, not to filesystem root) path to +the a glob pattern relative to the detected project root. Check `:LspInfo` to determine the resolved project +root. + +```lua +require('lspconfig').yamlls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + ... -- other settings. note this overrides the lspconfig defaults. + schemas = { + ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*" + ["../path/relative/to/file.yml"] = "/.github/workflows/*" + ["/path/from/root/of/project"] = "/.github/workflows/*" + }, + }, + } +} +``` + +Currently, kubernetes is special-cased in yammls, see the following upstream issues: +* [#211](https://github.com/redhat-developer/yaml-language-server/issues/211). +* [#307](https://github.com/redhat-developer/yaml-language-server/issues/307). + +To override a schema to use a specific k8s schema version (for example, to use 1.18): + +```lua +require('lspconfig').yamlls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + ... -- other settings. note this overrides the lspconfig defaults. + schemas = { + ["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.18.0-standalone-strict/all.json"] = "/*.k8s.yaml", + ... -- other schemas + }, + }, + } +} +``` + +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/zk.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/zk.lua new file mode 100644 index 000000000..e670f8340 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/zk.lua @@ -0,0 +1,48 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'zk', 'lsp' }, + filetypes = { 'markdown' }, + root_dir = util.root_pattern '.zk', + }, + commands = { + ZkIndex = { + function() + vim.lsp.buf.execute_command { + command = 'zk.index', + arguments = { vim.api.nvim_buf_get_name(0) }, + } + end, + description = 'Index', + }, + ZkNew = { + function(...) + vim.lsp.buf_request(0, 'workspace/executeCommand', { + command = 'zk.new', + arguments = { + vim.api.nvim_buf_get_name(0), + ..., + }, + }, function(_, result, _, _) + if not (result and result.path) then + return + end + vim.cmd('edit ' .. result.path) + end) + end, + + description = 'ZkNew', + }, + }, + docs = { + description = [[ +https://github.com/mickael-menu/zk + +A plain text note-taking assistant +]], + default_config = { + root_dir = [[root_pattern(".zk")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/zls.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/zls.lua new file mode 100644 index 000000000..d890fb63a --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/server_configurations/zls.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'zls' }, + filetypes = { 'zig', 'zir' }, + root_dir = util.root_pattern('zls.json', '.git'), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/zigtools/zls + +Zig LSP implementation + Zig Language Server + ]], + default_config = { + root_dir = [[util.root_pattern("zls.json", ".git")]], + }, + }, +} diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/ui/lspinfo.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/ui/lspinfo.lua new file mode 100644 index 000000000..942d65bcb --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/ui/lspinfo.lua @@ -0,0 +1,309 @@ +local api, fn, lsp = vim.api, vim.fn, vim.lsp +local windows = require 'lspconfig.ui.windows' +local util = require 'lspconfig.util' + +local error_messages = { + cmd_not_found = 'Unable to find executable. Please check your path and ensure the server is installed', + no_filetype_defined = 'No filetypes defined, Please define filetypes in setup()', + root_dir_not_found = 'Not found.', +} + +local helptags = { + [error_messages.no_filetype_defined] = { 'lspconfig-setup' }, + [error_messages.root_dir_not_found] = { 'lspconfig-root-detection' }, +} + +local function trim_blankspace(cmd) + local trimmed_cmd = {} + for _, str in pairs(cmd) do + table.insert(trimmed_cmd, str:match '^%s*(.*)') + end + return trimmed_cmd +end + +local function indent_lines(lines, offset) + return vim.tbl_map(function(val) + return offset .. val + end, lines) +end + +local function remove_newlines(cmd) + cmd = trim_blankspace(cmd) + cmd = table.concat(cmd, ' ') + cmd = vim.split(cmd, '\n') + cmd = trim_blankspace(cmd) + cmd = table.concat(cmd, ' ') + return cmd +end + +local cmd_type = { + ['function'] = function(_) + return '', 'NA' + end, + ['table'] = function(config) + local cmd = remove_newlines(config.cmd) + if vim.fn.executable(config.cmd[1]) == 1 then + return cmd, 'true' + end + return cmd, error_messages.cmd_not_found + end, +} + +local function make_config_info(config, bufnr) + local config_info = {} + config_info.name = config.name + config_info.helptags = {} + + if config.cmd then + config_info.cmd, config_info.cmd_is_executable = cmd_type[type(config.cmd)](config) + else + config_info.cmd = 'cmd not defined' + config_info.cmd_is_executable = 'NA' + end + + local buffer_dir = api.nvim_buf_call(bufnr, function() + return vim.fn.expand '%:p:h' + end) + local root_dir = config.get_root_dir and config.get_root_dir(buffer_dir) + if root_dir then + config_info.root_dir = root_dir + else + config_info.root_dir = error_messages.root_dir_not_found + vim.list_extend(config_info.helptags, helptags[error_messages.root_dir_not_found]) + end + + config_info.autostart = (config.autostart and 'true') or 'false' + config_info.handlers = table.concat(vim.tbl_keys(config.handlers), ', ') + config_info.filetypes = table.concat(config.filetypes or {}, ', ') + + local lines = { + 'Config: ' .. config_info.name, + } + + local info_lines = { + 'filetypes: ' .. config_info.filetypes, + 'root directory: ' .. config_info.root_dir, + 'cmd: ' .. config_info.cmd, + 'cmd is executable: ' .. config_info.cmd_is_executable, + 'autostart: ' .. config_info.autostart, + 'custom handlers: ' .. config_info.handlers, + } + + if vim.tbl_count(config_info.helptags) > 0 then + local help = vim.tbl_map(function(helptag) + return string.format(':h %s', helptag) + end, config_info.helptags) + info_lines = vim.list_extend({ + 'Refer to ' .. table.concat(help, ', ') .. ' for help.', + }, info_lines) + end + + vim.list_extend(lines, indent_lines(info_lines, '\t')) + + return lines +end + +---@param client table +---@param fname string +local function make_client_info(client, fname) + local client_info = {} + + client_info.cmd = cmd_type[type(client.config.cmd)](client.config) + local workspace_folders = fn.has 'nvim-0.9' == 1 and client.workspace_folders or client.workspaceFolders + local uv = vim.loop + local is_windows = uv.os_uname().version:match 'Windows' + fname = vim.fn.fnamemodify(vim.fn.resolve(fname), ':p') + local sep = is_windows and '\\' or '/' + local fname_parts = vim.split(fname, sep, { trimempty = true }) + if workspace_folders then + for _, schema in pairs(workspace_folders) do + local matched = true + local root = uv.fs_realpath(schema.name) + local root_parts = vim.split(root, sep, { trimempty = true }) + + for i = 1, #root_parts do + if root_parts[i] ~= fname_parts[i] then + matched = false + break + end + end + + if matched then + client_info.root_dir = schema.name + break + end + end + end + + if not client_info.root_dir then + client_info.root_dir = 'Running in single file mode.' + end + client_info.filetypes = table.concat(client.config.filetypes or {}, ', ') + client_info.autostart = (client.config.autostart and 'true') or 'false' + client_info.attached_buffers_list = table.concat(vim.lsp.get_buffers_by_client_id(client.id), ', ') + + local lines = { + '', + 'Client: ' + .. client.name + .. ' (id: ' + .. tostring(client.id) + .. ', bufnr: [' + .. client_info.attached_buffers_list + .. '])', + } + + local info_lines = { + 'filetypes: ' .. client_info.filetypes, + 'autostart: ' .. client_info.autostart, + 'root directory: ' .. client_info.root_dir, + 'cmd: ' .. client_info.cmd, + } + + if client.config.lspinfo then + local server_specific_info = client.config.lspinfo(client.config) + info_lines = vim.list_extend(info_lines, server_specific_info) + end + + vim.list_extend(lines, indent_lines(info_lines, '\t')) + + return lines +end + +return function() + -- These options need to be cached before switching to the floating + -- buffer. + local original_bufnr = api.nvim_get_current_buf() + local buf_clients = lsp.get_active_clients { bufnr = original_bufnr } + local clients = lsp.get_active_clients() + local buffer_filetype = vim.bo.filetype + local fname = api.nvim_buf_get_name(original_bufnr) + + windows.default_options.wrap = true + windows.default_options.breakindent = true + windows.default_options.breakindentopt = 'shift:25' + windows.default_options.showbreak = 'NONE' + + local win_info = windows.percentage_range_window(0.8, 0.7) + local bufnr, win_id = win_info.bufnr, win_info.win_id + + local buf_lines = {} + + local buf_client_ids = {} + for _, client in pairs(buf_clients) do + table.insert(buf_client_ids, client.id) + end + + local other_active_clients = {} + for _, client in pairs(clients) do + if not vim.tbl_contains(buf_client_ids, client.id) then + table.insert(other_active_clients, client) + end + end + + -- insert the tips at the top of window + table.insert(buf_lines, 'Use [q] or [Esc] to quit the window') + + local header = { + '', + 'Language client log: ' .. (vim.lsp.get_log_path()), + 'Detected filetype: ' .. buffer_filetype, + } + vim.list_extend(buf_lines, header) + + local buffer_clients_header = { + '', + tostring(#vim.tbl_keys(buf_clients)) .. ' client(s) attached to this buffer: ', + } + + vim.list_extend(buf_lines, buffer_clients_header) + for _, client in pairs(buf_clients) do + local client_info = make_client_info(client, fname) + vim.list_extend(buf_lines, client_info) + end + + local other_active_section_header = { + '', + tostring(#other_active_clients) .. ' active client(s) not attached to this buffer: ', + } + if not vim.tbl_isempty(other_active_clients) then + vim.list_extend(buf_lines, other_active_section_header) + end + for _, client in pairs(other_active_clients) do + local client_info = make_client_info(client, fname) + vim.list_extend(buf_lines, client_info) + end + + local other_matching_configs_header = { + '', + 'Other clients that match the filetype: ' .. buffer_filetype, + '', + } + + local other_matching_configs = util.get_other_matching_providers(buffer_filetype) + + if not vim.tbl_isempty(other_matching_configs) then + vim.list_extend(buf_lines, other_matching_configs_header) + for _, config in pairs(other_matching_configs) do + vim.list_extend(buf_lines, make_config_info(config, original_bufnr)) + end + end + + local matching_config_header = { + '', + 'Configured servers list: ' .. table.concat(util.available_servers(), ', '), + } + + vim.list_extend(buf_lines, matching_config_header) + + local fmt_buf_lines = indent_lines(buf_lines, ' ') + + fmt_buf_lines = vim.lsp.util._trim(fmt_buf_lines, {}) + + api.nvim_buf_set_lines(bufnr, 0, -1, true, fmt_buf_lines) + api.nvim_buf_set_option(bufnr, 'modifiable', false) + api.nvim_buf_set_option(bufnr, 'filetype', 'lspinfo') + + local augroup = api.nvim_create_augroup('lspinfo', { clear = false }) + + local function close() + api.nvim_clear_autocmds { group = augroup, buffer = bufnr } + if api.nvim_buf_is_valid(bufnr) then + api.nvim_buf_delete(bufnr, { force = true }) + end + if api.nvim_win_is_valid(win_id) then + api.nvim_win_close(win_id, true) + end + end + + vim.keymap.set('n', '', close, { buffer = bufnr, nowait = true }) + vim.keymap.set('n', 'q', close, { buffer = bufnr, nowait = true }) + api.nvim_create_autocmd({ 'BufDelete', 'BufLeave', 'BufHidden' }, { + once = true, + buffer = bufnr, + callback = close, + group = augroup, + }) + + vim.fn.matchadd( + 'Error', + error_messages.no_filetype_defined + .. '.\\|' + .. 'cmd not defined\\|' + .. error_messages.cmd_not_found + .. '\\|' + .. error_messages.root_dir_not_found + ) + + vim.cmd [[ + syn keyword String true + syn keyword Error false + syn match LspInfoFiletypeList /\ 0) + height_percentage = row_range + row_start_percentage = (1 - height_percentage) / 3 + elseif type(row_range) == 'table' then + height_percentage = row_range[2] - row_range[1] + row_start_percentage = row_range[1] + else + error(string.format("Invalid type for 'row_range': %p", row_range)) + end + + win_opts.height = math.ceil(vim.o.lines * height_percentage) + win_opts.row = math.ceil(vim.o.lines * row_start_percentage) + win_opts.border = options.border or 'none' + + local width_percentage, col_start_percentage + if type(col_range) == 'number' then + assert(col_range <= 1) + assert(col_range > 0) + width_percentage = col_range + col_start_percentage = (1 - width_percentage) / 2 + elseif type(col_range) == 'table' then + width_percentage = col_range[2] - col_range[1] + col_start_percentage = col_range[1] + else + error(string.format("Invalid type for 'col_range': %p", col_range)) + end + + win_opts.col = math.floor(vim.o.columns * col_start_percentage) + win_opts.width = math.floor(vim.o.columns * width_percentage) + + local bufnr = options.bufnr or api.nvim_create_buf(false, true) + local win_id = api.nvim_open_win(bufnr, true, win_opts) + api.nvim_win_set_option(win_id, 'winhl', 'FloatBorder:LspInfoBorder') + + for k, v in pairs(win_float.default_options) do + if k ~= 'border' then + vim.opt_local[k] = v + end + end + + api.nvim_win_set_buf(win_id, bufnr) + + api.nvim_win_set_option(win_id, 'cursorcolumn', false) + api.nvim_buf_set_option(bufnr, 'tabstop', 2) + api.nvim_buf_set_option(bufnr, 'shiftwidth', 2) + + return { + bufnr = bufnr, + win_id = win_id, + } +end + +return win_float diff --git a/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/util.lua b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/util.lua new file mode 100644 index 000000000..b38b8ec62 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/lua/lspconfig/util.lua @@ -0,0 +1,495 @@ +local vim = vim +local validate = vim.validate +local api = vim.api +local lsp = vim.lsp +local uv = vim.loop + +local M = {} + +M.default_config = { + log_level = lsp.protocol.MessageType.Warning, + message_level = lsp.protocol.MessageType.Warning, + settings = vim.empty_dict(), + init_options = vim.empty_dict(), + handlers = {}, + autostart = true, + capabilities = lsp.protocol.make_client_capabilities(), +} + +-- global on_setup hook +M.on_setup = nil + +function M.bufname_valid(bufname) + if bufname:match '^/' or bufname:match '^[a-zA-Z]:' or bufname:match '^zipfile://' or bufname:match '^tarfile:' then + return true + end + return false +end + +function M.validate_bufnr(bufnr) + validate { + bufnr = { bufnr, 'n' }, + } + return bufnr == 0 and api.nvim_get_current_buf() or bufnr +end + +function M.add_hook_before(func, new_fn) + if func then + return function(...) + -- TODO which result? + new_fn(...) + return func(...) + end + else + return new_fn + end +end + +function M.add_hook_after(func, new_fn) + if func then + return function(...) + -- TODO which result? + func(...) + return new_fn(...) + end + else + return new_fn + end +end + +-- Maps lspconfig-style command options to nvim_create_user_command (i.e. |command-attributes|) option names. +local opts_aliases = { + ['description'] = 'desc', +} + +---@param command_definition table +function M._parse_user_command_options(command_definition) + ---@type table + local opts = {} + for k, v in pairs(command_definition) do + if type(k) == 'string' then + local attribute = k.gsub(k, '^%-+', '') + opts[opts_aliases[attribute] or attribute] = v + elseif type(k) == 'number' and type(v) == 'string' and v:match '^%-' then + -- Splits strings like "-nargs=* -complete=customlist,v:lua.something" into { "-nargs=*", "-complete=customlist,v:lua.something" } + for _, command_attribute in ipairs(vim.split(v, '%s')) do + -- Splits attribute into a key-value pair, like "-nargs=*" to { "-nargs", "*" } + local attribute, value = unpack(vim.split(command_attribute, '=', { plain = true })) + attribute = attribute.gsub(attribute, '^%-+', '') + opts[opts_aliases[attribute] or attribute] = value or true + end + end + end + return opts +end + +function M.create_module_commands(module_name, commands) + for command_name, def in pairs(commands) do + local opts = M._parse_user_command_options(def) + api.nvim_create_user_command(command_name, function(info) + require('lspconfig')[module_name].commands[command_name][1](unpack(info.fargs)) + end, opts) + end +end + +-- Some path utilities +M.path = (function() + local is_windows = uv.os_uname().version:match 'Windows' + + local function escape_wildcards(path) + return path:gsub('([%[%]%?%*])', '\\%1') + end + + local function sanitize(path) + if is_windows then + path = path:sub(1, 1):upper() .. path:sub(2) + path = path:gsub('\\', '/') + end + return path + end + + local function exists(filename) + local stat = uv.fs_stat(filename) + return stat and stat.type or false + end + + local function is_dir(filename) + return exists(filename) == 'directory' + end + + local function is_file(filename) + return exists(filename) == 'file' + end + + local function is_fs_root(path) + if is_windows then + return path:match '^%a:$' + else + return path == '/' + end + end + + local function is_absolute(filename) + if is_windows then + return filename:match '^%a:' or filename:match '^\\\\' + else + return filename:match '^/' + end + end + + local function dirname(path) + local strip_dir_pat = '/([^/]+)$' + local strip_sep_pat = '/$' + if not path or #path == 0 then + return + end + local result = path:gsub(strip_sep_pat, ''):gsub(strip_dir_pat, '') + if #result == 0 then + if is_windows then + return path:sub(1, 2):upper() + else + return '/' + end + end + return result + end + + local function path_join(...) + return table.concat(vim.tbl_flatten { ... }, '/') + end + + -- Traverse the path calling cb along the way. + local function traverse_parents(path, cb) + path = uv.fs_realpath(path) + local dir = path + -- Just in case our algo is buggy, don't infinite loop. + for _ = 1, 100 do + dir = dirname(dir) + if not dir then + return + end + -- If we can't ascend further, then stop looking. + if cb(dir, path) then + return dir, path + end + if is_fs_root(dir) then + break + end + end + end + + -- Iterate the path until we find the rootdir. + local function iterate_parents(path) + local function it(_, v) + if v and not is_fs_root(v) then + v = dirname(v) + else + return + end + if v and uv.fs_realpath(v) then + return v, path + else + return + end + end + return it, path, path + end + + local function is_descendant(root, path) + if not path then + return false + end + + local function cb(dir, _) + return dir == root + end + + local dir, _ = traverse_parents(path, cb) + + return dir == root + end + + local path_separator = is_windows and ';' or ':' + + return { + escape_wildcards = escape_wildcards, + is_dir = is_dir, + is_file = is_file, + is_absolute = is_absolute, + exists = exists, + dirname = dirname, + join = path_join, + sanitize = sanitize, + traverse_parents = traverse_parents, + iterate_parents = iterate_parents, + is_descendant = is_descendant, + path_separator = path_separator, + } +end)() + +-- Returns a function(root_dir), which, when called with a root_dir it hasn't +-- seen before, will call make_config(root_dir) and start a new client. +function M.server_per_root_dir_manager(make_config) + local clients = {} + local single_file_clients = {} + local manager = {} + + function manager.add(root_dir, single_file) + local client_id + -- This is technically unnecessary, as lspconfig's path utilities should be hermetic, + -- however users are free to return strings in custom root resolvers. + root_dir = M.path.sanitize(root_dir) + if single_file then + client_id = single_file_clients[root_dir] + elseif root_dir and M.path.is_dir(root_dir) then + client_id = clients[root_dir] + else + return + end + + local get_client_from_cache = function(conf) + local id + if vim.tbl_count(clients) == 1 then + id = vim.tbl_values(clients)[1] + elseif vim.tbl_count(single_file_clients) == 1 then + id = vim.tbl_values(single_file_clients)[1] + else + return + end + local client = lsp.get_client_by_id(id) + if client and client.name == conf.name then + return client + end + return nil + end + + -- Check if we have a client already or start and store it. + if not client_id then + local new_config = make_config(root_dir) + local client = get_client_from_cache(new_config) + if client then + local params = lsp.util.make_workspace_params( + { { uri = vim.uri_from_fname(root_dir), name = root_dir } }, + { {} } + ) + if not client.workspace_folders then + client.workspace_folders = {} + end + table.insert(client.workspace_folders, params.event.added[1]) + return client.id + end + -- do nothing if the client is not enabled + if new_config.enabled == false then + return + end + if not new_config.cmd then + vim.notify( + string.format( + '[lspconfig] cmd not defined for %q. Manually set cmd in the setup {} call according to server_configurations.md, see :help lspconfig-index.', + new_config.name + ), + vim.log.levels.ERROR + ) + return + end + new_config.on_exit = M.add_hook_before(new_config.on_exit, function() + clients[root_dir] = nil + single_file_clients[root_dir] = nil + end) + + -- Launch the server in the root directory used internally by lspconfig, if otherwise unset + -- also check that the path exist + if not new_config.cmd_cwd and uv.fs_realpath(root_dir) then + new_config.cmd_cwd = root_dir + end + + -- Sending rootDirectory and workspaceFolders as null is not explicitly + -- codified in the spec. Certain servers crash if initialized with a NULL + -- root directory. + if single_file then + new_config.root_dir = nil + new_config.workspace_folders = nil + end + client_id = lsp.start_client(new_config) + + -- Handle failures in start_client + if not client_id then + return + end + + if single_file then + single_file_clients[root_dir] = client_id + else + clients[root_dir] = client_id + end + end + return client_id + end + + function manager.clients(single_file) + local res = {} + local client_list = single_file and single_file_clients or clients + for _, id in pairs(client_list) do + local client = lsp.get_client_by_id(id) + if client then + table.insert(res, client) + end + end + return res + end + + return manager +end + +function M.search_ancestors(startpath, func) + validate { func = { func, 'f' } } + if func(startpath) then + return startpath + end + local guard = 100 + for path in M.path.iterate_parents(startpath) do + -- Prevent infinite recursion if our algorithm breaks + guard = guard - 1 + if guard == 0 then + return + end + + if func(path) then + return path + end + end +end + +function M.root_pattern(...) + local patterns = vim.tbl_flatten { ... } + local function matcher(path) + for _, pattern in ipairs(patterns) do + for _, p in ipairs(vim.fn.glob(M.path.join(M.path.escape_wildcards(path), pattern), true, true)) do + if M.path.exists(p) then + return path + end + end + end + end + return function(startpath) + startpath = M.strip_archive_subpath(startpath) + return M.search_ancestors(startpath, matcher) + end +end +function M.find_git_ancestor(startpath) + return M.search_ancestors(startpath, function(path) + -- Support git directories and git files (worktrees) + if M.path.is_dir(M.path.join(path, '.git')) or M.path.is_file(M.path.join(path, '.git')) then + return path + end + end) +end +function M.find_mercurial_ancestor(startpath) + return M.search_ancestors(startpath, function(path) + -- Support Mercurial directories + if M.path.is_dir(M.path.join(path, '.hg')) then + return path + end + end) +end +function M.find_node_modules_ancestor(startpath) + return M.search_ancestors(startpath, function(path) + if M.path.is_dir(M.path.join(path, 'node_modules')) then + return path + end + end) +end +function M.find_package_json_ancestor(startpath) + return M.search_ancestors(startpath, function(path) + if M.path.is_file(M.path.join(path, 'package.json')) then + return path + end + end) +end + +function M.get_active_clients_list_by_ft(filetype) + local clients = vim.lsp.get_active_clients() + local clients_list = {} + for _, client in pairs(clients) do + local filetypes = client.config.filetypes or {} + for _, ft in pairs(filetypes) do + if ft == filetype then + table.insert(clients_list, client.name) + end + end + end + return clients_list +end + +function M.get_other_matching_providers(filetype) + local configs = require 'lspconfig.configs' + local active_clients_list = M.get_active_clients_list_by_ft(filetype) + local other_matching_configs = {} + for _, config in pairs(configs) do + if not vim.tbl_contains(active_clients_list, config.name) then + local filetypes = config.filetypes or {} + for _, ft in pairs(filetypes) do + if ft == filetype then + table.insert(other_matching_configs, config) + end + end + end + end + return other_matching_configs +end + +function M.get_config_by_ft(filetype) + local configs = require 'lspconfig.configs' + local matching_configs = {} + for _, config in pairs(configs) do + local filetypes = config.filetypes or {} + for _, ft in pairs(filetypes) do + if ft == filetype then + table.insert(matching_configs, config) + end + end + end + return matching_configs +end + +function M.get_active_client_by_name(bufnr, servername) + for _, client in pairs(vim.lsp.get_active_clients { bufnr = bufnr }) do + if client.name == servername then + return client + end + end +end + +function M.get_managed_clients() + local configs = require 'lspconfig.configs' + local clients = {} + for _, config in pairs(configs) do + if config.manager then + vim.list_extend(clients, config.manager.clients()) + vim.list_extend(clients, config.manager.clients(true)) + end + end + return clients +end + +function M.available_servers() + local servers = {} + local configs = require 'lspconfig.configs' + for server, config in pairs(configs) do + if config.manager ~= nil then + table.insert(servers, server) + end + end + return servers +end + +-- For zipfile: or tarfile: virtual paths, returns the path to the archive. +-- Other paths are returned unaltered. +function M.strip_archive_subpath(path) + -- Matches regex from zip.vim / tar.vim + path = vim.fn.substitute(path, 'zipfile://\\(.\\{-}\\)::[^\\\\].*$', '\\1', '') + path = vim.fn.substitute(path, 'tarfile:\\(.\\{-}\\)::.*$', '\\1', '') + return path +end + +return M diff --git a/bundle/nvim-lspconfig-0.1.4/neovim.yml b/bundle/nvim-lspconfig-0.1.4/neovim.yml new file mode 100644 index 000000000..9de2931ee --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/neovim.yml @@ -0,0 +1,25 @@ +--- +base: lua51 + +globals: + vim: + any: true + assert: + args: + - type: bool + - type: string + required: false + after_each: + args: + - type: function + before_each: + args: + - type: function + describe: + args: + - type: string + - type: function + it: + args: + - type: string + - type: function diff --git a/bundle/nvim-lspconfig-0.1.4/nvim-lspconfig-scm-1.rockspec b/bundle/nvim-lspconfig-0.1.4/nvim-lspconfig-scm-1.rockspec new file mode 100644 index 000000000..ec91d030a --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/nvim-lspconfig-scm-1.rockspec @@ -0,0 +1,38 @@ +local _MODREV, _SPECREV = 'scm', '-1' + +rockspec_format = "3.0" +package = 'nvim-lspconfig' +version = _MODREV .. _SPECREV + +description = { + summary = "A collection of common configurations for Neovim's built-in language server client.", + detailed = [[ + This plugin allows for declaratively configuring, launching, and initializing language servers you have installed on your system. + Language server configurations are community-maintained. + ]], + homepage = 'https://github.com/neovim/nvim-lspconfig', + license = 'Apache/2.0', + labels = { 'neovim', 'lsp' } +} + +dependencies = { + 'lua == 5.1', +} + +source = { + url = 'https://github.com/neovim/nvim-lspconfig/archive/v' .. _MODREV .. '.zip', + dir = 'nvim-lspconfig-' .. _MODREV, +} + +if _MODREV == 'scm' then + source = { + url = 'git://github.com/neovim/nvim-lspconfig', + } +end + +build = { + type = 'builtin', + copy_directories = { + 'doc' + } +} diff --git a/bundle/nvim-lspconfig-0.1.4/plugin/lspconfig.lua b/bundle/nvim-lspconfig-0.1.4/plugin/lspconfig.lua new file mode 100644 index 000000000..42ae0ff5f --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/plugin/lspconfig.lua @@ -0,0 +1,153 @@ +local api, lsp = vim.api, vim.lsp + +if vim.g.lspconfig ~= nil then + return +end +vim.g.lspconfig = 1 + +local version_info = vim.version() +if vim.fn.has 'nvim-0.7' ~= 1 then + local warning_str = string.format( + '[lspconfig] requires neovim 0.7 or later. Detected neovim version: 0.%s.%s', + version_info.minor, + version_info.patch + ) + vim.notify_once(warning_str) + return +end + +local completion_sort = function(items) + table.sort(items) + return items +end + +local lsp_complete_configured_servers = function(arg) + return completion_sort(vim.tbl_filter(function(s) + return s:sub(1, #arg) == arg + end, require('lspconfig.util').available_servers())) +end + +local lsp_get_active_client_ids = function(arg) + local clients = vim.tbl_map(function(client) + return ('%d (%s)'):format(client.id, client.name) + end, require('lspconfig.util').get_managed_clients()) + + return completion_sort(vim.tbl_filter(function(s) + return s:sub(1, #arg) == arg + end, clients)) +end + +local get_clients_from_cmd_args = function(arg) + local result = {} + for id in (arg or ''):gmatch '(%d+)' do + result[id] = lsp.get_client_by_id(tonumber(id)) + end + if vim.tbl_isempty(result) then + return require('lspconfig.util').get_managed_clients() + end + return vim.tbl_values(result) +end + +for group, hi in pairs { + LspInfoBorder = { link = 'Label', default = true }, + LspInfoList = { link = 'Function', default = true }, + LspInfoTip = { link = 'Comment', default = true }, + LspInfoTitle = { link = 'Title', default = true }, + LspInfoFiletype = { link = 'Type', default = true }, +} do + api.nvim_set_hl(0, group, hi) +end + +-- Called from plugin/lspconfig.vim because it requires knowing that the last +-- script in scriptnames to be executed is lspconfig. +api.nvim_create_user_command('LspInfo', function() + require 'lspconfig.ui.lspinfo'() +end, { + desc = 'Displays attached, active, and configured language servers', +}) + +api.nvim_create_user_command('LspStart', function(info) + local server_name = string.len(info.args) > 0 and info.args or nil + if server_name then + local config = require('lspconfig.configs')[server_name] + if config then + config.launch() + return + end + end + + local matching_configs = require('lspconfig.util').get_config_by_ft(vim.bo.filetype) + for _, config in ipairs(matching_configs) do + config.launch() + end +end, { + desc = 'Manually launches a language server', + nargs = '?', + complete = lsp_complete_configured_servers, +}) + +api.nvim_create_user_command('LspRestart', function(info) + local detach_clients = {} + for _, client in ipairs(get_clients_from_cmd_args(info.args)) do + client.stop() + detach_clients[client.name] = client + end + local timer = vim.loop.new_timer() + timer:start( + 500, + 100, + vim.schedule_wrap(function() + for client_name, client in pairs(detach_clients) do + if client.is_stopped() then + require('lspconfig.configs')[client_name].launch() + detach_clients[client_name] = nil + end + end + + if next(detach_clients) == nil and not timer:is_closing() then + timer:close() + end + end) + ) +end, { + desc = 'Manually restart the given language client(s)', + nargs = '?', + complete = lsp_get_active_client_ids, +}) + +api.nvim_create_user_command('LspStop', function(info) + local current_buf = vim.api.nvim_get_current_buf() + local server_name, force + local arguments = vim.split(info.args, '%s') + for _, v in pairs(arguments) do + if v == '++force' then + force = true + end + if v:find '%(' then + server_name = v + end + end + + if not server_name then + local servers_on_buffer = lsp.get_active_clients { buffer = current_buf } + for _, client in ipairs(servers_on_buffer) do + if client.attached_buffers[current_buf] then + client.stop(force) + end + end + else + for _, client in ipairs(get_clients_from_cmd_args(server_name)) do + client.stop(force) + end + end +end, { + desc = 'Manually stops the given language client(s)', + nargs = '?', + complete = lsp_get_active_client_ids, +}) + +api.nvim_create_user_command('LspLog', function() + vim.cmd(string.format('tabnew %s', lsp.get_log_path())) +end, { + desc = 'Opens the Nvim LSP client log.', +}) diff --git a/bundle/nvim-lspconfig-0.1.4/scripts/README_template.md b/bundle/nvim-lspconfig-0.1.4/scripts/README_template.md new file mode 100644 index 000000000..1339c5025 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/scripts/README_template.md @@ -0,0 +1,12 @@ +# Configurations + + +LSP configs provided by nvim-lspconfig are listed below. This documentation is +autogenerated from the Lua files. You can view this file in Nvim by running +`:help lspconfig-all`. + +{{implemented_servers_list}} + +{{lsp_server_details}} + +vim:ft=markdown diff --git a/bundle/nvim-lspconfig-0.1.4/scripts/docgen.lua b/bundle/nvim-lspconfig-0.1.4/scripts/docgen.lua new file mode 100644 index 000000000..93d57eb0f --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/scripts/docgen.lua @@ -0,0 +1,272 @@ +require 'lspconfig' +local configs = require 'lspconfig.configs' +local util = require 'lspconfig.util' +local inspect = vim.inspect +local uv = vim.loop +local fn = vim.fn +local tbl_flatten = vim.tbl_flatten + +local function template(s, params) + return (s:gsub('{{([^{}]+)}}', params)) +end + +local function map_list(t, func) + local res = {} + for i, v in ipairs(t) do + local x = func(v, i) + if x ~= nil then + table.insert(res, x) + end + end + return res +end + +local function indent(n, s) + local prefix + if type(n) == 'number' then + if n <= 0 then + return s + end + prefix = string.rep(' ', n) + else + assert(type(n) == 'string', 'n must be number or string') + prefix = n + end + local lines = vim.split(s, '\n', true) + for i, line in ipairs(lines) do + lines[i] = prefix .. line + end + return table.concat(lines, '\n') +end + +local function make_parts(fns) + return tbl_flatten(map_list(fns, function(v) + if type(v) == 'function' then + v = v() + end + return { v } + end)) +end + +local function make_section(indentlvl, sep, parts) + return indent(indentlvl, table.concat(make_parts(parts), sep)) +end + +local function readfile(path) + assert(util.path.is_file(path)) + return io.open(path):read '*a' +end + +local function sorted_map_table(t, func) + local keys = vim.tbl_keys(t) + table.sort(keys) + return map_list(keys, function(k) + return func(k, t[k]) + end) +end + +local lsp_section_template = [[ +## {{template_name}} + +{{preamble}} + +**Snippet to enable the language server:** +```lua +require'lspconfig'.{{template_name}}.setup{} +``` +{{commands}} + +**Default values:** +{{default_values}} + +]] + +local function require_all_configs() + -- Configs are lazy-loaded, tickle them to populate the `configs` singleton. + for _, v in ipairs(vim.fn.glob('lua/lspconfig/server_configurations/*.lua', 1, 1)) do + local module_name = v:gsub('.*/', ''):gsub('%.lua$', '') + configs[module_name] = require('lspconfig.server_configurations.' .. module_name) + end +end + +local function make_lsp_sections() + return make_section( + 0, + '\n', + sorted_map_table(configs, function(template_name, template_object) + local template_def = template_object.document_config + local docs = template_def.docs + + local params = { + template_name = template_name, + preamble = '', + commands = '', + default_values = '', + } + + params.commands = make_section(0, '\n\n', { + function() + if not template_def.commands or #vim.tbl_keys(template_def.commands) == 0 then + return + end + return '**Commands:**\n' + .. make_section(0, '\n', { + sorted_map_table(template_def.commands, function(name, def) + if def.description then + return string.format('- %s: %s', name, def.description) + end + return string.format('- %s', name) + end), + }) + end, + }) + + params.default_values = make_section(2, '\n\n', { + function() + if not template_def.default_config then + return + end + return make_section(0, '\n', { + sorted_map_table(template_def.default_config, function(k, v) + local description = ((docs or {}).default_config or {})[k] + if description and type(description) ~= 'string' then + description = inspect(description) + elseif not description and type(v) == 'function' then + description = 'see source file' + end + return string.format('- `%s` : \n```lua\n%s\n```', k, description or inspect(v)) + end), + }) + end, + }) + + if docs then + local tempdir = os.getenv 'DOCGEN_TEMPDIR' or uv.fs_mkdtemp '/tmp/nvim-lsp.XXXXXX' + local preamble_parts = make_parts { + function() + if docs.description and #docs.description > 0 then + return docs.description + end + end, + function() + local package_json_name = util.path.join(tempdir, template_name .. '.package.json') + if docs.package_json then + if not util.path.is_file(package_json_name) then + os.execute(string.format('curl -v -L -o %q %q', package_json_name, docs.package_json)) + end + if not util.path.is_file(package_json_name) then + print(string.format('Failed to download package.json for %q at %q', template_name, docs.package_json)) + os.exit(1) + return + end + local data = vim.json.decode(readfile(package_json_name)) + -- The entire autogenerated section. + return make_section(0, '\n', { + -- The default settings section + function() + local default_settings = (data.contributes or {}).configuration + if not default_settings.properties then + return + end + -- The outer section. + return make_section(0, '\n', { + 'This server accepts configuration via the `settings` key.', + '
Available settings:', + '', + -- The list of properties. + make_section( + 0, + '\n\n', + sorted_map_table(default_settings.properties, function(k, v) + local function tick(s) + return string.format('`%s`', s) + end + local function bold(s) + return string.format('**%s**', s) + end + + -- https://github.github.com/gfm/#backslash-escapes + local function excape_markdown_punctuations(str) + local pattern = + '\\(\\*\\|\\.\\|?\\|!\\|"\\|#\\|\\$\\|%\\|\'\\|(\\|)\\|,\\|-\\|\\/\\|:\\|;\\|<\\|=\\|>\\|@\\|\\[\\|\\\\\\|\\]\\|\\^\\|_\\|`\\|{\\|\\\\|\\|}\\)' + return fn.substitute(str, pattern, '\\\\\\0', 'g') + end + + -- local function pre(s) return string.format("
%s
", s) end + -- local function code(s) return string.format("%s", s) end + if not (type(v) == 'table') then + return + end + return make_section(0, '\n', { + '- ' .. make_section(0, ': ', { + bold(tick(k)), + function() + if v.enum then + return tick('enum ' .. inspect(v.enum)) + end + if v.type then + return tick(table.concat(tbl_flatten { v.type }, '|')) + end + end, + }), + '', + make_section(2, '\n\n', { + { v.default and 'Default: ' .. tick(inspect(v.default, { newline = '', indent = '' })) }, + { v.items and 'Array items: ' .. tick(inspect(v.items, { newline = '', indent = '' })) }, + { excape_markdown_punctuations(v.description) }, + }), + }) + end) + ), + '', + '
', + }) + end, + }) + end + end, + } + if not os.getenv 'DOCGEN_TEMPDIR' then + os.execute('rm -rf ' .. tempdir) + end + -- Insert a newline after the preamble if it exists. + if #preamble_parts > 0 then + table.insert(preamble_parts, '') + end + params.preamble = table.concat(preamble_parts, '\n') + end + + return template(lsp_section_template, params) + end) + ) +end + +local function make_implemented_servers_list() + return make_section( + 0, + '\n', + sorted_map_table(configs, function(k) + return template('- [{{server}}](#{{server}})', { server = k }) + end) + ) +end + +local function generate_readme(template_file, params) + vim.validate { + lsp_server_details = { params.lsp_server_details, 's' }, + implemented_servers_list = { params.implemented_servers_list, 's' }, + } + local input_template = readfile(template_file) + local readme_data = template(input_template, params) + + local writer = io.open('doc/server_configurations.md', 'w') + writer:write(readme_data) + writer:close() + uv.fs_copyfile('doc/server_configurations.md', 'doc/server_configurations.txt') +end + +require_all_configs() +generate_readme('scripts/README_template.md', { + implemented_servers_list = make_implemented_servers_list(), + lsp_server_details = make_lsp_sections(), +}) diff --git a/bundle/nvim-lspconfig-0.1.4/scripts/docgen.sh b/bundle/nvim-lspconfig-0.1.4/scripts/docgen.sh new file mode 100644 index 000000000..288465430 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/scripts/docgen.sh @@ -0,0 +1,2 @@ +#!/bin/sh +exec nvim -u NONE -E -R --headless +'set rtp+=$PWD' +'luafile scripts/docgen.lua' +q diff --git a/bundle/nvim-lspconfig-0.1.4/scripts/run_test.sh b/bundle/nvim-lspconfig-0.1.4/scripts/run_test.sh new file mode 100644 index 000000000..7221ef80f --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/scripts/run_test.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +PJ_ROOT=$(pwd) + +if [ ! -d ./neovim ]; then + git clone --depth 1 https://github.com/neovim/neovim +fi + +cd ./neovim + +make functionaltest \ + BUSTED_ARGS="--lpath=$PJ_ROOT/?.lua --lpath=$PJ_ROOT/lua/?.lua --lpath=$PJ_ROOT/lua/lspconfig/?.lua" \ + TEST_FILE="../test/lspconfig_spec.lua" diff --git a/bundle/nvim-lspconfig-0.1.4/selene.toml b/bundle/nvim-lspconfig-0.1.4/selene.toml new file mode 100644 index 000000000..c85e792c2 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/selene.toml @@ -0,0 +1,5 @@ +std = "neovim" + +[rules] +global_usage = "allow" +multiple_statements = "allow" diff --git a/bundle/nvim-lspconfig-0.1.4/test/lspconfig_spec.lua b/bundle/nvim-lspconfig-0.1.4/test/lspconfig_spec.lua new file mode 100644 index 000000000..b899c09d2 --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/test/lspconfig_spec.lua @@ -0,0 +1,362 @@ +local helpers = require 'test.functional.helpers'(after_each) +local clear = helpers.clear +local exec_lua = helpers.exec_lua +local eq = helpers.eq +local ok = helpers.ok + +before_each(function() + clear() + -- add plugin module path to package.path in Lua runtime in Nvim + exec_lua( + [[ + package.path = ... + ]], + package.path + ) +end) + +describe('lspconfig', function() + describe('util', function() + describe('path', function() + describe('escape_wildcards', function() + it('doesnt escape if not needed', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + return lspconfig.util.path.escape_wildcards('/usr/local/test/fname.lua') == '/usr/local/test/fname.lua' + ]]) + end) + it('escapes if needed', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + return lspconfig.util.path.escape_wildcards('/usr/local/test/[sq brackets] fname?*.lua') == '/usr/local/test/\\[sq brackets\\] fname\\?\\*.lua' + ]]) + end) + end) + describe('exists', function() + it('is present directory', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + local cwd = vim.fn.getcwd() + return not (lspconfig.util.path.exists(cwd) == false) + ]]) + end) + + it('is not present directory', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + local not_exist_dir = vim.fn.getcwd().."/not/exists" + return lspconfig.util.path.exists(not_exist_dir) == false + ]]) + end) + + it('is present file', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + -- change the working directory to test directory + vim.api.nvim_command("cd ../test/test_dir/") + local file = vim.fn.getcwd().."/root_marker.txt" + + return not (lspconfig.util.path.exists(file) == false) + ]]) + end) + + it('is not present file', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + -- change the working directory to test directory + vim.api.nvim_command("cd ../test/test_dir/") + local file = vim.fn.getcwd().."/not_exists.txt" + + return lspconfig.util.path.exists(file) == false + ]]) + end) + end) + + describe('is_dir', function() + it('is directory', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + local cwd = vim.fn.getcwd() + return lspconfig.util.path.is_dir(cwd) + ]]) + end) + + it('is not present directory', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + local not_exist_dir = vim.fn.getcwd().."/not/exists" + return not lspconfig.util.path.is_dir(not_exist_dir) + ]]) + end) + + it('is file', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + -- change the working directory to test directory + vim.api.nvim_command("cd ../test/test_dir/") + local file = vim.fn.getcwd().."/root_marker.txt" + + return not lspconfig.util.path.is_dir(file) + ]]) + end) + end) + + describe('is_file', function() + it('is file', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + -- change the working directory to test directory + vim.api.nvim_command("cd ../test/test_dir/") + local file = vim.fn.getcwd().."/root_marker.txt" + + return lspconfig.util.path.is_file(file) + ]]) + end) + + it('is not present file', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + -- change the working directory to test directory + vim.api.nvim_command("cd ../test/test_dir/") + local file = vim.fn.getcwd().."/not_exists.txt" + + return not lspconfig.util.path.is_file(file) + ]]) + end) + + it('is directory', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + local cwd = vim.fn.getcwd() + return not lspconfig.util.path.is_file(cwd) + ]]) + end) + end) + + describe('is_absolute', function() + it('is absolute', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + return not (lspconfig.util.path.is_absolute("/foo/bar") == nil) + ]]) + end) + + it('is not absolute', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + return lspconfig.util.path.is_absolute("foo/bar") == nil + ]]) + + ok(exec_lua [[ + local lspconfig = require("lspconfig") + return lspconfig.util.path.is_absolute("../foo/bar") == nil + ]]) + end) + end) + + describe('join', function() + it('', function() + eq( + exec_lua [[ + local lspconfig = require("lspconfig") + return lspconfig.util.path.join("foo", "bar", "baz") + ]], + 'foo/bar/baz' + ) + end) + end) + end) + + describe('root_pattern', function() + it('resolves to a_marker.txt', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + -- change the working directory to test directory + vim.api.nvim_command("cd ../test/test_dir/a") + local cwd = vim.fn.getcwd() + return cwd == lspconfig.util.root_pattern({"root_marker.txt", "a_marker.txt"})(cwd) + ]]) + end) + + it('resolves to root_marker.txt', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + + -- change the working directory to test directory + vim.api.nvim_command("cd ../test/test_dir/a") + + local cwd = vim.fn.getcwd() + local resolved = lspconfig.util.root_pattern({"root_marker.txt"})(cwd) + vim.api.nvim_command("cd ..") + + return vim.fn.getcwd() == resolved + ]]) + end) + end) + + describe('strip_archive_subpath', function() + it('strips zipfile subpaths', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + return lspconfig.util.strip_archive_subpath("zipfile:///one/two.zip::three/four") == "/one/two.zip" + ]]) + end) + + it('strips tarfile subpaths', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + return lspconfig.util.strip_archive_subpath("tarfile:/one/two.tgz::three/four") == "/one/two.tgz" + ]]) + end) + + it('returns non-archive paths as-is', function() + ok(exec_lua [[ + local lspconfig = require("lspconfig") + return lspconfig.util.strip_archive_subpath("/one/two.zip") == "/one/two.zip" + ]]) + end) + end) + + describe('user commands', function() + it('should translate command definition to nvim_create_user_command options', function() + eq( + { + nargs = '*', + complete = 'custom,v:lua.some_global', + }, + exec_lua [[ + local util = require("lspconfig.util") + return util._parse_user_command_options({ + function () end, + "-nargs=* -complete=custom,v:lua.some_global" + }) + ]] + ) + + eq( + { + desc = 'My awesome description.', + nargs = '*', + complete = 'custom,v:lua.another_global', + }, + exec_lua [[ + local util = require("lspconfig.util") + return util._parse_user_command_options({ + function () end, + ["-nargs"] = "*", + "-complete=custom,v:lua.another_global", + description = "My awesome description." + }) + ]] + ) + end) + end) + end) + + describe('config', function() + it('normalizes user, server, and base default configs', function() + eq( + exec_lua [[ + local lspconfig = require("lspconfig") + local configs = require("lspconfig.configs") + + local actual = nil + lspconfig.util.on_setup = function(config) + actual = config + end + + lspconfig.util.default_config = { + foo = { + bar = { + val1 = 'base1', + val2 = 'base2', + }, + }, + } + + local server_config = { + default_config = { + foo = { + bar = { + val2 = 'server2', + val3 = 'server3', + }, + baz = 'baz', + }, + }, + } + + local user_config = { + foo = { + bar = { + val3 = 'user3', + val4 = 'user4', + } + }, + } + + configs['test'] = server_config + configs['test'].setup(user_config) + return actual + ]], + { + foo = { + bar = { + val1 = 'base1', + val2 = 'server2', + val3 = 'user3', + val4 = 'user4', + }, + baz = 'baz', + }, + name = 'test', + } + ) + end) + + it("excludes indexed server configs that haven't been set up", function() + eq( + exec_lua [[ + local lspconfig = require("lspconfig") + local actual = nil + local _ = lspconfig.sumneko_lua + local _ = lspconfig.tsserver + lspconfig.rust_analyzer.setup {} + return require("lspconfig.util").available_servers() + ]], + { 'rust_analyzer' } + ) + end) + + it('provides user_config to the on_setup hook', function() + eq( + exec_lua [[ + local lspconfig = require "lspconfig" + local util = require "lspconfig.util" + local user_config + util.on_setup = function (_, _user_config) + user_config = _user_config + end + lspconfig.rust_analyzer.setup { custom_user_config = "custom" } + return user_config + ]], + { + custom_user_config = 'custom', + } + ) + end) + end) +end) diff --git a/bundle/nvim-lspconfig-0.1.4/test/minimal_init.lua b/bundle/nvim-lspconfig-0.1.4/test/minimal_init.lua new file mode 100644 index 000000000..841cb67cf --- /dev/null +++ b/bundle/nvim-lspconfig-0.1.4/test/minimal_init.lua @@ -0,0 +1,69 @@ +local on_windows = vim.loop.os_uname().version:match 'Windows' + +local function join_paths(...) + local path_sep = on_windows and '\\' or '/' + local result = table.concat({ ... }, path_sep) + return result +end + +vim.cmd [[set runtimepath=$VIMRUNTIME]] + +local temp_dir = vim.loop.os_getenv 'TEMP' or '/tmp' + +vim.cmd('set packpath=' .. join_paths(temp_dir, 'nvim', 'site')) + +local package_root = join_paths(temp_dir, 'nvim', 'site', 'pack') +local lspconfig_path = join_paths(package_root, 'test', 'start', 'nvim-lspconfig') + +if vim.fn.isdirectory(lspconfig_path) ~= 1 then + vim.fn.system { 'git', 'clone', 'https://github.com/neovim/nvim-lspconfig', lspconfig_path } +end + +vim.lsp.set_log_level 'trace' +require('vim.lsp.log').set_format_func(vim.inspect) +local nvim_lsp = require 'lspconfig' +local on_attach = function(_, bufnr) + local function buf_set_option(...) + vim.api.nvim_buf_set_option(bufnr, ...) + end + + buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') + + -- Mappings. + local opts = { buffer = bufnr, noremap = true, silent = true } + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) + vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts) + vim.keymap.set('n', '', vim.lsp.buf.signature_help, opts) + vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, opts) + vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, opts) + vim.keymap.set('n', 'wl', function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, opts) + vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, opts) + vim.keymap.set('n', 'rn', vim.lsp.buf.rename, opts) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) + vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) + vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) + vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) + vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) +end + +-- Add the server that troubles you here +local name = 'pyright' +local cmd = { 'pyright-langserver', '--stdio' } -- needed for elixirls, omnisharp, sumneko_lua +if not name then + print 'You have not defined a server name, please edit minimal_init.lua' +end +if not nvim_lsp[name].document_config.default_config.cmd and not cmd then + print [[You have not defined a server default cmd for a server + that requires it please edit minimal_init.lua]] +end + +nvim_lsp[name].setup { + cmd = cmd, + on_attach = on_attach, +} + +print [[You can find your log at $HOME/.cache/nvim/lsp.log. Please paste in a github issue under a details tag as described in the issue template.]] diff --git a/bundle/nvim-lspconfig-0.1.4/test/test_dir/a/a_marker.txt b/bundle/nvim-lspconfig-0.1.4/test/test_dir/a/a_marker.txt new file mode 100644 index 000000000..e69de29bb diff --git a/bundle/nvim-lspconfig-0.1.4/test/test_dir/root_marker.txt b/bundle/nvim-lspconfig-0.1.4/test/test_dir/root_marker.txt new file mode 100644 index 000000000..e69de29bb diff --git a/config/plugins/nvim-lspconfig-0.1.3.vim b/config/plugins/nvim-lspconfig-0.1.3.vim new file mode 100644 index 000000000..d7b5b222c --- /dev/null +++ b/config/plugins/nvim-lspconfig-0.1.3.vim @@ -0,0 +1 @@ +call SpaceVim#layers#lsp#setup() diff --git a/config/plugins/nvim-lspconfig-0.1.4.vim b/config/plugins/nvim-lspconfig-0.1.4.vim new file mode 100644 index 000000000..bf229a112 --- /dev/null +++ b/config/plugins/nvim-lspconfig-0.1.4.vim @@ -0,0 +1,2 @@ +call SpaceVim#layers#lsp#setup() +