mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 07:10:06 +08:00
chore(lspconfig): use latest version lspconfig for nvim 0.9.1
This commit is contained in:
parent
23758a3383
commit
403332accb
@ -62,7 +62,16 @@ endfunction
|
||||
|
||||
function! SpaceVim#layers#lsp#plugins() abort
|
||||
let plugins = []
|
||||
if has('nvim-0.8.0')
|
||||
if has('nvim-0.9.1')
|
||||
call add(plugins, [g:_spacevim_root_dir . 'bundle/nvim-lspconfig-latest', {'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.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}])
|
||||
|
3
bundle/nvim-lspconfig-latest/.codespellignorewords
vendored
Normal file
3
bundle/nvim-lspconfig-latest/.codespellignorewords
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
als
|
||||
edn
|
||||
esy
|
13
bundle/nvim-lspconfig-latest/.editorconfig
vendored
Normal file
13
bundle/nvim-lspconfig-latest/.editorconfig
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
tab_width = 8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
charset = utf-8
|
||||
|
||||
[{Makefile,**/Makefile,runtime/doc/*.txt}]
|
||||
indent_style = tab
|
||||
indent_size = 8
|
77
bundle/nvim-lspconfig-latest/.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
77
bundle/nvim-lspconfig-latest/.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@ -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
|
||||
|
||||
|
||||
|
6
bundle/nvim-lspconfig-latest/.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
6
bundle/nvim-lspconfig-latest/.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -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
|
||||
|
24
bundle/nvim-lspconfig-latest/.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
24
bundle/nvim-lspconfig-latest/.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
@ -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"
|
||||
|
5
bundle/nvim-lspconfig-latest/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md
vendored
Normal file
5
bundle/nvim-lspconfig-latest/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
name: Pull Request
|
||||
about: Submit a pull request
|
||||
title: ''
|
||||
---
|
16
bundle/nvim-lspconfig-latest/.github/ci/run_sanitizer.sh
vendored
Normal file
16
bundle/nvim-lspconfig-latest/.github/ci/run_sanitizer.sh
vendored
Normal file
@ -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
|
8
bundle/nvim-lspconfig-latest/.github/dependabot.yml
vendored
Normal file
8
bundle/nvim-lspconfig-latest/.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
commit-message:
|
||||
prefix: "ci"
|
11
bundle/nvim-lspconfig-latest/.github/workflows/codespell.yml
vendored
Normal file
11
bundle/nvim-lspconfig-latest/.github/workflows/codespell.yml
vendored
Normal file
@ -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
|
20
bundle/nvim-lspconfig-latest/.github/workflows/comment-config-changes.yml
vendored
Normal file
20
bundle/nvim-lspconfig-latest/.github/workflows/comment-config-changes.yml
vendored
Normal file
@ -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
|
12
bundle/nvim-lspconfig-latest/.github/workflows/commit_lint.yml
vendored
Normal file
12
bundle/nvim-lspconfig-latest/.github/workflows/commit_lint.yml
vendored
Normal file
@ -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
|
32
bundle/nvim-lspconfig-latest/.github/workflows/docgen.yml
vendored
Normal file
32
bundle/nvim-lspconfig-latest/.github/workflows/docgen.yml
vendored
Normal file
@ -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)
|
37
bundle/nvim-lspconfig-latest/.github/workflows/lint.yml
vendored
Normal file
37
bundle/nvim-lspconfig-latest/.github/workflows/lint.yml
vendored
Normal file
@ -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@v3
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
version: latest
|
||||
args: --check .
|
30
bundle/nvim-lspconfig-latest/.github/workflows/problem_matchers/selene.json
vendored
Normal file
30
bundle/nvim-lspconfig-latest/.github/workflows/problem_matchers/selene.json
vendored
Normal file
@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
21
bundle/nvim-lspconfig-latest/.github/workflows/release.yml
vendored
Normal file
21
bundle/nvim-lspconfig-latest/.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
name: "release"
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
jobs:
|
||||
luarocks-upload:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: LuaRocks Upload
|
||||
uses: nvim-neorocks/luarocks-tag-release@v5
|
||||
env:
|
||||
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
|
||||
with:
|
||||
summary: "A collection of common configurations for Neovim's built-in language server client."
|
||||
detailed_description: |
|
||||
This plugin allows for declaratively configuring,
|
||||
launching, and initializing language servers you have installed on your system.
|
||||
Language server configurations are community-maintained.
|
||||
licence: "Apache/2.0"
|
15
bundle/nvim-lspconfig-latest/.github/workflows/sanitizer.yml
vendored
Normal file
15
bundle/nvim-lspconfig-latest/.github/workflows/sanitizer.yml
vendored
Normal file
@ -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
|
36
bundle/nvim-lspconfig-latest/.github/workflows/test.yml
vendored
Normal file
36
bundle/nvim-lspconfig-latest/.github/workflows/test.yml
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
name: test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Run Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: rhysd/action-setup-vim@v1
|
||||
id: vim
|
||||
with:
|
||||
neovim: true
|
||||
version: nightly
|
||||
|
||||
- name: luajit
|
||||
uses: leafo/gh-actions-lua@v10
|
||||
with:
|
||||
luaVersion: "luajit-2.1.0-beta3"
|
||||
|
||||
- name: luarocks
|
||||
uses: leafo/gh-actions-luarocks@v4
|
||||
|
||||
- name: run test
|
||||
shell: bash
|
||||
run: |
|
||||
luarocks install luacheck
|
||||
luarocks install vusted
|
||||
vusted ./test
|
3
bundle/nvim-lspconfig-latest/.gitignore
vendored
Normal file
3
bundle/nvim-lspconfig-latest/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
.luacheckcache
|
||||
neovim
|
||||
doc/tags
|
15
bundle/nvim-lspconfig-latest/.luacheckrc
vendored
Normal file
15
bundle/nvim-lspconfig-latest/.luacheckrc
vendored
Normal file
@ -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",
|
||||
}
|
6
bundle/nvim-lspconfig-latest/.stylua.toml
vendored
Normal file
6
bundle/nvim-lspconfig-latest/.stylua.toml
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
column_width = 120
|
||||
line_endings = "Unix"
|
||||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
quote_style = "AutoPreferSingle"
|
||||
call_parentheses = "None"
|
121
bundle/nvim-lspconfig-latest/CONTRIBUTING.md
vendored
Normal file
121
bundle/nvim-lspconfig-latest/CONTRIBUTING.md
vendored
Normal file
@ -0,0 +1,121 @@
|
||||
## 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
|
||||
cmd = { 'typescript-language-server', '--stdio' }
|
||||
```
|
||||
|
||||
* `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/lsp/3.17/specification/#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/lsp/3.17/specification/#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 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 = { 'pyright-langserver', '--stdio' },
|
||||
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'
|
176
bundle/nvim-lspconfig-latest/LICENSE.md
vendored
Normal file
176
bundle/nvim-lspconfig-latest/LICENSE.md
vendored
Normal file
@ -0,0 +1,176 @@
|
||||
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
|
12
bundle/nvim-lspconfig-latest/Makefile
vendored
Normal file
12
bundle/nvim-lspconfig-latest/Makefile
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
test:
|
||||
vusted ./test
|
||||
|
||||
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
|
154
bundle/nvim-lspconfig-latest/README.md
vendored
Normal file
154
bundle/nvim-lspconfig-latest/README.md
vendored
Normal file
@ -0,0 +1,154 @@
|
||||
# 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
|
||||
|
||||
[![LuaRocks](https://img.shields.io/luarocks/v/neovim/nvim-lspconfig?logo=lua&color=purple)](https://luarocks.org/modules/neovim/nvim-lspconfig)
|
||||
|
||||
* Requires neovim version 0.8 above. Update Nvim and nvim-lspconfig before reporting an issue.
|
||||
* Install nvim-lspconfig as a normal plugin through neovim builtin `packadd` or a plugin manager
|
||||
|
||||
## 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 (\<c-x\>\<c-o\>).
|
||||
|
||||
```lua
|
||||
-- Setup language servers.
|
||||
local lspconfig = require('lspconfig')
|
||||
lspconfig.pyright.setup {}
|
||||
lspconfig.tsserver.setup {}
|
||||
lspconfig.rust_analyzer.setup {
|
||||
-- Server-specific settings. See `:help lspconfig-setup`
|
||||
settings = {
|
||||
['rust-analyzer'] = {},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
-- Global mappings.
|
||||
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
||||
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float)
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
|
||||
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist)
|
||||
|
||||
-- Use LspAttach autocommand to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
|
||||
callback = function(ev)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
|
||||
|
||||
-- Buffer local mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local opts = { buffer = ev.buf }
|
||||
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', '<C-k>', vim.lsp.buf.signature_help, opts)
|
||||
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
|
||||
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
|
||||
vim.keymap.set('n', '<space>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, opts)
|
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
|
||||
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
|
||||
vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
|
||||
vim.keymap.set('n', '<space>f', function()
|
||||
vim.lsp.buf.format { async = true }
|
||||
end, opts)
|
||||
end,
|
||||
})
|
||||
```
|
||||
|
||||
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 <config_name>` 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 <client_id>` Defaults to stopping all buffer clients.
|
||||
* `:LspRestart <client_id>` 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).
|
||||
|
||||
## License
|
||||
|
||||
Copyright Neovim contributors. All rights reserved.
|
||||
|
||||
nvim-lspconfig is licensed under the terms of the Apache 2.0 license.
|
||||
|
||||
See [LICENSE.md](./LICENSE.md)
|
651
bundle/nvim-lspconfig-latest/doc/lspconfig.txt
vendored
Normal file
651
bundle/nvim-lspconfig-latest/doc/lspconfig.txt
vendored
Normal file
@ -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 <string, string|table|bool|function>`
|
||||
|
||||
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 <string, string|table|bool>`
|
||||
|
||||
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 <string, string|table|bool>`
|
||||
|
||||
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 = lspconfig.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.fn.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 <config_name>` 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 <client_id>` 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 <client_id> ++force`
|
||||
- `:LspRestart <client_id>` 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', '<space>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', '<space>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 <c-x><c-o>
|
||||
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', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<space>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, bufopts)
|
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set('n', '<space>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:
|
10693
bundle/nvim-lspconfig-latest/doc/server_configurations.md
vendored
Normal file
10693
bundle/nvim-lspconfig-latest/doc/server_configurations.md
vendored
Normal file
File diff suppressed because it is too large
Load Diff
10693
bundle/nvim-lspconfig-latest/doc/server_configurations.txt
vendored
Normal file
10693
bundle/nvim-lspconfig-latest/doc/server_configurations.txt
vendored
Normal file
File diff suppressed because it is too large
Load Diff
41
bundle/nvim-lspconfig-latest/flake.lock
generated
vendored
Normal file
41
bundle/nvim-lspconfig-latest/flake.lock
generated
vendored
Normal file
@ -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
|
||||
}
|
19
bundle/nvim-lspconfig-latest/flake.nix
vendored
Normal file
19
bundle/nvim-lspconfig-latest/flake.nix
vendored
Normal file
@ -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
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
59
bundle/nvim-lspconfig-latest/lua/lspconfig.lua
vendored
Normal file
59
bundle/nvim-lspconfig-latest/lua/lspconfig.lua
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
local configs = require 'lspconfig.configs'
|
||||
|
||||
local M = {
|
||||
util = require 'lspconfig.util',
|
||||
}
|
||||
|
||||
---@class Alias
|
||||
---@field to string The new name of the server
|
||||
---@field version string The version that the alias will be removed in
|
||||
---@param name string
|
||||
---@return Alias
|
||||
local function server_alias(name)
|
||||
local aliases = {
|
||||
['fennel-ls'] = {
|
||||
to = 'fennel_ls',
|
||||
version = '0.2.0',
|
||||
},
|
||||
['starlark-rust'] = {
|
||||
to = 'starlark_rust',
|
||||
version = '0.2.0',
|
||||
},
|
||||
sumneko_lua = {
|
||||
to = 'lua_ls',
|
||||
version = '0.2.0',
|
||||
},
|
||||
}
|
||||
|
||||
return aliases[name]
|
||||
end
|
||||
|
||||
local mt = {}
|
||||
function mt:__index(k)
|
||||
if configs[k] == nil then
|
||||
local alias = server_alias(k)
|
||||
if alias then
|
||||
vim.deprecate(k, alias.to, alias.version, 'lspconfig', false)
|
||||
k = alias.to
|
||||
end
|
||||
|
||||
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)
|
350
bundle/nvim-lspconfig-latest/lua/lspconfig/configs.lua
vendored
Normal file
350
bundle/nvim-lspconfig-latest/lua/lspconfig/configs.lua
vendored
Normal file
@ -0,0 +1,350 @@
|
||||
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 = {}
|
||||
|
||||
local function reenter()
|
||||
if vim.in_fast_event() then
|
||||
local co = assert(coroutine.running())
|
||||
vim.schedule(function()
|
||||
coroutine.resume(co)
|
||||
end)
|
||||
coroutine.yield()
|
||||
end
|
||||
end
|
||||
|
||||
local function async_run(func)
|
||||
coroutine.resume(coroutine.create(function()
|
||||
local status, err = pcall(func)
|
||||
if not status then
|
||||
vim.notify(('[lspconfig] unhandled error: %s'):format(tostring(err)), vim.log.levels.WARN)
|
||||
end
|
||||
end))
|
||||
end
|
||||
|
||||
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.default_config.deprecate then
|
||||
vim.deprecate(
|
||||
config_name,
|
||||
config_def.default_config.deprecate.to,
|
||||
config_def.default_config.deprecate.version,
|
||||
'lspconfig',
|
||||
false
|
||||
)
|
||||
end
|
||||
|
||||
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 config.cmd and type(config.cmd) == 'table' and not vim.tbl_isempty(config.cmd) then
|
||||
local original = config.cmd[1]
|
||||
config.cmd[1] = vim.fn.exepath(config.cmd[1])
|
||||
if #config.cmd[1] == 0 then
|
||||
config.cmd[1] = original
|
||||
end
|
||||
end
|
||||
|
||||
if util.on_setup then
|
||||
pcall(util.on_setup, config, user_config)
|
||||
end
|
||||
|
||||
if config.autostart == true then
|
||||
local event_conf = config.filetypes and { event = 'FileType', pattern = config.filetypes }
|
||||
or { event = 'BufReadPost' }
|
||||
api.nvim_create_autocmd(event_conf.event, {
|
||||
pattern = event_conf.pattern or '*',
|
||||
callback = function(opt)
|
||||
M.manager.try_add(opt.buf)
|
||||
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(bufnr)
|
||||
bufnr = bufnr or api.nvim_get_current_buf()
|
||||
local bufname = api.nvim_buf_get_name(bufnr)
|
||||
if (#bufname == 0 and not config.single_file_support) or (#bufname ~= 0 and not util.bufname_valid(bufname)) then
|
||||
return
|
||||
end
|
||||
|
||||
local pwd = uv.cwd()
|
||||
|
||||
async_run(function()
|
||||
local root_dir
|
||||
if get_root_dir then
|
||||
root_dir = get_root_dir(util.path.sanitize(bufname), bufnr)
|
||||
reenter()
|
||||
if not api.nvim_buf_is_valid(bufnr) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
if root_dir then
|
||||
api.nvim_create_autocmd('BufReadPost', {
|
||||
pattern = fn.fnameescape(root_dir) .. '/*',
|
||||
callback = function(arg)
|
||||
M.manager.try_add_wrapper(arg.buf, root_dir)
|
||||
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 _, buf in ipairs(api.nvim_list_bufs()) do
|
||||
local buf_name = api.nvim_buf_get_name(buf)
|
||||
if util.bufname_valid(buf_name) then
|
||||
local buf_dir = util.path.sanitize(buf_name)
|
||||
if buf_dir:sub(1, root_dir:len()) == root_dir then
|
||||
M.manager.try_add_wrapper(buf, root_dir)
|
||||
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.
|
||||
if not api.nvim_buf_is_valid(bufnr) or (#bufname ~= 0 and not util.bufname_valid(bufname)) then
|
||||
return
|
||||
end
|
||||
local pseudo_root = #bufname == 0 and pwd or util.path.dirname(util.path.sanitize(bufname))
|
||||
M.manager.add(pseudo_root, true, bufnr)
|
||||
end
|
||||
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 = 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, project_root)
|
||||
bufnr = bufnr or api.nvim_get_current_buf()
|
||||
|
||||
if api.nvim_buf_get_option(bufnr, 'buftype') == 'nofile' then
|
||||
return
|
||||
end
|
||||
local pwd = uv.cwd()
|
||||
|
||||
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
|
||||
|
||||
if project_root then
|
||||
manager.add(project_root, false, bufnr)
|
||||
return
|
||||
end
|
||||
|
||||
local buf_path = util.path.sanitize(bufname)
|
||||
|
||||
async_run(function()
|
||||
local root_dir
|
||||
if get_root_dir then
|
||||
root_dir = get_root_dir(buf_path, bufnr)
|
||||
reenter()
|
||||
if not api.nvim_buf_is_valid(bufnr) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
if root_dir then
|
||||
manager.add(root_dir, false, bufnr)
|
||||
elseif config.single_file_support then
|
||||
local pseudo_root = #bufname == 0 and pwd or util.path.dirname(buf_path)
|
||||
manager.add(pseudo_root, true, bufnr)
|
||||
end
|
||||
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, project_root)
|
||||
-- `config.filetypes = nil` means all filetypes are valid.
|
||||
if not config.filetypes or vim.tbl_contains(config.filetypes, vim.bo[bufnr].filetype) then
|
||||
manager.try_add(bufnr, project_root)
|
||||
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)
|
||||
end
|
||||
|
||||
return setmetatable({}, configs)
|
37
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/als.lua
vendored
Normal file
37
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/als.lua
vendored
Normal file
@ -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")]],
|
||||
},
|
||||
},
|
||||
}
|
78
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/anakin_language_server.lua
vendored
Normal file
78
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/anakin_language_server.lua
vendored
Normal file
@ -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
|
||||
]],
|
||||
},
|
||||
}
|
67
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/angularls.lua
vendored
Normal file
67
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/angularls.lua
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
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())
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = {
|
||||
'ngserver',
|
||||
'--stdio',
|
||||
'--tsProbeLocations',
|
||||
default_probe_dir,
|
||||
'--ngProbeLocations',
|
||||
default_probe_dir,
|
||||
},
|
||||
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")]],
|
||||
},
|
||||
},
|
||||
}
|
43
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/ansiblels.lua
vendored
Normal file
43
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/ansiblels.lua
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'ansible-language-server', '--stdio' },
|
||||
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
|
||||
```
|
||||
]],
|
||||
},
|
||||
}
|
19
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/antlersls.lua
vendored
Normal file
19
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/antlersls.lua
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'antlersls', '--stdio' },
|
||||
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
|
||||
```
|
||||
]],
|
||||
},
|
||||
}
|
46
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/apex_ls.lua
vendored
Normal file
46
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/apex_ls.lua
vendored
Normal file
@ -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')]],
|
||||
},
|
||||
},
|
||||
}
|
92
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/arduino_language_server.lua
vendored
Normal file
92
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/arduino_language_server.lua
vendored
Normal file
@ -0,0 +1,92 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
local default_capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
default_capabilities.textDocument.semanticTokens = vim.NIL
|
||||
default_capabilities.workspace.semanticTokens = vim.NIL
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
filetypes = { 'arduino' },
|
||||
root_dir = util.root_pattern '*.ino',
|
||||
cmd = {
|
||||
'arduino-language-server',
|
||||
},
|
||||
capabilities = default_capabilities,
|
||||
},
|
||||
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).
|
||||
|
||||
The language server also requires `clangd` to be installed. Follow [these
|
||||
installation instructions](https://clangd.llvm.org/installation) for your
|
||||
platform.
|
||||
|
||||
If you don't have a sketch yet create one.
|
||||
|
||||
```sh
|
||||
$ arduino-cli sketch new test
|
||||
$ cd test
|
||||
```
|
||||
|
||||
You will need a `sketch.json` file in order for the language server to understand your project. It will also save you passing options to `arduino-cli` each time you compile or upload a file. You can generate the file like using the following commands.
|
||||
|
||||
|
||||
First gather some information about your board. Make sure your board is connected and run the following:
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
Then generate the file:
|
||||
|
||||
```sh
|
||||
arduino-cli board attach -p /dev/ttyACM0 test.ino
|
||||
```
|
||||
|
||||
The resulting file should like like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"cpu": {
|
||||
"fqbn": "arduino:avr:uno",
|
||||
"name": "Arduino Uno",
|
||||
"port": "serial:///dev/ttyACM0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Your folder structure should look like this:
|
||||
|
||||
```
|
||||
.
|
||||
├── test.ino
|
||||
└── sketch.json
|
||||
```
|
||||
|
||||
For further instruction about configuration options, run `arduino-language-server --help`.
|
||||
|
||||
Note that an upstream bug makes keywords in some cases become undefined by the language server.
|
||||
Ref: https://github.com/arduino/arduino-ide/issues/159
|
||||
]],
|
||||
},
|
||||
}
|
19
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/asm_lsp.lua
vendored
Normal file
19
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/asm_lsp.lua
vendored
Normal file
@ -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
|
||||
]],
|
||||
},
|
||||
}
|
35
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/astro.lua
vendored
Normal file
35
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/astro.lua
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
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
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'astro-ls', '--stdio' },
|
||||
filetypes = { 'astro' },
|
||||
root_dir = util.root_pattern('package.json', 'tsconfig.json', 'jsconfig.json', '.git'),
|
||||
init_options = {
|
||||
typescript = {},
|
||||
},
|
||||
on_new_config = function(new_config, new_root_dir)
|
||||
if vim.tbl_get(new_config.init_options, 'typescript') and not 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/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")]],
|
||||
},
|
||||
},
|
||||
}
|
22
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/awk_ls.lua
vendored
Normal file
22
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/awk_ls.lua
vendored
Normal file
@ -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
|
||||
```
|
||||
]],
|
||||
},
|
||||
}
|
44
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/azure_pipelines_ls.lua
vendored
Normal file
44
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/azure_pipelines_ls.lua
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'azure-pipelines-language-server', '--stdio' },
|
||||
filetypes = { 'yaml' },
|
||||
root_dir = util.root_pattern 'azure-pipelines.yml',
|
||||
single_file_support = true,
|
||||
settings = {},
|
||||
},
|
||||
docs = {
|
||||
description = [[
|
||||
https://github.com/microsoft/azure-pipelines-language-server
|
||||
|
||||
An Azure Pipelines language server
|
||||
|
||||
`azure-pipelines-ls` can be installed via `npm`:
|
||||
|
||||
```sh
|
||||
npm install -g azure-pipelines-language-server
|
||||
```
|
||||
|
||||
By default `azure-pipelines-ls` will only work in files named `azure-pipelines.yml`, this can be changed by providing additional settings like so:
|
||||
```lua
|
||||
require("lspconfig").azure_pipelines_ls.setup {
|
||||
... -- other configuration for setup {}
|
||||
settings = {
|
||||
yaml = {
|
||||
schemas = {
|
||||
["https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/master/service-schema.json"] = {
|
||||
"/azure-pipeline*.y*l",
|
||||
"/*.azure*",
|
||||
"Azure-Pipelines/**/*.y*l",
|
||||
"Pipelines/*.y*l",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
The Azure Pipelines LSP is a fork of `yaml-language-server` and as such the same settings can be passed to it as `yaml-language-server`.
|
||||
]],
|
||||
},
|
||||
}
|
37
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/bashls.lua
vendored
Normal file
37
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/bashls.lua
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'bash-language-server', 'start' },
|
||||
settings = {
|
||||
bashIde = {
|
||||
-- Glob pattern for finding and parsing shell script files in the workspace.
|
||||
-- Used by the background analysis features across files.
|
||||
|
||||
-- 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)".
|
||||
globPattern = 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/bash-lsp/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]],
|
||||
},
|
||||
},
|
||||
}
|
24
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/beancount.lua
vendored
Normal file
24
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/beancount.lua
vendored
Normal file
@ -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")]],
|
||||
},
|
||||
},
|
||||
}
|
47
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/bicep.lua
vendored
Normal file
47
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/bicep.lua
vendored
Normal file
@ -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]],
|
||||
},
|
||||
},
|
||||
}
|
30
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/blueprint_ls.lua
vendored
Normal file
30
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/blueprint_ls.lua
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'blueprint-compiler', 'lsp' },
|
||||
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 blueprint markup language, written in python and part
|
||||
of the blueprint-compiler.
|
||||
]],
|
||||
default_config = {
|
||||
root_dir = [[util.find_git_ancestor]],
|
||||
},
|
||||
},
|
||||
}
|
23
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/bright_script.lua
vendored
Normal file
23
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/bright_script.lua
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
local util = require 'lspconfig/util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'bsc', '--lsp', '--stdio' },
|
||||
filetypes = { 'brs' },
|
||||
single_file_support = true,
|
||||
root_dir = util.root_pattern('makefile', 'Makefile', '.git'),
|
||||
},
|
||||
docs = {
|
||||
description = [[
|
||||
https://github.com/RokuCommunity/brighterscript
|
||||
|
||||
`brightscript` can be installed via `npm`:
|
||||
```sh
|
||||
npm install -g brighterscript
|
||||
```
|
||||
]],
|
||||
default_config = {
|
||||
root_dir = [[root_pattern(".git")]],
|
||||
},
|
||||
},
|
||||
}
|
19
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/bsl_ls.lua
vendored
Normal file
19
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/bsl_ls.lua
vendored
Normal file
@ -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")]],
|
||||
},
|
||||
},
|
||||
}
|
27
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/buck2.lua
vendored
Normal file
27
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/buck2.lua
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'buck2', 'lsp' },
|
||||
filetypes = { 'bzl' },
|
||||
root_dir = function(fname)
|
||||
return util.root_pattern '.buckconfig'(fname)
|
||||
end,
|
||||
},
|
||||
docs = {
|
||||
description = [=[
|
||||
https://github.com/facebook/buck2
|
||||
|
||||
Build system, successor to Buck
|
||||
|
||||
To better detect Buck2 project files, the following can be added:
|
||||
|
||||
```
|
||||
vim.cmd [[ autocmd BufRead,BufNewFile *.bxl,BUCK,TARGETS set filetype=bzl ]]
|
||||
```
|
||||
]=],
|
||||
default_config = {
|
||||
root_dir = [[root_pattern(".buckconfig")]],
|
||||
},
|
||||
},
|
||||
}
|
18
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/buddy_ls.lua
vendored
Normal file
18
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/buddy_ls.lua
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'buddy-lsp-server' },
|
||||
filetypes = { 'mlir' },
|
||||
root_dir = util.find_git_ancestor,
|
||||
single_file_support = true,
|
||||
},
|
||||
docs = {
|
||||
description = [[
|
||||
https://github.com/buddy-compiler/buddy-mlir#buddy-lsp-server
|
||||
The Language Server for the buddy-mlir, a drop-in replacement for mlir-lsp-server,
|
||||
supporting new dialects defined in buddy-mlir.
|
||||
`buddy-lsp-server` can be installed at the buddy-mlir repository (buddy-compiler/buddy-mlir)
|
||||
]],
|
||||
},
|
||||
}
|
26
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/bufls.lua
vendored
Normal file
26
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/bufls.lua
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'bufls', 'serve' },
|
||||
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")]],
|
||||
},
|
||||
},
|
||||
}
|
32
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/cadence.lua
vendored
Normal file
32
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/cadence.lua
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'flow', 'cadence', 'language-server' },
|
||||
filetypes = { 'cdc' },
|
||||
init_options = {
|
||||
numberOfAccounts = '1',
|
||||
},
|
||||
root_dir = function(fname, _)
|
||||
return util.root_pattern 'flow.json'(fname) or vim.env.HOME
|
||||
end,
|
||||
on_new_config = function(new_config, new_root_dir)
|
||||
new_config.init_options.configPath = util.path.join(new_root_dir, 'flow.json')
|
||||
end,
|
||||
},
|
||||
docs = {
|
||||
description = [[
|
||||
[Cadence Language Server](https://github.com/onflow/cadence-tools/tree/master/languageserver)
|
||||
using the [flow-cli](https://developers.flow.com/tools/flow-cli).
|
||||
|
||||
The `flow` command from flow-cli must be available. For install instructions see
|
||||
[the docs](https://developers.flow.com/tools/flow-cli/install#install-the-flow-cli) or the
|
||||
[Github page](https://github.com/onflow/flow-cli).
|
||||
|
||||
By default the configuration is taken from the closest `flow.json` or the `flow.json` in the users home directory.
|
||||
]],
|
||||
default_config = {
|
||||
root_dir = [[util.root_pattern('flow.json') or vim.env.HOME]],
|
||||
},
|
||||
},
|
||||
}
|
33
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/cairo_ls.lua
vendored
Normal file
33
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/cairo_ls.lua
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
local bin_name = 'cairo-language-server'
|
||||
local cmd = { bin_name, '/C', '--node-ipc' }
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
init_options = { hostInfo = 'neovim' },
|
||||
cmd = cmd,
|
||||
filetypes = { 'cairo' },
|
||||
root_dir = function(fname)
|
||||
return util.root_pattern 'Scarb.toml'(fname)
|
||||
or util.root_pattern('Scarb.toml', 'cairo_project.toml', '.git')(fname)
|
||||
end,
|
||||
},
|
||||
docs = {
|
||||
description = [[
|
||||
[Cairo Language Server](https://github.com/starkware-libs/cairo/tree/main/crates/cairo-lang-language-server)
|
||||
|
||||
First, install cairo following [this tutorial](https://medium.com/@elias.tazartes/ahead-of-the-curve-install-cairo-1-0-alpha-and-prepare-for-regenesis-85f4e3940e20)
|
||||
|
||||
Then enable cairo language server in your lua configuration.
|
||||
```lua
|
||||
require'lspconfig'.cairo_ls.setup{}
|
||||
```
|
||||
|
||||
*cairo-language-server is still under active development, some features might not work yet !*
|
||||
]],
|
||||
default_config = {
|
||||
root_dir = [[root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git")]],
|
||||
},
|
||||
},
|
||||
}
|
50
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/ccls.lua
vendored
Normal file
50
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/ccls.lua
vendored
Normal file
@ -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')]],
|
||||
},
|
||||
},
|
||||
}
|
88
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/clangd.lua
vendored
Normal file
88
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/clangd.lua
vendored
Normal file
@ -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]],
|
||||
},
|
||||
},
|
||||
}
|
19
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/clarity_lsp.lua
vendored
Normal file
19
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/clarity_lsp.lua
vendored
Normal file
@ -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")]],
|
||||
},
|
||||
},
|
||||
}
|
19
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/clojure_lsp.lua
vendored
Normal file
19
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/clojure_lsp.lua
vendored
Normal file
@ -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', 'bb.edn'),
|
||||
},
|
||||
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", "bb.edn")]],
|
||||
},
|
||||
},
|
||||
}
|
26
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/cmake.lua
vendored
Normal file
26
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/cmake.lua
vendored
Normal file
@ -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')]],
|
||||
},
|
||||
},
|
||||
}
|
17
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/cobol_ls.lua
vendored
Normal file
17
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/cobol_ls.lua
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'cobol-language-support' },
|
||||
filetypes = { 'cobol' },
|
||||
root_dir = util.find_git_ancestor,
|
||||
},
|
||||
docs = {
|
||||
description = [[
|
||||
Cobol language support
|
||||
]],
|
||||
default_config = {
|
||||
root_dir = [[util.find_git_ancestor]],
|
||||
},
|
||||
},
|
||||
}
|
48
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/codeqlls.lua
vendored
Normal file
48
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/codeqlls.lua
vendored
Normal file
@ -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,
|
||||
}
|
21
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/coffeesense.lua
vendored
Normal file
21
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/coffeesense.lua
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'coffeesense-language-server', '--stdio' },
|
||||
filetypes = { 'coffee' },
|
||||
root_dir = util.root_pattern 'package.json',
|
||||
single_file_support = true,
|
||||
},
|
||||
docs = {
|
||||
description = [[
|
||||
https://github.com/phil294/coffeesense
|
||||
|
||||
CoffeeSense Language Server
|
||||
`coffeesense-language-server` can be installed via `npm`:
|
||||
```sh
|
||||
npm install -g coffeesense-language-server
|
||||
```
|
||||
]],
|
||||
},
|
||||
}
|
20
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/crystalline.lua
vendored
Normal file
20
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/crystalline.lua
vendored
Normal file
@ -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')]],
|
||||
},
|
||||
},
|
||||
}
|
23
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/csharp_ls.lua
vendored
Normal file
23
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/csharp_ls.lua
vendored
Normal file
@ -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`.
|
||||
]],
|
||||
},
|
||||
}
|
42
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/cssls.lua
vendored
Normal file
42
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/cssls.lua
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'vscode-css-language-server', '--stdio' },
|
||||
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]],
|
||||
},
|
||||
},
|
||||
}
|
24
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/cssmodules_ls.lua
vendored
Normal file
24
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/cssmodules_ls.lua
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'cssmodules-language-server' },
|
||||
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")]],
|
||||
},
|
||||
},
|
||||
}
|
26
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/cucumber_language_server.lua
vendored
Normal file
26
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/cucumber_language_server.lua
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'cucumber-language-server', '--stdio' },
|
||||
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]],
|
||||
},
|
||||
},
|
||||
}
|
57
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/custom_elements_ls.lua
vendored
Normal file
57
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/custom_elements_ls.lua
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
init_options = { hostInfo = 'neovim' },
|
||||
cmd = { 'custom-elements-languageserver', '--stdio' },
|
||||
filetypes = {
|
||||
'javascript',
|
||||
'javascriptreact',
|
||||
'javascript.jsx',
|
||||
'typescript',
|
||||
'typescriptreact',
|
||||
'typescript.tsx',
|
||||
'html',
|
||||
},
|
||||
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/Matsuuu/custom-elements-language-server
|
||||
|
||||
`custom-elements-languageserver` depends on `typescript`. Both packages can be installed via `npm`:
|
||||
```sh
|
||||
npm install -g typescript custom-elements-languageserver
|
||||
```
|
||||
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"
|
||||
]
|
||||
}
|
||||
|
||||
The best way to utilize the Custom Elements Language Server is to enable the [Custom Elements Manifest](https://github.com/webcomponents/custom-elements-manifest)(CEM) in your project by installing
|
||||
a CEM generator like one provided by [The Open WC Team](https://github.com/open-wc/custom-elements-manifest/tree/master/packages/analyzer).
|
||||
|
||||
Generating a CEM in watch mode will provide you with the best user experience. If your dependencies ship with a Custom Elements Manifest, those will be utilized also.
|
||||
|
||||
```
|
||||
]],
|
||||
default_config = {
|
||||
root_dir = [[root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git")]],
|
||||
},
|
||||
},
|
||||
}
|
22
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/dafny.lua
vendored
Normal file
22
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/dafny.lua
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'dafny', 'server' },
|
||||
filetypes = { 'dfy', 'dafny' },
|
||||
root_dir = function(fname)
|
||||
util.find_git_ancestor(fname)
|
||||
end,
|
||||
single_file_support = true,
|
||||
},
|
||||
docs = {
|
||||
description = [[
|
||||
Support for the Dafny language server.
|
||||
|
||||
The default `cmd` uses "dafny server", which works on Dafny 4.0.0+. For
|
||||
older versions of Dafny, you can compile the language server from source at
|
||||
[dafny-lang/language-server-csharp](https://github.com/dafny-lang/language-server-csharp)
|
||||
and set `cmd = {"dotnet", "<Path to your language server>"}`.
|
||||
]],
|
||||
},
|
||||
}
|
22
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/dagger.lua
vendored
Normal file
22
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/dagger.lua
vendored
Normal file
@ -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")]],
|
||||
},
|
||||
},
|
||||
}
|
32
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/dartls.lua
vendored
Normal file
32
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/dartls.lua
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'dart', 'language-server', '--protocol=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")]],
|
||||
},
|
||||
},
|
||||
}
|
128
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/denols.lua
vendored
Normal file
128
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/denols.lua
vendored
Normal file
@ -0,0 +1,128 @@
|
||||
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('deno/cache', params, function(err, _result, ctx)
|
||||
if err then
|
||||
local uri = ctx.params.referrer.uri
|
||||
vim.api.nvim_err_writeln('cache command failed for ' .. vim.uri_to_fname(uri))
|
||||
end
|
||||
end, bufnr)
|
||||
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, false, 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, config)
|
||||
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, config)
|
||||
end
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'deno', 'lsp' },
|
||||
cmd_env = { NO_COLOR = true },
|
||||
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/typeDefinition'] = denols_handler,
|
||||
['textDocument/references'] = denols_handler,
|
||||
['workspace/executeCommand'] = function(err, result, context, config)
|
||||
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, config)
|
||||
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")]],
|
||||
},
|
||||
},
|
||||
}
|
26
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/dhall_lsp_server.lua
vendored
Normal file
26
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/dhall_lsp_server.lua
vendored
Normal file
@ -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")]],
|
||||
},
|
||||
},
|
||||
}
|
22
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/diagnosticls.lua
vendored
Normal file
22
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/diagnosticls.lua
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'diagnostic-languageserver', '--stdio' },
|
||||
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',
|
||||
},
|
||||
},
|
||||
}
|
21
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/digestif.lua
vendored
Normal file
21
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/digestif.lua
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'digestif' },
|
||||
filetypes = { 'tex', 'plaintex', 'context' },
|
||||
root_dir = util.find_git_ancestor,
|
||||
single_file_support = true,
|
||||
},
|
||||
docs = {
|
||||
description = [[
|
||||
https://github.com/astoff/digestif
|
||||
|
||||
Digestif is a code analyzer, and a language server, for LaTeX, ConTeXt et caterva. It provides
|
||||
|
||||
context-sensitive completion, documentation, code navigation, and related functionality to any
|
||||
|
||||
text editor that speaks the LSP protocol.
|
||||
]],
|
||||
},
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'docker-compose-langserver', '--stdio' },
|
||||
filetypes = { 'yaml' },
|
||||
root_dir = util.root_pattern 'docker-compose.yaml',
|
||||
single_file_support = true,
|
||||
},
|
||||
docs = {
|
||||
description = [[
|
||||
https://github.com/microsoft/compose-language-service
|
||||
This project contains a language service for Docker Compose.
|
||||
|
||||
`compose-language-service` can be installed via `npm`:
|
||||
|
||||
```sh
|
||||
npm install @microsoft/compose-language-service
|
||||
```
|
||||
]],
|
||||
default_config = {
|
||||
root_dir = [[root_pattern("docker-compose.yaml")]],
|
||||
},
|
||||
},
|
||||
}
|
23
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/dockerls.lua
vendored
Normal file
23
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/dockerls.lua
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'docker-langserver', '--stdio' },
|
||||
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")]],
|
||||
},
|
||||
},
|
||||
}
|
20
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/dolmenls.lua
vendored
Normal file
20
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/dolmenls.lua
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'dolmenls' },
|
||||
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
|
||||
```
|
||||
]],
|
||||
},
|
||||
}
|
20
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/dotls.lua
vendored
Normal file
20
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/dotls.lua
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'dot-language-server', '--stdio' },
|
||||
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
|
||||
```
|
||||
]],
|
||||
},
|
||||
}
|
81
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/drools_lsp.lua
vendored
Normal file
81
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/drools_lsp.lua
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
local function get_java_bin(config)
|
||||
local java_bin = vim.tbl_get(config, 'drools', 'java', 'bin')
|
||||
if not java_bin then
|
||||
java_bin = vim.env.JAVA_HOME and util.path.join(vim.env.JAVA_HOME, 'bin', 'java') or 'java'
|
||||
if vim.fn.has 'win32' == 1 then
|
||||
java_bin = java_bin .. '.exe'
|
||||
end
|
||||
end
|
||||
return java_bin
|
||||
end
|
||||
|
||||
local function get_java_opts(config)
|
||||
local java_opts = vim.tbl_get(config, 'drools', 'java', 'opts')
|
||||
return java_opts and java_opts or {}
|
||||
end
|
||||
|
||||
local function get_jar(config)
|
||||
local jar = vim.tbl_get(config, 'drools', 'jar')
|
||||
return jar and jar or 'drools-lsp-server-jar-with-dependencies.jar'
|
||||
end
|
||||
|
||||
local function get_cmd(config)
|
||||
local cmd = vim.tbl_get(config, 'cmd')
|
||||
if not cmd then
|
||||
cmd = { get_java_bin(config) }
|
||||
for _, o in ipairs(get_java_opts(config)) do
|
||||
table.insert(cmd, o)
|
||||
end
|
||||
---@diagnostic disable-next-line:missing-parameter
|
||||
vim.list_extend(cmd, { '-jar', get_jar(config) })
|
||||
end
|
||||
return cmd
|
||||
end
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
filetypes = { 'drools' },
|
||||
root_dir = util.find_git_ancestor(),
|
||||
single_file_support = true,
|
||||
on_new_config = function(new_config)
|
||||
new_config.cmd = get_cmd(new_config)
|
||||
end,
|
||||
},
|
||||
docs = {
|
||||
description = [=[
|
||||
https://github.com/kiegroup/drools-lsp
|
||||
|
||||
Language server for the [Drools Rule Language (DRL)](https://docs.drools.org/latest/drools-docs/docs-website/drools/language-reference/#con-drl_drl-rules).
|
||||
|
||||
The `drools-lsp` server is a self-contained java jar file (`drools-lsp-server-jar-with-dependencies.jar`), and can be downloaded from [https://github.com/kiegroup/drools-lsp/releases/](https://github.com/kiegroup/drools-lsp/releases/).
|
||||
|
||||
Configuration information:
|
||||
```lua
|
||||
-- Option 1) Specify the entire command:
|
||||
require('lspconfig').drools_lsp.setup {
|
||||
cmd = { '/path/to/java', '-jar', '/path/to/drools-lsp-server-jar-with-dependencies.jar' },
|
||||
}
|
||||
|
||||
-- Option 2) Specify just the jar path (the JAVA_HOME environment variable will be respected if present):
|
||||
require('lspconfig').drools_lsp.setup {
|
||||
drools = { jar = '/path/to/drools-lsp-server-jar-with-dependencies.jar' },
|
||||
}
|
||||
|
||||
-- Option 3) Specify the java bin and/or java opts in addition to the jar path:
|
||||
require('lspconfig').drools_lsp.setup {
|
||||
drools = {
|
||||
java = { bin = '/path/to/java', opts = { '-Xmx100m' } },
|
||||
jar = '/path/to/drools-lsp-server-jar-with-dependencies.jar',
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
Neovim does not yet have automatic detection for the `drools` filetype, but it can be added with:
|
||||
```lua
|
||||
vim.cmd [[ autocmd BufNewFile,BufRead *.drl set filetype=drools ]]
|
||||
```
|
||||
]=],
|
||||
},
|
||||
}
|
80
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/ds_pinyin_lsp.lua
vendored
Normal file
80
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/ds_pinyin_lsp.lua
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
local bin_name = 'ds-pinyin-lsp'
|
||||
if vim.fn.has 'win32' == 1 then
|
||||
bin_name = bin_name .. '.exe'
|
||||
end
|
||||
|
||||
local function ds_pinyin_lsp_off(bufnr)
|
||||
bufnr = util.validate_bufnr(bufnr)
|
||||
local ds_pinyin_lsp_client = util.get_active_client_by_name(bufnr, 'ds_pinyin_lsp')
|
||||
if ds_pinyin_lsp_client then
|
||||
ds_pinyin_lsp_client.notify('$/turn/completion', {
|
||||
['completion_on'] = false,
|
||||
})
|
||||
else
|
||||
vim.notify 'notification $/turn/completion is not supported by any servers active on the current buffer'
|
||||
end
|
||||
end
|
||||
|
||||
local function ds_pinyin_lsp_on(bufnr)
|
||||
bufnr = util.validate_bufnr(bufnr)
|
||||
local ds_pinyin_lsp_client = util.get_active_client_by_name(bufnr, 'ds_pinyin_lsp')
|
||||
if ds_pinyin_lsp_client then
|
||||
ds_pinyin_lsp_client.notify('$/turn/completion', {
|
||||
['completion_on'] = true,
|
||||
})
|
||||
else
|
||||
vim.notify 'notification $/turn/completion is not supported by any servers active on the current buffer'
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { bin_name },
|
||||
filetypes = { 'markdown', 'org' },
|
||||
root_dir = util.find_git_ancestor,
|
||||
single_file_support = true,
|
||||
init_options = {
|
||||
completion_on = true,
|
||||
show_symbols = true,
|
||||
show_symbols_only_follow_by_hanzi = false,
|
||||
show_symbols_by_n_times = 0,
|
||||
match_as_same_as_input = true,
|
||||
match_long_input = true,
|
||||
max_suggest = 15,
|
||||
},
|
||||
},
|
||||
commands = {
|
||||
DsPinyinCompletionOff = {
|
||||
function()
|
||||
ds_pinyin_lsp_off(0)
|
||||
end,
|
||||
description = 'Turn off the ds-pinyin-lsp completion',
|
||||
},
|
||||
DsPinyinCompletionOn = {
|
||||
function()
|
||||
ds_pinyin_lsp_on(0)
|
||||
end,
|
||||
description = 'Turn on the ds-pinyin-lsp completion',
|
||||
},
|
||||
},
|
||||
docs = {
|
||||
description = [=[
|
||||
https://github.com/iamcco/ds-pinyin-lsp
|
||||
Dead simple Pinyin language server for input Chinese without IME(input method).
|
||||
To install, download the latest [release](https://github.com/iamcco/ds-pinyin-lsp/releases) and ensure `ds-pinyin-lsp` is on your path.
|
||||
And make ensure the database file `dict.db3` is also downloaded. And put the path to `dict.dbs` in the following code.
|
||||
|
||||
```lua
|
||||
|
||||
require('lspconfig').ds_pinyin_lsp.setup {
|
||||
init_options = {
|
||||
db_path = "your_path_to_database"
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
]=],
|
||||
},
|
||||
}
|
21
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/ecsact.lua
vendored
Normal file
21
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/ecsact.lua
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'ecsact_lsp_server', '--stdio' },
|
||||
filetypes = { 'ecsact' },
|
||||
root_dir = util.root_pattern '.git',
|
||||
single_file_support = true,
|
||||
},
|
||||
|
||||
docs = {
|
||||
description = [[
|
||||
https://github.com/ecsact-dev/ecsact_lsp_server
|
||||
|
||||
Language server for Ecsact.
|
||||
|
||||
The default cmd assumes `ecsact_lsp_server` is in your PATH. Typically from the
|
||||
Ecsact SDK: https://ecsact.dev/start
|
||||
]],
|
||||
},
|
||||
}
|
43
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/efm.lua
vendored
Normal file
43
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/efm.lua
vendored
Normal file
@ -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")]],
|
||||
},
|
||||
},
|
||||
}
|
39
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/elixirls.lua
vendored
Normal file
39
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/elixirls.lua
vendored
Normal file
@ -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()]],
|
||||
},
|
||||
},
|
||||
}
|
37
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/elmls.lua
vendored
Normal file
37
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/elmls.lua
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
local util = require 'lspconfig.util'
|
||||
local lsp = vim.lsp
|
||||
local api = vim.api
|
||||
|
||||
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 = { 'elm-language-server' },
|
||||
-- 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")]],
|
||||
},
|
||||
},
|
||||
}
|
23
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/ember.lua
vendored
Normal file
23
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/ember.lua
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'ember-language-server', '--stdio' },
|
||||
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")]],
|
||||
},
|
||||
},
|
||||
}
|
38
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/emmet_ls.lua
vendored
Normal file
38
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/emmet_ls.lua
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'emmet-ls', '--stdio' },
|
||||
filetypes = {
|
||||
'astro',
|
||||
'css',
|
||||
'eruby',
|
||||
'html',
|
||||
'htmldjango',
|
||||
'javascriptreact',
|
||||
'less',
|
||||
'pug',
|
||||
'sass',
|
||||
'scss',
|
||||
'svelte',
|
||||
'typescriptreact',
|
||||
'vue',
|
||||
},
|
||||
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,
|
||||
},
|
||||
},
|
||||
}
|
27
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/erg_language_server.lua
vendored
Normal file
27
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/erg_language_server.lua
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'erg', '--language-server' },
|
||||
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#flags ELS
|
||||
|
||||
ELS (erg-language-server) is a language server for the Erg programming language.
|
||||
|
||||
erg-language-server can be installed via `cargo` and used as follows:
|
||||
```sh
|
||||
cargo install erg --features els
|
||||
erg --language-server
|
||||
```
|
||||
]],
|
||||
default_config = {
|
||||
root_dir = [[root_pattern("package.er") or find_git_ancestor]],
|
||||
},
|
||||
},
|
||||
}
|
29
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/erlangls.lua
vendored
Normal file
29
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/erlangls.lua
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'erlang_ls' },
|
||||
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')]],
|
||||
},
|
||||
},
|
||||
}
|
55
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/esbonio.lua
vendored
Normal file
55
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/esbonio.lua
vendored
Normal file
@ -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)
|
||||
]],
|
||||
},
|
||||
}
|
190
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/eslint.lua
vendored
Normal file
190
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/eslint.lua
vendored
Normal file
@ -0,0 +1,190 @@
|
||||
local util = require 'lspconfig.util'
|
||||
local lsp = vim.lsp
|
||||
|
||||
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 root_file = {
|
||||
'.eslintrc',
|
||||
'.eslintrc.js',
|
||||
'.eslintrc.cjs',
|
||||
'.eslintrc.yaml',
|
||||
'.eslintrc.yml',
|
||||
'.eslintrc.json',
|
||||
'eslint.config.js',
|
||||
}
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'vscode-eslint-language-server', '--stdio' },
|
||||
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 = function(fname)
|
||||
root_file = util.insert_package_json(root_file, 'eslintConfig', fname)
|
||||
return util.root_pattern(unpack(root_file))(fname)
|
||||
end,
|
||||
-- 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 flat config
|
||||
if vim.fn.filereadable(new_root_dir .. '/eslint.config.js') == 1 then
|
||||
config.settings.experimental.useFlatConfig = true
|
||||
end
|
||||
|
||||
-- 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' }, config.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:
|
||||
```lua
|
||||
lspconfig.eslint.setup({
|
||||
--- ...
|
||||
on_attach = function(client, bufnr)
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
buffer = bufnr,
|
||||
command = "EslintFixAll",
|
||||
})
|
||||
end,
|
||||
})
|
||||
```
|
||||
|
||||
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`
|
||||
]],
|
||||
},
|
||||
}
|
18
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/fennel_language_server.lua
vendored
Normal file
18
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/fennel_language_server.lua
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'fennel-language-server' },
|
||||
filetypes = { 'fennel' },
|
||||
single_file_support = true,
|
||||
root_dir = util.find_git_ancestor,
|
||||
settings = {},
|
||||
},
|
||||
docs = {
|
||||
description = [[
|
||||
https://github.com/rydesun/fennel-language-server
|
||||
|
||||
Fennel language server protocol (LSP) support.
|
||||
]],
|
||||
},
|
||||
}
|
19
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/fennel_ls.lua
vendored
Normal file
19
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/fennel_ls.lua
vendored
Normal file
@ -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.
|
||||
]],
|
||||
},
|
||||
}
|
27
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/flow.lua
vendored
Normal file
27
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/flow.lua
vendored
Normal file
@ -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")]],
|
||||
},
|
||||
},
|
||||
}
|
22
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/flux_lsp.lua
vendored
Normal file
22
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/flux_lsp.lua
vendored
Normal file
@ -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]],
|
||||
},
|
||||
},
|
||||
}
|
25
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/foam_ls.lua
vendored
Normal file
25
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/foam_ls.lua
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { 'foam-ls', '--stdio' },
|
||||
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
|
||||
```
|
||||
]],
|
||||
},
|
||||
}
|
36
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/fortls.lua
vendored
Normal file
36
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/fortls.lua
vendored
Normal file
@ -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")]],
|
||||
},
|
||||
},
|
||||
}
|
32
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/fsautocomplete.lua
vendored
Normal file
32
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/fsautocomplete.lua
vendored
Normal file
@ -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).
|
||||
|
||||
]],
|
||||
},
|
||||
}
|
29
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/fsharp_language_server.lua
vendored
Normal file
29
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/fsharp_language_server.lua
vendored
Normal file
@ -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`
|
||||
]],
|
||||
},
|
||||
}
|
19
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/fstar.lua
vendored
Normal file
19
bundle/nvim-lspconfig-latest/lua/lspconfig/server_configurations/fstar.lua
vendored
Normal file
@ -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]],
|
||||
},
|
||||
},
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user