From 4ee6dfe43f991e86dabb50d7700a6edc84b7bfb6 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sun, 24 Jul 2022 16:14:35 +0800 Subject: [PATCH] chore(bundle): update bundle lspconfig --- bundle/README.md | 2 +- .../nvim-lspconfig/.github/workflows/lint.yml | 35 +-- bundle/nvim-lspconfig/.stylua.toml | 2 +- bundle/nvim-lspconfig/README.md | 4 +- .../doc/server_configurations.md | 202 +++++++++++++++--- .../doc/server_configurations.txt | 202 +++++++++++++++--- .../server_configurations/antlersls.lua | 26 +++ .../lspconfig/server_configurations/ccls.lua | 4 +- .../lspconfig/server_configurations/cmake.lua | 6 +- .../server_configurations/dartls.lua | 6 +- .../server_configurations/denols.lua | 45 ++-- .../server_configurations/emmet_ls.lua | 2 +- .../server_configurations/eslint.lua | 19 +- .../server_configurations/gradle_ls.lua | 11 + .../lspconfig/server_configurations/hls.lua | 18 +- .../lspconfig/server_configurations/m68k.lua | 36 ++++ .../lspconfig/server_configurations/nimls.lua | 2 + .../server_configurations/omnisharp.lua | 127 +++++++++-- .../server_configurations/sumneko_lua.lua | 3 +- .../server_configurations/svelte.lua | 2 + .../server_configurations/texlab.lua | 2 +- .../lspconfig/server_configurations/zk.lua | 2 +- .../lua/lspconfig/ui/lspinfo.lua | 16 +- bundle/nvim-lspconfig/lua/lspconfig/util.lua | 8 + bundle/nvim-lspconfig/neovim.toml | 31 --- bundle/nvim-lspconfig/neovim.yml | 25 +++ 26 files changed, 657 insertions(+), 181 deletions(-) create mode 100644 bundle/nvim-lspconfig/lua/lspconfig/server_configurations/antlersls.lua create mode 100644 bundle/nvim-lspconfig/lua/lspconfig/server_configurations/m68k.lua delete mode 100644 bundle/nvim-lspconfig/neovim.toml create mode 100644 bundle/nvim-lspconfig/neovim.yml diff --git a/bundle/README.md b/bundle/README.md index d8c056865..97f703088 100644 --- a/bundle/README.md +++ b/bundle/README.md @@ -31,7 +31,7 @@ In `bundle/` directory, there are two kinds of plugins: forked plugins without c - [defx.nvim](https://github.com/Shougo/defx.nvim/tree/df5e6ea6734dc002919ea41786668069fa0b497d) - [dein.vim](https://github.com/Shougo/dein.vim/tree/452b4a8b70be924d581c2724e5e218bfd2bcea14) - [indent-blankline.nvim](https://github.com/lukas-reineke/indent-blankline.nvim/tree/045d9582094b27f5ae04d8b635c6da8e97e53f1d) -- [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig/tree/c55e830aa18bd15f36f7534947ec7471f2b43af7) +- [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig/tree/dcb7ebb36f0d2aafcc640f520bb1fc8a9cc1f7c8) - [deoplete-lsp](https://github.com/deoplete-plugins/deoplete-lsp/tree/c466c955e85d995984a8135e16da71463712e5e5) - [nvim-cmp](https://github.com/hrsh7th/nvim-cmp/tree/3192a0c57837c1ec5bf298e4f3ec984c7d2d60c0) - [cmp-neosnippet](https://github.com/notomo/cmp-neosnippet/tree/2d14526af3f02dcea738b4cea520e6ce55c09979) diff --git a/bundle/nvim-lspconfig/.github/workflows/lint.yml b/bundle/nvim-lspconfig/.github/workflows/lint.yml index 9ce80136c..8279196bd 100644 --- a/bundle/nvim-lspconfig/.github/workflows/lint.yml +++ b/bundle/nvim-lspconfig/.github/workflows/lint.yml @@ -10,41 +10,24 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 - - - name: Setup luacheck - run: | - sudo apt update - sudo apt install -y lua5.1 luarocks - sudo luarocks install luacheck - - - name: Setup selene - run: | - wget "https://github.com/Kampfkarren/selene/releases/download/$VERSION/selene-$VERSION-linux.zip" - echo "$SHA256_CHECKSUM selene-$VERSION-linux.zip" > "selene-$VERSION-linux.zip.checksum" - sha256sum --check "selene-$VERSION-linux.zip.checksum" - unzip "selene-$VERSION-linux.zip" - install -Dp selene "$HOME/.local/bin/selene" - - echo "::add-matcher::.github/workflows/problem_matchers/selene.json" - env: - VERSION: "0.15.0" - SHA256_CHECKSUM: "8ff9272170158fbd9c1af38206ecadc894dc456665dc9bd9f0d43a26e5e8f1af" - - - name: Add $HOME/.local/bin to $PATH - run: echo "$HOME/.local/bin" >> $GITHUB_PATH + uses: actions/checkout@v3 - name: Run luacheck - run: luacheck lua/* test/* + uses: lunarmodules/luacheck@v0 + with: + args: lua/* test/* - name: Run selene - run: selene --display-style=quiet . + 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@v2 + uses: actions/checkout@v3 - name: Lint with stylua uses: JohnnyMorganz/stylua-action@1.0.0 diff --git a/bundle/nvim-lspconfig/.stylua.toml b/bundle/nvim-lspconfig/.stylua.toml index e548311d1..78c5507c3 100644 --- a/bundle/nvim-lspconfig/.stylua.toml +++ b/bundle/nvim-lspconfig/.stylua.toml @@ -3,4 +3,4 @@ line_endings = "Unix" indent_type = "Spaces" indent_width = 2 quote_style = "AutoPreferSingle" -no_call_parentheses = true +call_parentheses = "None" diff --git a/bundle/nvim-lspconfig/README.md b/bundle/nvim-lspconfig/README.md index bd477349f..4fb5740f3 100644 --- a/bundle/nvim-lspconfig/README.md +++ b/bundle/nvim-lspconfig/README.md @@ -10,7 +10,7 @@ See also `:help lspconfig`. ## Install -* Requires [Neovim 0.7](https://github.com/neovim/neovim/releases/tag/v0.6.1) or [Nightly](https://github.com/neovim/neovim/releases/tag/nightly). Update Nvim and nvim-lspconfig before reporting an issue. +* Requires [Neovim latest stable release](https://github.com/neovim/neovim/releases/latest) or [Nightly](https://github.com/neovim/neovim/releases/tag/nightly). Update Nvim and nvim-lspconfig before reporting an issue. * Install nvim-lspconfig like any other Vim plugin, e.g. with [packer.nvim](https://github.com/wbthomason/packer.nvim): ```lua local use = require('packer').use @@ -35,7 +35,7 @@ See also `:help lspconfig`. nvim main.py ``` 4. Run `:LspInfo` to see the status or to troubleshoot. -5. See [Keybindings and completion](#Keybindings-and-completion) to setup common mappings and omnifunc completion. +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. diff --git a/bundle/nvim-lspconfig/doc/server_configurations.md b/bundle/nvim-lspconfig/doc/server_configurations.md index 6a5affab8..f3cad71c5 100644 --- a/bundle/nvim-lspconfig/doc/server_configurations.md +++ b/bundle/nvim-lspconfig/doc/server_configurations.md @@ -8,6 +8,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running - [als](#als) - [angularls](#angularls) - [ansiblels](#ansiblels) +- [antlersls](#antlersls) - [apex_ls](#apex_ls) - [arduino_language_server](#arduino_language_server) - [asm_lsp](#asm_lsp) @@ -79,6 +80,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running - [lelwel_ls](#lelwel_ls) - [lemminx](#lemminx) - [ltex](#ltex) +- [m68k](#m68k) - [marksman](#marksman) - [metals](#metals) - [mint](#mint) @@ -307,6 +309,38 @@ require'lspconfig'.ansiblels.setup{} ``` +## antlersls + +https://www.npmjs.com/package/antlers-language-server + +`antlersls` can be installed via `npm`: +```sh +npm install -g antlers-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.antlersls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "antlersls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "html", "antlers" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + ## apex_ls https://github.com/forcedotcom/salesforcedx-vscode @@ -738,7 +772,7 @@ require'lspconfig'.ccls.setup{} ``` - `root_dir` : ```lua - + root_pattern('compile_commands.json', '.ccls', '.git') ``` - `single_file_support` : ```lua @@ -889,7 +923,7 @@ require'lspconfig'.cmake.setup{} ``` - `root_dir` : ```lua - root_pattern(".git", "compile_commands.json", "build") + root_pattern('CMakePresets.json', 'CTestConfig.cmake', '.git', 'build', 'cmake') ``` - `single_file_support` : ```lua @@ -1234,7 +1268,8 @@ require'lspconfig'.denols.setup{} ```lua { ["textDocument/definition"] = , - ["textDocument/references"] = + ["textDocument/references"] = , + ["workspace/executeCommand"] = } ``` - `init_options` : @@ -1248,6 +1283,10 @@ require'lspconfig'.denols.setup{} ```lua root_pattern("deno.json", "deno.jsonc", ".git") ``` + - `single_file_support` : + ```lua + true + ``` ## dhall_lsp_server @@ -1585,7 +1624,7 @@ require'lspconfig'.emmet_ls.setup{} ``` - `filetypes` : ```lua - { "html", "css" } + { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less" } ``` - `root_dir` : ```lua @@ -2267,6 +2306,14 @@ require'lspconfig'.gradle_ls.setup{} ```lua { "groovy" } ``` + - `init_options` : + ```lua + { + settings = { + gradleWrapperEnabled = true + } + } + ``` - `root_dir` : ```lua root_pattern("settings.gradle") @@ -2570,7 +2617,7 @@ require'lspconfig'.hie.setup{} https://github.com/haskell/haskell-language-server Haskell Language Server - + **Snippet to enable the language server:** @@ -2594,7 +2641,13 @@ require'lspconfig'.hls.setup{} ``` - `root_dir` : ```lua - root_pattern("*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml") + function (filepath) + return ( + util.root_pattern('hie.yaml', 'stack.yaml', 'cabal.project')(filepath) + or util.root_pattern('*.cabal', 'package.yaml')(filepath) + ) + end + ``` - `settings` : ```lua @@ -3345,6 +3398,51 @@ require'lspconfig'.ltex.setup{} ``` +## m68k + +https://github.com/grahambates/m68k-lsp + +Language server for Motorola 68000 family assembly + +`m68k-lsp-server` can be installed via `npm`: + +```sh +npm install -g m68k-lsp-server +``` + +Ensure you are using the 68k asm syntax variant in Neovim. + +```lua +vim.g.asmsyntax = 'asm68k' +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.m68k.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "m68k-lsp-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "asm68k" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + ## marksman https://github.com/artempyanykh/marksman @@ -3551,7 +3649,9 @@ require'lspconfig'.nickel_ls.setup{} ## nimls https://github.com/PMunch/nimlsp + `nimlsp` can be installed via the `nimble` package manager: + ```sh nimble install nimlsp ``` @@ -3692,27 +3792,51 @@ https://github.com/omnisharp/omnisharp-roslyn OmniSharp server based on Roslyn workspaces `omnisharp-roslyn` can be installed by downloading and extracting a release from [here](https://github.com/OmniSharp/omnisharp-roslyn/releases). -Omnisharp can also be built from source by following the instructions [here](https://github.com/omnisharp/omnisharp-roslyn#downloading-omnisharp). +OmniSharp can also be built from source by following the instructions [here](https://github.com/omnisharp/omnisharp-roslyn#downloading-omnisharp). -Omnisharp requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. +OmniSharp requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. **By default, omnisharp-roslyn doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. ```lua -local pid = vim.fn.getpid() --- On linux/darwin if using a release build, otherwise under scripts/OmniSharp(.Core)(.cmd) -local omnisharp_bin = "/path/to/omnisharp-repo/run" --- on Windows --- local omnisharp_bin = "/path/to/omnisharp/OmniSharp.exe" -require'lspconfig'.omnisharp.setup{ - cmd = { omnisharp_bin, "--languageserver" , "--hostPID", tostring(pid) }; - ... -} -``` +require'lspconfig'.omnisharp.setup { + cmd = { "dotnet", "/path/to/omnisharp/OmniSharp.dll" }, -Note, if you download the executable for darwin you will need to strip the quarantine label to run: -```bash -find /path/to/omnisharp-osx | xargs xattr -r -d com.apple.quarantine + -- Enables support for reading code style, naming convention and analyzer + -- settings from .editorconfig. + enable_editorconfig_support = true, + + -- If true, MSBuild project system will only load projects for files that + -- were opened in the editor. This setting is useful for big C# codebases + -- and allows for faster initialization of code navigation features only + -- for projects that are relevant to code that is being edited. With this + -- setting enabled OmniSharp may load fewer projects and may thus display + -- incomplete reference lists for symbols. + enable_ms_build_load_projects_on_demand = false, + + -- Enables support for roslyn analyzers, code fixes and rulesets. + enable_roslyn_analyzers = false, + + -- Specifies whether 'using' directives should be grouped and sorted during + -- document formatting. + organize_imports_on_format = false, + + -- Enables support for showing unimported types and unimported extension + -- methods in completion lists. When committed, the appropriate using + -- directive will be added at the top of the current file. This option can + -- have a negative impact on initial completion responsiveness, + -- particularly for the first few completion sessions after opening a + -- solution. + enable_import_completion = false, + + -- Specifies whether to include preview versions of the .NET SDK when + -- determining which version to use for project loading. + sdk_include_prereleases = true, + + -- Only run analyzers against open files when 'enableRoslynAnalyzers' is + -- true + analyze_open_documents_only = false, +} ``` @@ -3724,6 +3848,26 @@ require'lspconfig'.omnisharp.setup{} **Default values:** + - `analyze_open_documents_only` : + ```lua + false + ``` + - `enable_editorconfig_support` : + ```lua + true + ``` + - `enable_import_completion` : + ```lua + false + ``` + - `enable_ms_build_load_projects_on_demand` : + ```lua + false + ``` + - `enable_roslyn_analyzers` : + ```lua + false + ``` - `filetypes` : ```lua { "cs", "vb" } @@ -3736,10 +3880,18 @@ require'lspconfig'.omnisharp.setup{} ```lua see source file ``` + - `organize_imports_on_format` : + ```lua + false + ``` - `root_dir` : ```lua root_pattern(".sln") or root_pattern(".csproj") ``` + - `sdk_include_prereleases` : + ```lua + true + ``` ## opencl_ls @@ -5664,7 +5816,7 @@ require'lspconfig'.sumneko_lua.setup{} ``` - `root_dir` : ```lua - root_pattern(".luarc.json", ".luacheckrc", ".stylua.toml", "selene.toml", ".git") + root_pattern(".luarc.json", ".luacheckrc", ".stylua.toml", "stylua.toml", "selene.toml", ".git") ``` - `settings` : ```lua @@ -5686,6 +5838,8 @@ require'lspconfig'.sumneko_lua.setup{} https://github.com/sveltejs/language-tools/tree/master/packages/language-server +Note: assuming that [tsserver](#tsserver) is setup, full JavaScript/TypeScript support (find references, rename, etc of symbols in Svelte files when working in JS/TS files) requires per-project installation and configuration of [typescript-svelte-plugin](https://github.com/sveltejs/language-tools/tree/master/packages/typescript-plugin#usage). + `svelte-language-server` can be installed via `npm`: ```sh npm install -g svelte-language-server @@ -6060,7 +6214,7 @@ require'lspconfig'.texlab.setup{} ``` - `filetypes` : ```lua - { "tex", "bib" } + { "tex", "plaintex", "bib" } ``` - `root_dir` : ```lua @@ -6915,7 +7069,7 @@ require'lspconfig'.yamlls.setup{} ## zk -github.com/mickael-menu/zk +https://github.com/mickael-menu/zk A plain text note-taking assistant diff --git a/bundle/nvim-lspconfig/doc/server_configurations.txt b/bundle/nvim-lspconfig/doc/server_configurations.txt index 6a5affab8..f3cad71c5 100644 --- a/bundle/nvim-lspconfig/doc/server_configurations.txt +++ b/bundle/nvim-lspconfig/doc/server_configurations.txt @@ -8,6 +8,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running - [als](#als) - [angularls](#angularls) - [ansiblels](#ansiblels) +- [antlersls](#antlersls) - [apex_ls](#apex_ls) - [arduino_language_server](#arduino_language_server) - [asm_lsp](#asm_lsp) @@ -79,6 +80,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running - [lelwel_ls](#lelwel_ls) - [lemminx](#lemminx) - [ltex](#ltex) +- [m68k](#m68k) - [marksman](#marksman) - [metals](#metals) - [mint](#mint) @@ -307,6 +309,38 @@ require'lspconfig'.ansiblels.setup{} ``` +## antlersls + +https://www.npmjs.com/package/antlers-language-server + +`antlersls` can be installed via `npm`: +```sh +npm install -g antlers-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.antlersls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "antlersls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "html", "antlers" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + ## apex_ls https://github.com/forcedotcom/salesforcedx-vscode @@ -738,7 +772,7 @@ require'lspconfig'.ccls.setup{} ``` - `root_dir` : ```lua - + root_pattern('compile_commands.json', '.ccls', '.git') ``` - `single_file_support` : ```lua @@ -889,7 +923,7 @@ require'lspconfig'.cmake.setup{} ``` - `root_dir` : ```lua - root_pattern(".git", "compile_commands.json", "build") + root_pattern('CMakePresets.json', 'CTestConfig.cmake', '.git', 'build', 'cmake') ``` - `single_file_support` : ```lua @@ -1234,7 +1268,8 @@ require'lspconfig'.denols.setup{} ```lua { ["textDocument/definition"] = , - ["textDocument/references"] = + ["textDocument/references"] = , + ["workspace/executeCommand"] = } ``` - `init_options` : @@ -1248,6 +1283,10 @@ require'lspconfig'.denols.setup{} ```lua root_pattern("deno.json", "deno.jsonc", ".git") ``` + - `single_file_support` : + ```lua + true + ``` ## dhall_lsp_server @@ -1585,7 +1624,7 @@ require'lspconfig'.emmet_ls.setup{} ``` - `filetypes` : ```lua - { "html", "css" } + { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less" } ``` - `root_dir` : ```lua @@ -2267,6 +2306,14 @@ require'lspconfig'.gradle_ls.setup{} ```lua { "groovy" } ``` + - `init_options` : + ```lua + { + settings = { + gradleWrapperEnabled = true + } + } + ``` - `root_dir` : ```lua root_pattern("settings.gradle") @@ -2570,7 +2617,7 @@ require'lspconfig'.hie.setup{} https://github.com/haskell/haskell-language-server Haskell Language Server - + **Snippet to enable the language server:** @@ -2594,7 +2641,13 @@ require'lspconfig'.hls.setup{} ``` - `root_dir` : ```lua - root_pattern("*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml") + function (filepath) + return ( + util.root_pattern('hie.yaml', 'stack.yaml', 'cabal.project')(filepath) + or util.root_pattern('*.cabal', 'package.yaml')(filepath) + ) + end + ``` - `settings` : ```lua @@ -3345,6 +3398,51 @@ require'lspconfig'.ltex.setup{} ``` +## m68k + +https://github.com/grahambates/m68k-lsp + +Language server for Motorola 68000 family assembly + +`m68k-lsp-server` can be installed via `npm`: + +```sh +npm install -g m68k-lsp-server +``` + +Ensure you are using the 68k asm syntax variant in Neovim. + +```lua +vim.g.asmsyntax = 'asm68k' +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.m68k.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "m68k-lsp-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "asm68k" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + ## marksman https://github.com/artempyanykh/marksman @@ -3551,7 +3649,9 @@ require'lspconfig'.nickel_ls.setup{} ## nimls https://github.com/PMunch/nimlsp + `nimlsp` can be installed via the `nimble` package manager: + ```sh nimble install nimlsp ``` @@ -3692,27 +3792,51 @@ https://github.com/omnisharp/omnisharp-roslyn OmniSharp server based on Roslyn workspaces `omnisharp-roslyn` can be installed by downloading and extracting a release from [here](https://github.com/OmniSharp/omnisharp-roslyn/releases). -Omnisharp can also be built from source by following the instructions [here](https://github.com/omnisharp/omnisharp-roslyn#downloading-omnisharp). +OmniSharp can also be built from source by following the instructions [here](https://github.com/omnisharp/omnisharp-roslyn#downloading-omnisharp). -Omnisharp requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. +OmniSharp requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. **By default, omnisharp-roslyn doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. ```lua -local pid = vim.fn.getpid() --- On linux/darwin if using a release build, otherwise under scripts/OmniSharp(.Core)(.cmd) -local omnisharp_bin = "/path/to/omnisharp-repo/run" --- on Windows --- local omnisharp_bin = "/path/to/omnisharp/OmniSharp.exe" -require'lspconfig'.omnisharp.setup{ - cmd = { omnisharp_bin, "--languageserver" , "--hostPID", tostring(pid) }; - ... -} -``` +require'lspconfig'.omnisharp.setup { + cmd = { "dotnet", "/path/to/omnisharp/OmniSharp.dll" }, -Note, if you download the executable for darwin you will need to strip the quarantine label to run: -```bash -find /path/to/omnisharp-osx | xargs xattr -r -d com.apple.quarantine + -- Enables support for reading code style, naming convention and analyzer + -- settings from .editorconfig. + enable_editorconfig_support = true, + + -- If true, MSBuild project system will only load projects for files that + -- were opened in the editor. This setting is useful for big C# codebases + -- and allows for faster initialization of code navigation features only + -- for projects that are relevant to code that is being edited. With this + -- setting enabled OmniSharp may load fewer projects and may thus display + -- incomplete reference lists for symbols. + enable_ms_build_load_projects_on_demand = false, + + -- Enables support for roslyn analyzers, code fixes and rulesets. + enable_roslyn_analyzers = false, + + -- Specifies whether 'using' directives should be grouped and sorted during + -- document formatting. + organize_imports_on_format = false, + + -- Enables support for showing unimported types and unimported extension + -- methods in completion lists. When committed, the appropriate using + -- directive will be added at the top of the current file. This option can + -- have a negative impact on initial completion responsiveness, + -- particularly for the first few completion sessions after opening a + -- solution. + enable_import_completion = false, + + -- Specifies whether to include preview versions of the .NET SDK when + -- determining which version to use for project loading. + sdk_include_prereleases = true, + + -- Only run analyzers against open files when 'enableRoslynAnalyzers' is + -- true + analyze_open_documents_only = false, +} ``` @@ -3724,6 +3848,26 @@ require'lspconfig'.omnisharp.setup{} **Default values:** + - `analyze_open_documents_only` : + ```lua + false + ``` + - `enable_editorconfig_support` : + ```lua + true + ``` + - `enable_import_completion` : + ```lua + false + ``` + - `enable_ms_build_load_projects_on_demand` : + ```lua + false + ``` + - `enable_roslyn_analyzers` : + ```lua + false + ``` - `filetypes` : ```lua { "cs", "vb" } @@ -3736,10 +3880,18 @@ require'lspconfig'.omnisharp.setup{} ```lua see source file ``` + - `organize_imports_on_format` : + ```lua + false + ``` - `root_dir` : ```lua root_pattern(".sln") or root_pattern(".csproj") ``` + - `sdk_include_prereleases` : + ```lua + true + ``` ## opencl_ls @@ -5664,7 +5816,7 @@ require'lspconfig'.sumneko_lua.setup{} ``` - `root_dir` : ```lua - root_pattern(".luarc.json", ".luacheckrc", ".stylua.toml", "selene.toml", ".git") + root_pattern(".luarc.json", ".luacheckrc", ".stylua.toml", "stylua.toml", "selene.toml", ".git") ``` - `settings` : ```lua @@ -5686,6 +5838,8 @@ require'lspconfig'.sumneko_lua.setup{} https://github.com/sveltejs/language-tools/tree/master/packages/language-server +Note: assuming that [tsserver](#tsserver) is setup, full JavaScript/TypeScript support (find references, rename, etc of symbols in Svelte files when working in JS/TS files) requires per-project installation and configuration of [typescript-svelte-plugin](https://github.com/sveltejs/language-tools/tree/master/packages/typescript-plugin#usage). + `svelte-language-server` can be installed via `npm`: ```sh npm install -g svelte-language-server @@ -6060,7 +6214,7 @@ require'lspconfig'.texlab.setup{} ``` - `filetypes` : ```lua - { "tex", "bib" } + { "tex", "plaintex", "bib" } ``` - `root_dir` : ```lua @@ -6915,7 +7069,7 @@ require'lspconfig'.yamlls.setup{} ## zk -github.com/mickael-menu/zk +https://github.com/mickael-menu/zk A plain text note-taking assistant diff --git a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/antlersls.lua b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/antlersls.lua new file mode 100644 index 000000000..28fa0d0cc --- /dev/null +++ b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/antlersls.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +local bin_name = 'antlersls' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'html', 'antlers' }, + root_dir = util.root_pattern 'composer.json', + }, + docs = { + description = [[ +https://www.npmjs.com/package/antlers-language-server + +`antlersls` can be installed via `npm`: +```sh +npm install -g antlers-language-server +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/ccls.lua b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/ccls.lua index 27c0fd447..3009a6415 100644 --- a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/ccls.lua +++ b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/ccls.lua @@ -44,9 +44,7 @@ lspconfig.ccls.setup { ]], default_config = { - root_dir = function(fname) - return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) - end, + root_dir = [[root_pattern('compile_commands.json', '.ccls', '.git')]], }, }, } diff --git a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/cmake.lua b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/cmake.lua index d3345357e..7f27fea0b 100644 --- a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/cmake.lua +++ b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/cmake.lua @@ -1,12 +1,12 @@ local util = require 'lspconfig.util' -local root_files = { 'CMakeLists.txt', 'cmake' } +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) or util.find_git_ancestor(fname) + return util.root_pattern(unpack(root_files))(fname) end, single_file_support = true, init_options = { @@ -20,7 +20,7 @@ https://github.com/regen100/cmake-language-server CMake LSP Implementation ]], default_config = { - root_dir = [[root_pattern(".git", "compile_commands.json", "build")]], + root_dir = [[root_pattern('CMakePresets.json', 'CTestConfig.cmake', '.git', 'build', 'cmake')]], }, }, } diff --git a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/dartls.lua b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/dartls.lua index 83eda99f2..9708b7e27 100644 --- a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/dartls.lua +++ b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/dartls.lua @@ -1,8 +1,12 @@ local util = require 'lspconfig.util' +local cmd = (vim.fn.has 'win32' == 1 + and { 'cmd.exe', '/C', 'dart', 'language-server', '--protocol=lsp' } + or { 'dart', 'language-server', '--protocol=lsp' }) + return { default_config = { - cmd = { 'dart', 'language-server', '--protocol=lsp' }, + cmd = cmd, filetypes = { 'dart' }, root_dir = util.root_pattern 'pubspec.yaml', init_options = { diff --git a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/denols.lua b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/denols.lua index 315ac9ba3..16b69eb66 100644 --- a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/denols.lua +++ b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/denols.lua @@ -5,11 +5,7 @@ local function buf_cache(bufnr) local params = {} params['referrer'] = { uri = vim.uri_from_bufnr(bufnr) } params['uris'] = {} - lsp.buf_request(bufnr, 'deno/cache', params, function(err) - if err then - error(tostring(err)) - end - end) + lsp.buf_request(bufnr, 'deno/cache', params, function(_) end) end local function virtual_text_document_handler(uri, result) @@ -17,20 +13,26 @@ local function virtual_text_document_handler(uri, result) return nil end - for client_id, res in pairs(result) do - local lines = vim.split(res.result, '\n') - local bufnr = vim.uri_to_bufnr(uri) + for _, res in pairs(result) do + -- Error might be present because of race, deno server will eventually send a result. #1995 + if res.error ~= nil then + require('vim.lsp.log').warn( + 'deno/virtual_text_document handler failed (might be a temporary issue), error: ' .. tostring(res.error) + ) + else + 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 + local current_buf = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false) + if #current_buf ~= 0 then + return nil + end + + vim.api.nvim_buf_set_lines(bufnr, 0, -1, nil, lines) + vim.api.nvim_buf_set_option(bufnr, 'readonly', true) + vim.api.nvim_buf_set_option(bufnr, 'modified', false) + vim.api.nvim_buf_set_option(bufnr, 'modifiable', false) end - - vim.api.nvim_buf_set_lines(bufnr, 0, -1, nil, lines) - vim.api.nvim_buf_set_option(bufnr, 'readonly', true) - vim.api.nvim_buf_set_option(bufnr, 'modified', false) - vim.api.nvim_buf_set_option(bufnr, 'modifiable', false) - lsp.buf_attach_client(bufnr, client_id) end end @@ -64,6 +66,8 @@ end return { default_config = { cmd = { 'deno', 'lsp' }, + -- single file support is required for now to make the lsp work correctly, see #2000 + single_file_support = true, filetypes = { 'javascript', 'javascriptreact', @@ -80,6 +84,13 @@ return { handlers = { ['textDocument/definition'] = denols_handler, ['textDocument/references'] = denols_handler, + ['workspace/executeCommand'] = function(err, result, context) + if context.params.command == 'deno.cache' then + buf_cache(context.bufnr) + else + lsp.handlers[context.method](err, result, context) + end + end, }, }, commands = { diff --git a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/emmet_ls.lua b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/emmet_ls.lua index 3750ae516..aa04f794a 100644 --- a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/emmet_ls.lua +++ b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/emmet_ls.lua @@ -10,7 +10,7 @@ end return { default_config = { cmd = cmd, - filetypes = { 'html', 'css' }, + filetypes = { 'html', 'typescriptreact', 'javascriptreact', 'css', 'sass', 'scss', 'less' }, root_dir = util.find_git_ancestor, single_file_support = true, }, diff --git a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/eslint.lua b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/eslint.lua index 12c5bc439..6cfc1e804 100644 --- a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/eslint.lua +++ b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/eslint.lua @@ -1,20 +1,10 @@ local util = require 'lspconfig.util' local lsp = vim.lsp -local get_eslint_client = function() - local active_clients = lsp.get_active_clients() - for _, client in ipairs(active_clients) do - if client.name == 'eslint' then - return client - end - end - return nil -end - local function fix_all(opts) opts = opts or {} - local eslint_lsp_client = get_eslint_client() + local eslint_lsp_client = util.get_active_client_by_name(opts.bufnr, 'eslint') if eslint_lsp_client == nil then return end @@ -108,6 +98,13 @@ return { uri = new_root_dir, name = vim.fn.fnamemodify(new_root_dir, ':t'), } + + -- Support Yarn2 (PnP) projects + local pnp_cjs = util.path.join(new_root_dir, '.pnp.cjs') + local pnp_js = util.path.join(new_root_dir, '.pnp.js') + if util.path.exists(pnp_cjs) or util.path.exists(pnp_js) then + config.cmd = vim.list_extend({ 'yarn', 'exec' }, cmd) + end end, handlers = { ['eslint/openDoc'] = function(_, result) diff --git a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/gradle_ls.lua b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/gradle_ls.lua index b23b599dd..47091b2db 100644 --- a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/gradle_ls.lua +++ b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/gradle_ls.lua @@ -20,6 +20,12 @@ return { return util.root_pattern(unpack(root_files))(fname) or util.root_pattern(unpack(fallback_root_files))(fname) end, cmd = { bin_name }, + -- gradle-language-server expects init_options.settings to be defined + init_options = { + settings = { + gradleWrapperEnabled = true, + }, + }, }, docs = { description = [[ @@ -32,6 +38,11 @@ If you're setting this up manually, build vscode-gradle using `./gradlew install default_config = { root_dir = [[root_pattern("settings.gradle")]], cmd = { 'gradle-language-server' }, + init_options = { + settings = { + gradleWrapperEnabled = true, + }, + }, }, }, } diff --git a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/hls.lua b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/hls.lua index 32b3ea22d..54b45e989 100644 --- a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/hls.lua +++ b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/hls.lua @@ -4,7 +4,12 @@ return { default_config = { cmd = { 'haskell-language-server-wrapper', '--lsp' }, filetypes = { 'haskell', 'lhaskell' }, - root_dir = util.root_pattern('*.cabal', 'stack.yaml', 'cabal.project', 'package.yaml', 'hie.yaml'), + root_dir = function(filepath) + return ( + util.root_pattern('hie.yaml', 'stack.yaml', 'cabal.project')(filepath) + or util.root_pattern('*.cabal', 'package.yaml')(filepath) + ) + end, single_file_support = true, settings = { haskell = { @@ -34,10 +39,17 @@ return { https://github.com/haskell/haskell-language-server Haskell Language Server - ]], + ]], default_config = { - root_dir = [[root_pattern("*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml")]], + root_dir = [[ +function (filepath) + return ( + util.root_pattern('hie.yaml', 'stack.yaml', 'cabal.project')(filepath) + or util.root_pattern('*.cabal', 'package.yaml')(filepath) + ) +end + ]], }, }, } diff --git a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/m68k.lua b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/m68k.lua new file mode 100644 index 000000000..9e96d8475 --- /dev/null +++ b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/m68k.lua @@ -0,0 +1,36 @@ +local util = require 'lspconfig.util' + +local bin_name = 'm68k-lsp-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'asm68k' }, + root_dir = util.root_pattern('Makefile', '.git'), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/grahambates/m68k-lsp + +Language server for Motorola 68000 family assembly + +`m68k-lsp-server` can be installed via `npm`: + +```sh +npm install -g m68k-lsp-server +``` + +Ensure you are using the 68k asm syntax variant in Neovim. + +```lua +vim.g.asmsyntax = 'asm68k' +``` +]], + }, +} diff --git a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/nimls.lua b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/nimls.lua index f10b002a8..3c1aeb2be 100644 --- a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/nimls.lua +++ b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/nimls.lua @@ -12,7 +12,9 @@ return { docs = { description = [[ https://github.com/PMunch/nimlsp + `nimlsp` can be installed via the `nimble` package manager: + ```sh nimble install nimlsp ``` diff --git a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/omnisharp.lua b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/omnisharp.lua index b51d8989c..0ad8b6a19 100644 --- a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/omnisharp.lua +++ b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/omnisharp.lua @@ -2,47 +2,134 @@ local util = require 'lspconfig.util' return { default_config = { + -- Enables support for reading code style, naming convention and analyzer + -- settings from .editorconfig. + enable_editorconfig_support = true, + + -- If true, MSBuild project system will only load projects for files that + -- were opened in the editor. This setting is useful for big C# codebases + -- and allows for faster initialization of code navigation features only + -- for projects that are relevant to code that is being edited. With this + -- setting enabled OmniSharp may load fewer projects and may thus display + -- incomplete reference lists for symbols. + enable_ms_build_load_projects_on_demand = false, + + -- Enables support for roslyn analyzers, code fixes and rulesets. + enable_roslyn_analyzers = false, + + -- Specifies whether 'using' directives should be grouped and sorted during + -- document formatting. + organize_imports_on_format = false, + + -- Enables support for showing unimported types and unimported extension + -- methods in completion lists. When committed, the appropriate using + -- directive will be added at the top of the current file. This option can + -- have a negative impact on initial completion responsiveness, + -- particularly for the first few completion sessions after opening a + -- solution. + enable_import_completion = false, + + -- Specifies whether to include preview versions of the .NET SDK when + -- determining which version to use for project loading. + sdk_include_prereleases = true, + + -- Only run analyzers against open files when 'enableRoslynAnalyzers' is + -- true + analyze_open_documents_only = false, + filetypes = { 'cs', 'vb' }, root_dir = function(fname) return util.root_pattern '*.sln'(fname) or util.root_pattern '*.csproj'(fname) end, on_new_config = function(new_config, new_root_dir) - if new_root_dir then - table.insert(new_config.cmd, '-s') - table.insert(new_config.cmd, new_root_dir) + table.insert(new_config.cmd, '-z') -- https://github.com/OmniSharp/omnisharp-vscode/pull/4300 + vim.list_extend(new_config.cmd, { '-s', new_root_dir }) + vim.list_extend(new_config.cmd, { '--hostPID', tostring(vim.fn.getpid()) }) + table.insert(new_config.cmd, 'DotNet:enablePackageRestore=false') + vim.list_extend(new_config.cmd, { '--encoding', 'utf-8' }) + table.insert(new_config.cmd, '--languageserver') + + if new_config.enable_editorconfig_support then + table.insert(new_config.cmd, 'FormattingOptions:EnableEditorConfigSupport=true') + end + + if new_config.organize_imports_on_format then + table.insert(new_config.cmd, 'FormattingOptions:OrganizeImports=true') + end + + if new_config.enable_ms_build_load_projects_on_demand then + table.insert(new_config.cmd, 'MsBuild:LoadProjectsOnDemand=true') + end + + if new_config.enable_roslyn_analyzers then + table.insert(new_config.cmd, 'RoslynExtensionsOptions:EnableAnalyzersSupport=true') + end + + if new_config.enable_import_completion then + table.insert(new_config.cmd, 'RoslynExtensionsOptions:EnableImportCompletion=true') + end + + if new_config.sdk_include_prereleases then + table.insert(new_config.cmd, 'Sdk:IncludePrereleases=true') + end + + if new_config.analyze_open_documents_only then + table.insert(new_config.cmd, 'RoslynExtensionsOptions:AnalyzeOpenDocumentsOnly=true') end end, init_options = {}, }, - -- on_new_config = function(new_config) end; - -- on_attach = function(client, bufnr) end; docs = { description = [[ https://github.com/omnisharp/omnisharp-roslyn OmniSharp server based on Roslyn workspaces `omnisharp-roslyn` can be installed by downloading and extracting a release from [here](https://github.com/OmniSharp/omnisharp-roslyn/releases). -Omnisharp can also be built from source by following the instructions [here](https://github.com/omnisharp/omnisharp-roslyn#downloading-omnisharp). +OmniSharp can also be built from source by following the instructions [here](https://github.com/omnisharp/omnisharp-roslyn#downloading-omnisharp). -Omnisharp requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. +OmniSharp requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. **By default, omnisharp-roslyn doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. ```lua -local pid = vim.fn.getpid() --- On linux/darwin if using a release build, otherwise under scripts/OmniSharp(.Core)(.cmd) -local omnisharp_bin = "/path/to/omnisharp-repo/run" --- on Windows --- local omnisharp_bin = "/path/to/omnisharp/OmniSharp.exe" -require'lspconfig'.omnisharp.setup{ - cmd = { omnisharp_bin, "--languageserver" , "--hostPID", tostring(pid) }; - ... -} -``` +require'lspconfig'.omnisharp.setup { + cmd = { "dotnet", "/path/to/omnisharp/OmniSharp.dll" }, -Note, if you download the executable for darwin you will need to strip the quarantine label to run: -```bash -find /path/to/omnisharp-osx | xargs xattr -r -d com.apple.quarantine + -- Enables support for reading code style, naming convention and analyzer + -- settings from .editorconfig. + enable_editorconfig_support = true, + + -- If true, MSBuild project system will only load projects for files that + -- were opened in the editor. This setting is useful for big C# codebases + -- and allows for faster initialization of code navigation features only + -- for projects that are relevant to code that is being edited. With this + -- setting enabled OmniSharp may load fewer projects and may thus display + -- incomplete reference lists for symbols. + enable_ms_build_load_projects_on_demand = false, + + -- Enables support for roslyn analyzers, code fixes and rulesets. + enable_roslyn_analyzers = false, + + -- Specifies whether 'using' directives should be grouped and sorted during + -- document formatting. + organize_imports_on_format = false, + + -- Enables support for showing unimported types and unimported extension + -- methods in completion lists. When committed, the appropriate using + -- directive will be added at the top of the current file. This option can + -- have a negative impact on initial completion responsiveness, + -- particularly for the first few completion sessions after opening a + -- solution. + enable_import_completion = false, + + -- Specifies whether to include preview versions of the .NET SDK when + -- determining which version to use for project loading. + sdk_include_prereleases = true, + + -- Only run analyzers against open files when 'enableRoslynAnalyzers' is + -- true + analyze_open_documents_only = false, +} ``` ]], default_config = { diff --git a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/sumneko_lua.lua b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/sumneko_lua.lua index 0e06ca156..98d1dde27 100644 --- a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/sumneko_lua.lua +++ b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/sumneko_lua.lua @@ -4,6 +4,7 @@ local root_files = { '.luarc.json', '.luacheckrc', '.stylua.toml', + 'stylua.toml', 'selene.toml', } return { @@ -66,7 +67,7 @@ See `lua-language-server`'s [documentation](https://github.com/sumneko/lua-langu ]], default_config = { - root_dir = [[root_pattern(".luarc.json", ".luacheckrc", ".stylua.toml", "selene.toml", ".git")]], + root_dir = [[root_pattern(".luarc.json", ".luacheckrc", ".stylua.toml", "stylua.toml", "selene.toml", ".git")]], }, }, } diff --git a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/svelte.lua b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/svelte.lua index 14db19258..64ed468f4 100644 --- a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/svelte.lua +++ b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/svelte.lua @@ -17,6 +17,8 @@ return { description = [[ https://github.com/sveltejs/language-tools/tree/master/packages/language-server +Note: assuming that [tsserver](#tsserver) is setup, full JavaScript/TypeScript support (find references, rename, etc of symbols in Svelte files when working in JS/TS files) requires per-project installation and configuration of [typescript-svelte-plugin](https://github.com/sveltejs/language-tools/tree/master/packages/typescript-plugin#usage). + `svelte-language-server` can be installed via `npm`: ```sh npm install -g svelte-language-server diff --git a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/texlab.lua b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/texlab.lua index 88bfa20ca..ba5b16f83 100644 --- a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/texlab.lua +++ b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/texlab.lua @@ -66,7 +66,7 @@ end return { default_config = { cmd = { 'texlab' }, - filetypes = { 'tex', 'bib' }, + filetypes = { 'tex', 'plaintex', 'bib' }, root_dir = function(fname) return util.root_pattern '.latexmkrc'(fname) or util.find_git_ancestor(fname) end, diff --git a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/zk.lua b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/zk.lua index c2890451f..e670f8340 100644 --- a/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/zk.lua +++ b/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/zk.lua @@ -37,7 +37,7 @@ return { }, docs = { description = [[ -github.com/mickael-menu/zk +https://github.com/mickael-menu/zk A plain text note-taking assistant ]], diff --git a/bundle/nvim-lspconfig/lua/lspconfig/ui/lspinfo.lua b/bundle/nvim-lspconfig/lua/lspconfig/ui/lspinfo.lua index 7fc40decc..e9066b7c3 100644 --- a/bundle/nvim-lspconfig/lua/lspconfig/ui/lspinfo.lua +++ b/bundle/nvim-lspconfig/lua/lspconfig/ui/lspinfo.lua @@ -36,7 +36,7 @@ local function remove_newlines(cmd) return cmd end -local function make_config_info(config) +local function make_config_info(config, bufnr) local config_info = {} config_info.name = config.name config_info.helptags = {} @@ -52,7 +52,9 @@ local function make_config_info(config) config_info.cmd_is_executable = 'NA' end - local buffer_dir = vim.fn.expand '%:p:h' + local buffer_dir = vim.api.nvim_buf_call(bufnr, function() + return vim.fn.expand '%:p:h' + end) local root_dir = config.get_root_dir(buffer_dir) if root_dir then config_info.root_dir = root_dir @@ -148,29 +150,23 @@ return function() local buf_clients = vim.lsp.buf_get_clients() local clients = vim.lsp.get_active_clients() local buffer_filetype = vim.bo.filetype + local original_bufnr = vim.api.nvim_get_current_buf() local win_info = windows.percentage_range_window(0.8, 0.7) local bufnr, win_id = win_info.bufnr, win_info.win_id local buf_lines = {} - local buf_client_names = {} - for _, client in pairs(buf_clients) do - table.insert(buf_client_names, client.name) - end - local buf_client_ids = {} for _, client in pairs(buf_clients) do table.insert(buf_client_ids, client.id) end local other_active_clients = {} - local client_names = {} for _, client in pairs(clients) do if not vim.tbl_contains(buf_client_ids, client.id) then table.insert(other_active_clients, client) end - table.insert(client_names, client.name) end local header = { @@ -214,7 +210,7 @@ return function() if not vim.tbl_isempty(other_matching_configs) then vim.list_extend(buf_lines, other_matching_configs_header) for _, config in pairs(other_matching_configs) do - vim.list_extend(buf_lines, make_config_info(config)) + vim.list_extend(buf_lines, make_config_info(config, original_bufnr)) end end diff --git a/bundle/nvim-lspconfig/lua/lspconfig/util.lua b/bundle/nvim-lspconfig/lua/lspconfig/util.lua index 88ba42f93..09a221636 100644 --- a/bundle/nvim-lspconfig/lua/lspconfig/util.lua +++ b/bundle/nvim-lspconfig/lua/lspconfig/util.lua @@ -352,6 +352,14 @@ function M.find_git_ancestor(startpath) end end) end +function M.find_mercurial_ancestor(startpath) + return M.search_ancestors(startpath, function(path) + -- Support Mercurial directories + if M.path.is_dir(M.path.join(path, '.hg')) then + return path + end + end) +end function M.find_node_modules_ancestor(startpath) return M.search_ancestors(startpath, function(path) if M.path.is_dir(M.path.join(path, 'node_modules')) then diff --git a/bundle/nvim-lspconfig/neovim.toml b/bundle/nvim-lspconfig/neovim.toml deleted file mode 100644 index 26ba92206..000000000 --- a/bundle/nvim-lspconfig/neovim.toml +++ /dev/null @@ -1,31 +0,0 @@ -[selene] -base = "lua51" -name = "neovim" - -[vim] -any = true - -[[assert.args]] -type = "bool" - -[[assert.args]] -type = "string" -required = false - -[[after_each.args]] -type = "function" - -[[before_each.args]] -type = "function" - -[[describe.args]] -type = "string" - -[[describe.args]] -type = "function" - -[[it.args]] -type = "string" - -[[it.args]] -type = "function" diff --git a/bundle/nvim-lspconfig/neovim.yml b/bundle/nvim-lspconfig/neovim.yml new file mode 100644 index 000000000..9de2931ee --- /dev/null +++ b/bundle/nvim-lspconfig/neovim.yml @@ -0,0 +1,25 @@ +--- +base: lua51 + +globals: + vim: + any: true + assert: + args: + - type: bool + - type: string + required: false + after_each: + args: + - type: function + before_each: + args: + - type: function + describe: + args: + - type: string + - type: function + it: + args: + - type: string + - type: function