Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package nvim-lspconfig for openSUSE:Factory checked in at 2025-02-17 20:58:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/nvim-lspconfig (Old) and /work/SRC/openSUSE:Factory/.nvim-lspconfig.new.8181 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nvim-lspconfig" Mon Feb 17 20:58:05 2025 rev:4 rq:1246451 version:1.6.0 Changes: -------- --- /work/SRC/openSUSE:Factory/nvim-lspconfig/nvim-lspconfig.changes 2025-01-07 20:51:47.264864421 +0100 +++ /work/SRC/openSUSE:Factory/.nvim-lspconfig.new.8181/nvim-lspconfig.changes 2025-02-17 20:58:35.138628103 +0100 @@ -1,0 +2,31 @@ +Mon Feb 17 13:55:06 UTC 2025 - Richard Rahl <[email protected]> + +- update to 1.6.0: + * revert: "refactor!: make available_servers function private" + * fix(angularls): set Angular core version for backwards compatibility + * fix(angularls): handle nil while checking angular core version +- update to 1.5.0: + * fix(gh_actions_ls): Fix incorrect rootdir resolution + * fix: remove validation from configs.lua + * fix(astro,volar): correct 'typescript/lib' path for TypeScript LSP + * feat: oxc-language-server +- update to 1.4.0: + * fix(powershell_es): add root pattern + * fix(clojure_lsp): adds single_file_support for clojure + * Feat: add lua 3rd party language servers + * feat: gh-actions-language-server + * feat(gh_actions_ls): use root_dir to decide whether to attach + * feat: add typst to the list of languages harper supports + * feat: Alloy language server + * Improve alloy_ls docs + * feat(asm_lsp): add NASM config support and single_file support + * refactor: comment util.path.is_descendant to prepare deperecation in future + * refactor!: make available_servers function private + * docs: Use a maintained fork for kubernetes-json-schema in the example + * build: add -q flag to luacheck + * build: remove docgen.sh + * refactor: silence luals warnings + * docs: fix typo + * fix: fix incorrect root finding + +------------------------------------------------------------------- Old: ---- nvim-lspconfig-1.3.0.tar.gz New: ---- nvim-lspconfig-1.6.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ nvim-lspconfig.spec ++++++ --- /var/tmp/diff_new_pack.ENcVFC/_old 2025-02-17 20:58:37.146711841 +0100 +++ /var/tmp/diff_new_pack.ENcVFC/_new 2025-02-17 20:58:37.158712342 +0100 @@ -17,7 +17,7 @@ Name: nvim-lspconfig -Version: 1.3.0 +Version: 1.6.0 Release: 0 Summary: Quickstart configs for Nvim LSP License: Apache-2.0 ++++++ nvim-lspconfig-1.3.0.tar.gz -> nvim-lspconfig-1.6.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/.codespellignorewords new/nvim-lspconfig-1.6.0/.codespellignorewords --- old/nvim-lspconfig-1.3.0/.codespellignorewords 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/.codespellignorewords 2025-01-29 17:07:58.000000000 +0100 @@ -1,3 +1,4 @@ +abl als edn esy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/.github/workflows/docgen.yml new/nvim-lspconfig-1.6.0/.github/workflows/docgen.yml --- old/nvim-lspconfig-1.3.0/.github/workflows/docgen.yml 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/.github/workflows/docgen.yml 2025-01-29 17:07:58.000000000 +0100 @@ -18,7 +18,7 @@ version: nightly - name: Run docgen run: | - scripts/docgen.sh + scripts/docgen.lua - name: Commit changes env: COMMIT_MSG: | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/.github/workflows/lint.yml new/nvim-lspconfig-1.6.0/.github/workflows/lint.yml --- old/nvim-lspconfig-1.3.0/.github/workflows/lint.yml 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/.github/workflows/lint.yml 2025-01-29 17:07:58.000000000 +0100 @@ -58,6 +58,7 @@ - uses: actions/checkout@v4 with: fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} - run: npm install --save-dev @commitlint/{cli,config-conventional} - run: | echo "module.exports = { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/Makefile new/nvim-lspconfig-1.6.0/Makefile --- old/nvim-lspconfig-1.3.0/Makefile 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/Makefile 2025-01-29 17:07:58.000000000 +0100 @@ -3,7 +3,7 @@ lint: @printf "\nRunning luacheck\n" - luacheck lua/* test/* + luacheck -q lua/* test/* @printf "\nRunning selene\n" selene --display-style=quiet . @printf "\nRunning stylua\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/doc/configs.md new/nvim-lspconfig-1.6.0/doc/configs.md --- old/nvim-lspconfig-1.3.0/doc/configs.md 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/doc/configs.md 2025-01-29 17:07:58.000000000 +0100 @@ -8,6 +8,7 @@ - [ada_ls](#ada_ls) - [agda_ls](#agda_ls) - [aiken](#aiken) +- [alloy_ls](#alloy_ls) - [anakin_language_server](#anakin_language_server) - [angularls](#angularls) - [ansiblels](#ansiblels) @@ -112,6 +113,7 @@ - [futhark_lsp](#futhark_lsp) - [gdscript](#gdscript) - [gdshader_lsp](#gdshader_lsp) +- [gh_actions_ls](#gh_actions_ls) - [ghcide](#ghcide) - [ghdl_ls](#ghdl_ls) - [ginko_ls](#ginko_ls) @@ -207,6 +209,7 @@ - [openedge_ls](#openedge_ls) - [openscad_ls](#openscad_ls) - [openscad_lsp](#openscad_lsp) +- [oxlint](#oxlint) - [pact_ls](#pact_ls) - [pasls](#pasls) - [pbls](#pbls) @@ -261,6 +264,7 @@ - [salt_ls](#salt_ls) - [scheme_langserver](#scheme_langserver) - [scry](#scry) +- [selene3p_ls](#selene3p_ls) - [serve_d](#serve_d) - [shopify_theme_ls](#shopify_theme_ls) - [sixtyfps](#sixtyfps) @@ -291,6 +295,7 @@ - [steep](#steep) - [stimulus_ls](#stimulus_ls) - [stylelint_lsp](#stylelint_lsp) +- [stylua3p_ls](#stylua3p_ls) - [superhtml](#superhtml) - [svelte](#svelte) - [svlangserver](#svlangserver) @@ -438,6 +443,48 @@ - `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/aiken.lua:4](../lua/lspconfig/configs/aiken.lua#L4) +## alloy_ls + +https://github.com/AlloyTools/org.alloytools.alloy + +Alloy is a formal specification language for describing structures and a tool for exploring them. + +You may also need to configure the filetype for Alloy (*.als) files: + +``` +autocmd BufNewFile,BufRead *.als set filetype=alloy +``` + +or + +```lua +vim.filetype.add({ + pattern = { + ['.*/*.als'] = 'alloy', + }, +}) +``` + +Alternatively, you may use a syntax plugin like https://github.com/runoshun/vim-alloy. + +Snippet to enable the language server: +```lua +require'lspconfig'.alloy_ls.setup{} +``` + +Default config: +- `cmd` : + ```lua + { "alloy", "lsp" } + ``` +- `filetypes` : + ```lua + { "alloy" } + ``` +- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/alloy_ls.lua:2](../lua/lspconfig/configs/alloy_ls.lua#L2) +- `single_file_support` : `true` + + ## anakin_language_server https://pypi.org/project/anakin-language-server/ @@ -503,13 +550,13 @@ Default config: - `cmd` : ```lua - { "ngserver", "--stdio", "--tsProbeLocations", "", "--ngProbeLocations", "" } + { "ngserver", "--stdio", "--tsProbeLocations", "", "--ngProbeLocations", "", "--angularCoreVersion", "" } ``` - `filetypes` : ```lua { "typescript", "html", "typescriptreact", "typescript.tsx", "htmlangular" } ``` -- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/angularls.lua:15](../lua/lspconfig/configs/angularls.lua#L15) +- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/angularls.lua:39](../lua/lspconfig/configs/angularls.lua#L39) ## ansiblels @@ -724,7 +771,7 @@ https://github.com/bergercookie/asm-lsp -Language Server for GAS/GO Assembly +Language Server for NASM/GAS/GO Assembly `asm-lsp` can be installed via cargo: cargo install asm-lsp @@ -744,6 +791,7 @@ { "asm", "vmasm" } ``` - `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/asm_lsp.lua:2](../lua/lspconfig/configs/asm_lsp.lua#L2) +- `single_file_support` : `true` ## ast_grep @@ -1952,6 +2000,7 @@ { "clojure", "edn" } ``` - `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/clojure_lsp.lua:4](../lua/lspconfig/configs/clojure_lsp.lua#L4) +- `single_file_support` : `true` ## cmake @@ -4029,6 +4078,51 @@ - `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/gdshader_lsp.lua:4](../lua/lspconfig/configs/gdshader_lsp.lua#L4) +## gh_actions_ls + +https://github.com/lttb/gh-actions-language-server + +Language server for GitHub Actions. + +The projects [forgejo](https://forgejo.org/) and [gitea](https://about.gitea.com/) +design their actions to be as compatible to github as possible +with only [a few differences](https://docs.gitea.com/usage/actions/comparison#unsupported-workflows-syntax) between the systems. +The `gh_actions_ls` is therefore enabled for those `yaml` files as well. + +The `gh-actions-language-server` can be installed via `npm`: + +```sh +npm install -g gh-actions-language-server +``` + +Snippet to enable the language server: +```lua +require'lspconfig'.gh_actions_ls.setup{} +``` + +Default config: +- `capabilities` : + ```lua + { + workspace = { + didChangeWorkspaceFolders = { + dynamicRegistration = true + } + } + } + ``` +- `cmd` : + ```lua + { "gh-actions-language-server", "--stdio" } + ``` +- `filetypes` : + ```lua + { "yaml" } + ``` +- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/gh_actions_ls.lua:2](../lua/lspconfig/configs/gh_actions_ls.lua#L2) +- `single_file_support` : `false` + + ## ghcide https://github.com/digital-asset/ghcide @@ -4588,7 +4682,7 @@ ``` - `filetypes` : ```lua - { "c", "cpp", "cs", "gitcommit", "go", "html", "java", "javascript", "lua", "markdown", "nix", "python", "ruby", "rust", "swift", "toml", "typescript", "typescriptreact", "haskell", "cmake" } + { "c", "cpp", "cs", "gitcommit", "go", "html", "java", "javascript", "lua", "markdown", "nix", "python", "ruby", "rust", "swift", "toml", "typescript", "typescriptreact", "haskell", "cmake", "typst" } ``` - `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/harper_ls.lua:2](../lua/lspconfig/configs/harper_ls.lua#L2) - `single_file_support` : `true` @@ -7309,6 +7403,34 @@ - `single_file_support` : `true` +## oxlint + +https://oxc.rs + +A collection of JavaScript tools written in Rust. + +```sh +npm install [-g] oxlint +``` + +Snippet to enable the language server: +```lua +require'lspconfig'.oxlint.setup{} +``` + +Default config: +- `cmd` : + ```lua + { "oxc_language_server" } + ``` +- `filetypes` : + ```lua + { "astro", "javascript", "javascriptreact", "svelte", "typescript", "typescript.tsx", "typescriptreact", "vue" } + ``` +- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/oxlint.lua:4](../lua/lspconfig/configs/oxlint.lua#L4) +- `single_file_support` : `false` + + ## pact_ls https://github.com/kadena-io/pact-lsp @@ -7760,8 +7882,8 @@ ```lua { "ps1" } ``` -- `on_new_config` source (use "gF" to visit): [../lua/lspconfig/configs/powershell_es.lua:13](../lua/lspconfig/configs/powershell_es.lua#L13) -- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/powershell_es.lua:13](../lua/lspconfig/configs/powershell_es.lua#L13) +- `on_new_config` source (use "gF" to visit): [../lua/lspconfig/configs/powershell_es.lua:14](../lua/lspconfig/configs/powershell_es.lua#L14) +- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/powershell_es.lua:14](../lua/lspconfig/configs/powershell_es.lua#L14) - `shell` : ```lua "pwsh" @@ -9062,6 +9184,29 @@ - `single_file_support` : `true` +## selene3p_ls + +https://github.com/antonk52/lua-3p-language-servers + +3rd party Language Server for Selene lua linter + +Snippet to enable the language server: +```lua +require'lspconfig'.selene3p_ls.setup{} +``` + +Default config: +- `cmd` : + ```lua + { "selene-3p-language-server" } + ``` +- `filetypes` : + ```lua + { "lua" } + ``` +- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/selene3p_ls.lua:4](../lua/lspconfig/configs/selene3p_ls.lua#L4) + + ## serve_d https://github.com/Pure-D/serve-d @@ -10066,6 +10211,29 @@ ``` +## stylua3p_ls + +https://github.com/antonk52/lua-3p-language-servers + +3rd party Language Server for Stylua lua formatter + +Snippet to enable the language server: +```lua +require'lspconfig'.stylua3p_ls.setup{} +``` + +Default config: +- `cmd` : + ```lua + { "stylua-3p-language-server" } + ``` +- `filetypes` : + ```lua + { "lua" } + ``` +- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/stylua3p_ls.lua:4](../lua/lspconfig/configs/stylua3p_ls.lua#L4) + + ## superhtml https://github.com/kristoff-it/superhtml @@ -12009,7 +12177,7 @@ yaml = { ... -- other settings. note this overrides the lspconfig defaults. schemas = { - ["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.18.0-standalone-strict/all.json"] = "/*.k8s.yaml", + ["https://raw.githubusercontent.com/yannh/kubernetes-json-schema/refs/heads/master/v1.32.1-standalone-strict/all.json"] = "/*.k8s.yaml", ... -- other schemas }, }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/doc/configs.txt new/nvim-lspconfig-1.6.0/doc/configs.txt --- old/nvim-lspconfig-1.3.0/doc/configs.txt 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/doc/configs.txt 2025-01-29 17:07:58.000000000 +0100 @@ -8,6 +8,7 @@ - [ada_ls](#ada_ls) - [agda_ls](#agda_ls) - [aiken](#aiken) +- [alloy_ls](#alloy_ls) - [anakin_language_server](#anakin_language_server) - [angularls](#angularls) - [ansiblels](#ansiblels) @@ -112,6 +113,7 @@ - [futhark_lsp](#futhark_lsp) - [gdscript](#gdscript) - [gdshader_lsp](#gdshader_lsp) +- [gh_actions_ls](#gh_actions_ls) - [ghcide](#ghcide) - [ghdl_ls](#ghdl_ls) - [ginko_ls](#ginko_ls) @@ -207,6 +209,7 @@ - [openedge_ls](#openedge_ls) - [openscad_ls](#openscad_ls) - [openscad_lsp](#openscad_lsp) +- [oxlint](#oxlint) - [pact_ls](#pact_ls) - [pasls](#pasls) - [pbls](#pbls) @@ -261,6 +264,7 @@ - [salt_ls](#salt_ls) - [scheme_langserver](#scheme_langserver) - [scry](#scry) +- [selene3p_ls](#selene3p_ls) - [serve_d](#serve_d) - [shopify_theme_ls](#shopify_theme_ls) - [sixtyfps](#sixtyfps) @@ -291,6 +295,7 @@ - [steep](#steep) - [stimulus_ls](#stimulus_ls) - [stylelint_lsp](#stylelint_lsp) +- [stylua3p_ls](#stylua3p_ls) - [superhtml](#superhtml) - [svelte](#svelte) - [svlangserver](#svlangserver) @@ -438,6 +443,48 @@ - `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/aiken.lua:4](../lua/lspconfig/configs/aiken.lua#L4) +## alloy_ls + +https://github.com/AlloyTools/org.alloytools.alloy + +Alloy is a formal specification language for describing structures and a tool for exploring them. + +You may also need to configure the filetype for Alloy (*.als) files: + +``` +autocmd BufNewFile,BufRead *.als set filetype=alloy +``` + +or + +```lua +vim.filetype.add({ + pattern = { + ['.*/*.als'] = 'alloy', + }, +}) +``` + +Alternatively, you may use a syntax plugin like https://github.com/runoshun/vim-alloy. + +Snippet to enable the language server: +```lua +require'lspconfig'.alloy_ls.setup{} +``` + +Default config: +- `cmd` : + ```lua + { "alloy", "lsp" } + ``` +- `filetypes` : + ```lua + { "alloy" } + ``` +- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/alloy_ls.lua:2](../lua/lspconfig/configs/alloy_ls.lua#L2) +- `single_file_support` : `true` + + ## anakin_language_server https://pypi.org/project/anakin-language-server/ @@ -503,13 +550,13 @@ Default config: - `cmd` : ```lua - { "ngserver", "--stdio", "--tsProbeLocations", "", "--ngProbeLocations", "" } + { "ngserver", "--stdio", "--tsProbeLocations", "", "--ngProbeLocations", "", "--angularCoreVersion", "" } ``` - `filetypes` : ```lua { "typescript", "html", "typescriptreact", "typescript.tsx", "htmlangular" } ``` -- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/angularls.lua:15](../lua/lspconfig/configs/angularls.lua#L15) +- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/angularls.lua:39](../lua/lspconfig/configs/angularls.lua#L39) ## ansiblels @@ -724,7 +771,7 @@ https://github.com/bergercookie/asm-lsp -Language Server for GAS/GO Assembly +Language Server for NASM/GAS/GO Assembly `asm-lsp` can be installed via cargo: cargo install asm-lsp @@ -744,6 +791,7 @@ { "asm", "vmasm" } ``` - `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/asm_lsp.lua:2](../lua/lspconfig/configs/asm_lsp.lua#L2) +- `single_file_support` : `true` ## ast_grep @@ -1952,6 +2000,7 @@ { "clojure", "edn" } ``` - `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/clojure_lsp.lua:4](../lua/lspconfig/configs/clojure_lsp.lua#L4) +- `single_file_support` : `true` ## cmake @@ -4029,6 +4078,51 @@ - `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/gdshader_lsp.lua:4](../lua/lspconfig/configs/gdshader_lsp.lua#L4) +## gh_actions_ls + +https://github.com/lttb/gh-actions-language-server + +Language server for GitHub Actions. + +The projects [forgejo](https://forgejo.org/) and [gitea](https://about.gitea.com/) +design their actions to be as compatible to github as possible +with only [a few differences](https://docs.gitea.com/usage/actions/comparison#unsupported-workflows-syntax) between the systems. +The `gh_actions_ls` is therefore enabled for those `yaml` files as well. + +The `gh-actions-language-server` can be installed via `npm`: + +```sh +npm install -g gh-actions-language-server +``` + +Snippet to enable the language server: +```lua +require'lspconfig'.gh_actions_ls.setup{} +``` + +Default config: +- `capabilities` : + ```lua + { + workspace = { + didChangeWorkspaceFolders = { + dynamicRegistration = true + } + } + } + ``` +- `cmd` : + ```lua + { "gh-actions-language-server", "--stdio" } + ``` +- `filetypes` : + ```lua + { "yaml" } + ``` +- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/gh_actions_ls.lua:2](../lua/lspconfig/configs/gh_actions_ls.lua#L2) +- `single_file_support` : `false` + + ## ghcide https://github.com/digital-asset/ghcide @@ -4588,7 +4682,7 @@ ``` - `filetypes` : ```lua - { "c", "cpp", "cs", "gitcommit", "go", "html", "java", "javascript", "lua", "markdown", "nix", "python", "ruby", "rust", "swift", "toml", "typescript", "typescriptreact", "haskell", "cmake" } + { "c", "cpp", "cs", "gitcommit", "go", "html", "java", "javascript", "lua", "markdown", "nix", "python", "ruby", "rust", "swift", "toml", "typescript", "typescriptreact", "haskell", "cmake", "typst" } ``` - `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/harper_ls.lua:2](../lua/lspconfig/configs/harper_ls.lua#L2) - `single_file_support` : `true` @@ -7309,6 +7403,34 @@ - `single_file_support` : `true` +## oxlint + +https://oxc.rs + +A collection of JavaScript tools written in Rust. + +```sh +npm install [-g] oxlint +``` + +Snippet to enable the language server: +```lua +require'lspconfig'.oxlint.setup{} +``` + +Default config: +- `cmd` : + ```lua + { "oxc_language_server" } + ``` +- `filetypes` : + ```lua + { "astro", "javascript", "javascriptreact", "svelte", "typescript", "typescript.tsx", "typescriptreact", "vue" } + ``` +- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/oxlint.lua:4](../lua/lspconfig/configs/oxlint.lua#L4) +- `single_file_support` : `false` + + ## pact_ls https://github.com/kadena-io/pact-lsp @@ -7760,8 +7882,8 @@ ```lua { "ps1" } ``` -- `on_new_config` source (use "gF" to visit): [../lua/lspconfig/configs/powershell_es.lua:13](../lua/lspconfig/configs/powershell_es.lua#L13) -- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/powershell_es.lua:13](../lua/lspconfig/configs/powershell_es.lua#L13) +- `on_new_config` source (use "gF" to visit): [../lua/lspconfig/configs/powershell_es.lua:14](../lua/lspconfig/configs/powershell_es.lua#L14) +- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/powershell_es.lua:14](../lua/lspconfig/configs/powershell_es.lua#L14) - `shell` : ```lua "pwsh" @@ -9062,6 +9184,29 @@ - `single_file_support` : `true` +## selene3p_ls + +https://github.com/antonk52/lua-3p-language-servers + +3rd party Language Server for Selene lua linter + +Snippet to enable the language server: +```lua +require'lspconfig'.selene3p_ls.setup{} +``` + +Default config: +- `cmd` : + ```lua + { "selene-3p-language-server" } + ``` +- `filetypes` : + ```lua + { "lua" } + ``` +- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/selene3p_ls.lua:4](../lua/lspconfig/configs/selene3p_ls.lua#L4) + + ## serve_d https://github.com/Pure-D/serve-d @@ -10066,6 +10211,29 @@ ``` +## stylua3p_ls + +https://github.com/antonk52/lua-3p-language-servers + +3rd party Language Server for Stylua lua formatter + +Snippet to enable the language server: +```lua +require'lspconfig'.stylua3p_ls.setup{} +``` + +Default config: +- `cmd` : + ```lua + { "stylua-3p-language-server" } + ``` +- `filetypes` : + ```lua + { "lua" } + ``` +- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/stylua3p_ls.lua:4](../lua/lspconfig/configs/stylua3p_ls.lua#L4) + + ## superhtml https://github.com/kristoff-it/superhtml @@ -12009,7 +12177,7 @@ yaml = { ... -- other settings. note this overrides the lspconfig defaults. schemas = { - ["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.18.0-standalone-strict/all.json"] = "/*.k8s.yaml", + ["https://raw.githubusercontent.com/yannh/kubernetes-json-schema/refs/heads/master/v1.32.1-standalone-strict/all.json"] = "/*.k8s.yaml", ... -- other schemas }, }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/alloy_ls.lua new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/alloy_ls.lua --- old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/alloy_ls.lua 1970-01-01 01:00:00.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/alloy_ls.lua 2025-01-29 17:07:58.000000000 +0100 @@ -0,0 +1,35 @@ +return { + default_config = { + cmd = { 'alloy', 'lsp' }, + filetypes = { 'alloy' }, + root_dir = function(fname) + return vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/AlloyTools/org.alloytools.alloy + +Alloy is a formal specification language for describing structures and a tool for exploring them. + +You may also need to configure the filetype for Alloy (*.als) files: + +``` +autocmd BufNewFile,BufRead *.als set filetype=alloy +``` + +or + +```lua +vim.filetype.add({ + pattern = { + ['.*/*.als'] = 'alloy', + }, +}) +``` + +Alternatively, you may use a syntax plugin like https://github.com/runoshun/vim-alloy. +]], + }, +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/angularls.lua new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/angularls.lua --- old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/angularls.lua 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/angularls.lua 2025-01-29 17:07:58.000000000 +0100 @@ -4,12 +4,36 @@ -- 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 = vim.fs.find('node_modules', { path = root_dir, upward = true })[1] + local project_root = vim.fs.dirname(vim.fs.find('node_modules', { path = root_dir, upward = true })[1]) return project_root and (project_root .. '/node_modules') or '' end +local function get_angular_core_version(root_dir) + local project_root = vim.fs.dirname(vim.fs.find('node_modules', { path = root_dir, upward = true })[1]) + + if not project_root then + return '' + end + + local package_json = project_root .. '/package.json' + if not vim.loop.fs_stat(package_json) then + return '' + end + + local contents = io.open(package_json):read '*a' + local json = vim.json.decode(contents) + if not json.dependencies then + return '' + end + + local angular_core_version = json.dependencies['@angular/core'] + + return angular_core_version +end + local default_probe_dir = get_probe_dir(vim.fn.getcwd()) +local default_angular_core_version = get_angular_core_version(vim.fn.getcwd()) return { default_config = { @@ -20,6 +44,8 @@ default_probe_dir, '--ngProbeLocations', default_probe_dir, + '--angularCoreVersion', + default_angular_core_version, }, filetypes = { 'typescript', 'html', 'typescriptreact', 'typescript.tsx', 'htmlangular' }, -- Check for angular.json since that is the root of the project. @@ -29,6 +55,7 @@ }, on_new_config = function(new_config, new_root_dir) local new_probe_dir = get_probe_dir(new_root_dir) + local angular_core_version = get_angular_core_version(new_root_dir) -- We need to check our probe directories because they may have changed. new_config.cmd = { @@ -38,6 +65,8 @@ new_probe_dir, '--ngProbeLocations', new_probe_dir, + '--angularCoreVersion', + angular_core_version, } end, docs = { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/asm_lsp.lua new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/asm_lsp.lua --- old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/asm_lsp.lua 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/asm_lsp.lua 2025-01-29 17:07:58.000000000 +0100 @@ -2,15 +2,16 @@ default_config = { cmd = { 'asm-lsp' }, filetypes = { 'asm', 'vmasm' }, + single_file_support = true, root_dir = function(fname) - return vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]) + return vim.fs.dirname(vim.fs.find({ '.asm-lsp.toml', '.git' }, { path = fname, upward = true })[1]) end, }, docs = { description = [[ https://github.com/bergercookie/asm-lsp -Language Server for GAS/GO Assembly +Language Server for NASM/GAS/GO Assembly `asm-lsp` can be installed via cargo: cargo install asm-lsp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/astro.lua new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/astro.lua --- old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/astro.lua 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/astro.lua 2025-01-29 17:07:58.000000000 +0100 @@ -1,8 +1,8 @@ local util = require 'lspconfig.util' local function get_typescript_server_path(root_dir) - local project_root = vim.fs.find('node_modules', { path = root_dir, upward = true })[1] - return project_root and (project_root .. '/typescript/lib') or '' + local project_root = vim.fs.dirname(vim.fs.find('node_modules', { path = root_dir, upward = true })[1]) + return project_root and (project_root .. '/node_modules/typescript/lib') or '' end return { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/clojure_lsp.lua new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/clojure_lsp.lua --- old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/clojure_lsp.lua 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/clojure_lsp.lua 2025-01-29 17:07:58.000000000 +0100 @@ -5,6 +5,7 @@ cmd = { 'clojure-lsp' }, filetypes = { 'clojure', 'edn' }, root_dir = util.root_pattern('project.clj', 'deps.edn', 'build.boot', 'shadow-cljs.edn', '.git', 'bb.edn'), + single_file_support = true, }, docs = { description = [[ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/gh_actions_ls.lua new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/gh_actions_ls.lua --- old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/gh_actions_ls.lua 1970-01-01 01:00:00.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/gh_actions_ls.lua 2025-01-29 17:07:58.000000000 +0100 @@ -0,0 +1,57 @@ +return { + default_config = { + cmd = { 'gh-actions-language-server', '--stdio' }, + filetypes = { 'yaml' }, + + -- Only attach to yaml files that are GitHub workflows instead of all yaml + -- files. (A nil root_dir and no single_file_support results in the LSP not + -- attaching.) For details, see #3558 + root_dir = function(filename) + local dirs_to_check = { + '.github/workflows', + '.forgejo/workflows', + '.gitea/workflows', + } + + local dir = vim.fs.dirname(filename) + for _, subdir in ipairs(dirs_to_check) do + local match = vim.fs.find(subdir, { path = dir, upward = true })[1] + if match and vim.fn.isdirectory(match) == 1 and vim.fs.dirname(filename) == match then + return match + end + end + + return nil + end, + + -- Disabling "single file support" is a hack to avoid enabling this LS for + -- every random yaml file, so `root_dir()` can control the enablement. + single_file_support = false, + + capabilities = { + workspace = { + didChangeWorkspaceFolders = { + dynamicRegistration = true, + }, + }, + }, + }, + docs = { + description = [[ +https://github.com/lttb/gh-actions-language-server + +Language server for GitHub Actions. + +The projects [forgejo](https://forgejo.org/) and [gitea](https://about.gitea.com/) +design their actions to be as compatible to github as possible +with only [a few differences](https://docs.gitea.com/usage/actions/comparison#unsupported-workflows-syntax) between the systems. +The `gh_actions_ls` is therefore enabled for those `yaml` files as well. + +The `gh-actions-language-server` can be installed via `npm`: + +```sh +npm install -g gh-actions-language-server +``` +]], + }, +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/glint.lua new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/glint.lua --- old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/glint.lua 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/glint.lua 2025-01-29 17:07:58.000000000 +0100 @@ -4,7 +4,7 @@ default_config = { cmd = { 'glint-language-server' }, on_new_config = function(config, new_root_dir) - local project_root = vim.fs.find('node_modules', { path = new_root_dir, upward = true })[1] + local project_root = vim.fs.dirname(vim.fs.find('node_modules', { path = new_root_dir, upward = true })[1]) -- Glint should not be installed globally. local node_bin_path = project_root .. '/node_modules/.bin' local path = node_bin_path .. (vim.fn.has('win32') == 1 and ';' or ':') .. vim.env.PATH diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/harper_ls.lua new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/harper_ls.lua --- old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/harper_ls.lua 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/harper_ls.lua 2025-01-29 17:07:58.000000000 +0100 @@ -22,6 +22,7 @@ 'typescriptreact', 'haskell', 'cmake', + 'typst', }, root_dir = function(fname) return vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/oxlint.lua new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/oxlint.lua --- old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/oxlint.lua 1970-01-01 01:00:00.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/oxlint.lua 2025-01-29 17:07:58.000000000 +0100 @@ -0,0 +1,30 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'oxc_language_server' }, + filetypes = { + 'astro', + 'javascript', + 'javascriptreact', + 'svelte', + 'typescript', + 'typescript.tsx', + 'typescriptreact', + 'vue', + }, + root_dir = util.root_pattern('.oxlintrc.json'), + single_file_support = false, + }, + docs = { + description = [[ +https://oxc.rs + +A collection of JavaScript tools written in Rust. + +```sh +npm install [-g] oxlint +``` +]], + }, +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/powershell_es.lua new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/powershell_es.lua --- old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/powershell_es.lua 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/powershell_es.lua 2025-01-29 17:07:58.000000000 +0100 @@ -1,4 +1,5 @@ local temp_path = vim.fn.stdpath 'cache' +local util = require 'lspconfig.util' local function make_cmd(new_config) if new_config.bundle_path ~= nil then @@ -20,9 +21,7 @@ end, filetypes = { 'ps1' }, - root_dir = function(fname) - return vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]) - end, + root_dir = util.root_pattern('PSScriptAnalyzerSettings.psd1', '.git'), single_file_support = true, }, docs = { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/relay_lsp.lua new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/relay_lsp.lua --- old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/relay_lsp.lua 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/relay_lsp.lua 2025-01-29 17:07:58.000000000 +0100 @@ -23,7 +23,7 @@ }, root_dir = util.root_pattern('relay.config.*', 'package.json'), on_new_config = function(config, root_dir) - local project_root = vim.fs.find('node_modules', { path = root_dir, upward = true })[1] + local project_root = vim.fs.dirname(vim.fs.find('node_modules', { path = root_dir, upward = true })[1]) local node_bin_path = project_root .. '/node_modules/.bin' local compiler_cmd = { node_bin_path .. '/relay-compiler', '--watch' } local path = node_bin_path .. (vim.fn.has('win32') == 1 and ';' or ':') .. vim.env.PATH diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/selene3p_ls.lua new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/selene3p_ls.lua --- old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/selene3p_ls.lua 1970-01-01 01:00:00.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/selene3p_ls.lua 2025-01-29 17:07:58.000000000 +0100 @@ -0,0 +1,16 @@ +local util = require('lspconfig.util') + +return { + default_config = { + cmd = { 'selene-3p-language-server' }, + filetypes = { 'lua' }, + root_dir = util.root_pattern('selene.toml'), + }, + docs = { + description = [[ +https://github.com/antonk52/lua-3p-language-servers + +3rd party Language Server for Selene lua linter +]], + }, +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/stylua3p_ls.lua new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/stylua3p_ls.lua --- old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/stylua3p_ls.lua 1970-01-01 01:00:00.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/stylua3p_ls.lua 2025-01-29 17:07:58.000000000 +0100 @@ -0,0 +1,16 @@ +local util = require('lspconfig.util') + +return { + default_config = { + cmd = { 'stylua-3p-language-server' }, + filetypes = { 'lua' }, + root_dir = util.root_pattern('.stylua.toml', 'stylua.toml'), + }, + docs = { + description = [[ +https://github.com/antonk52/lua-3p-language-servers + +3rd party Language Server for Stylua lua formatter +]], + }, +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/texlab.lua new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/texlab.lua --- old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/texlab.lua 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/texlab.lua 2025-01-29 17:07:58.000000000 +0100 @@ -81,7 +81,7 @@ if err then vim.notify(('Failed to clean %s files: %s'):format(cmd, err.message), vim.log.levels.ERROR) else - vim.notify(('cmmand %s execute successfully'):format(cmd), vim.log.levels.INFO) + vim.notify(('command %s executed successfully'):format(cmd), vim.log.levels.INFO) end end) end @@ -90,7 +90,7 @@ command = cmd_tbl[cmd], arguments = { { uri = vim.uri_from_bufnr(bufnr) } }, } - vim.notify(('command %s execute successfully'):format(cmd_tbl[cmd])) + vim.notify(('command %s executed successfully'):format(cmd_tbl[cmd])) end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/volar.lua new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/volar.lua --- old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/volar.lua 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/volar.lua 2025-01-29 17:07:58.000000000 +0100 @@ -1,8 +1,8 @@ local util = require 'lspconfig.util' local function get_typescript_server_path(root_dir) - local project_root = vim.fs.find('node_modules', { path = root_dir, upward = true })[1] - return project_root and (project_root .. '/typescript/lib') or '' + local project_root = vim.fs.dirname(vim.fs.find('node_modules', { path = root_dir, upward = true })[1]) + return project_root and (project_root .. '/node_modules/typescript/lib') or '' end -- https://github.com/vuejs/language-tools/blob/master/packages/language-server/lib/types.ts diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/yamlls.lua new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/yamlls.lua --- old/nvim-lspconfig-1.3.0/lua/lspconfig/configs/yamlls.lua 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/lua/lspconfig/configs/yamlls.lua 2025-01-29 17:07:58.000000000 +0100 @@ -64,7 +64,7 @@ yaml = { ... -- other settings. note this overrides the lspconfig defaults. schemas = { - ["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.18.0-standalone-strict/all.json"] = "/*.k8s.yaml", + ["https://raw.githubusercontent.com/yannh/kubernetes-json-schema/refs/heads/master/v1.32.1-standalone-strict/all.json"] = "/*.k8s.yaml", ... -- other schemas }, }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/lua/lspconfig/configs.lua new/nvim-lspconfig-1.6.0/lua/lspconfig/configs.lua --- old/nvim-lspconfig-1.3.0/lua/lspconfig/configs.lua 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/lua/lspconfig/configs.lua 2025-01-29 17:07:58.000000000 +0100 @@ -1,6 +1,11 @@ +-- This entire module will only be usfeul for Nvim older than 0.11, since vim.lsp.config makes this module obsolete. So +-- it's easier to just disable all warnings for now and remove this file when it's no longer relevant. +--- @diagnostic disable: assign-type-mismatch +--- @diagnostic disable: param-type-mismatch + local util = require 'lspconfig.util' local async = require 'lspconfig.async' -local api, validate, lsp, fn = vim.api, vim.validate, vim.lsp, vim.fn +local api, lsp, fn = vim.api, vim.lsp, vim.fn local tbl_deep_extend = vim.tbl_deep_extend local configs = {} @@ -34,14 +39,6 @@ ---@param config_name string ---@param config_def table Config definition read from `lspconfig.configs.<name>`. 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, @@ -52,16 +49,7 @@ ) 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 + config_def.commands = config_def.commands or {} local M = {} @@ -74,27 +62,6 @@ 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, { 's', '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) sanitize_cmd(config.cmd) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/lua/lspconfig/util.lua new/nvim-lspconfig-1.6.0/lua/lspconfig/util.lua --- old/nvim-lspconfig-1.3.0/lua/lspconfig/util.lua 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/lua/lspconfig/util.lua 2025-01-29 17:07:58.000000000 +0100 @@ -5,7 +5,7 @@ local iswin = vim.loop.os_uname().version:match 'Windows' -local M = {} +local M = { path = {} } M.default_config = { log_level = lsp.protocol.MessageType.Warning, @@ -95,57 +95,6 @@ end end --- Some path utilities -M.path = (function() - --- @param path string - --- @return boolean - local function is_fs_root(path) - if iswin then - return path:match '^%a:$' - else - return path == '/' - end - end - - -- Traverse the path calling cb along the way. - local function traverse_parents(path, cb) - path = vim.loop.fs_realpath(path) - local dir = path - -- Just in case our algo is buggy, don't infinite loop. - for _ = 1, 100 do - dir = vim.fs.dirname(dir) - if not dir then - return - end - -- If we can't ascend further, then stop looking. - if cb(dir, path) then - return dir, path - end - if is_fs_root(dir) then - break - end - end - end - - local function is_descendant(root, path) - if not path then - return false - end - - local function cb(dir, _) - return dir == root - end - - local dir, _ = traverse_parents(path, cb) - - return dir == root - end - - return { - is_descendant = is_descendant, - } -end)() - function M.search_ancestors(startpath, func) if nvim_eleven then validate('func', func, 'function') @@ -274,6 +223,7 @@ return clients end +--- @deprecated use `vim.lsp.config` in Nvim 0.11+ instead. function M.available_servers() local servers = {} local configs = require 'lspconfig.configs' @@ -294,7 +244,52 @@ return path end ---- Functions that can be removed once minimum required neovim version is high enough +--- Public functions that can be deprecated once minimum required neovim version is high enough + +local function is_fs_root(path) + if iswin then + return path:match '^%a:$' + else + return path == '/' + end +end + +-- Traverse the path calling cb along the way. +local function traverse_parents(path, cb) + path = vim.loop.fs_realpath(path) + local dir = path + -- Just in case our algo is buggy, don't infinite loop. + for _ = 1, 100 do + dir = vim.fs.dirname(dir) + if not dir then + return + end + -- If we can't ascend further, then stop looking. + if cb(dir, path) then + return dir, path + end + if is_fs_root(dir) then + break + end + end +end + +--- This can be replaced with `vim.fs.relpath` once minimum neovim version is at least 0.11. +function M.path.is_descendant(root, path) + if not path then + return false + end + + local function cb(dir, _) + return dir == root + end + + local dir, _ = traverse_parents(path, cb) + + return dir == root +end + +--- Helper functions that can be removed once minimum required neovim version is high enough function M.tbl_flatten(t) --- @diagnostic disable-next-line:deprecated diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/plugin/lspconfig.lua new/nvim-lspconfig-1.6.0/plugin/lspconfig.lua --- old/nvim-lspconfig-1.3.0/plugin/lspconfig.lua 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/plugin/lspconfig.lua 2025-01-29 17:07:58.000000000 +0100 @@ -90,6 +90,8 @@ api.nvim_create_user_command('LspRestart', function(info) local detach_clients = {} for _, client in ipairs(get_clients_from_cmd_args(info.args)) do + -- Can remove diagnostic disabling when changing to client:stop() in nvim 0.11+ + --- @diagnostic disable: missing-parameter client.stop() if vim.tbl_count(client.attached_buffers) > 0 then detach_clients[client.name] = { client, lsp.get_buffers_by_client_id(client.id) } @@ -142,6 +144,8 @@ end for _, client in ipairs(clients) do + -- Can remove diagnostic disabling when changing to client:stop(force) in nvim 0.11+ + --- @diagnostic disable: param-type-mismatch client.stop(force) end end, { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/scripts/docgen.lua new/nvim-lspconfig-1.6.0/scripts/docgen.lua --- old/nvim-lspconfig-1.3.0/scripts/docgen.lua 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/scripts/docgen.lua 2025-01-29 17:07:58.000000000 +0100 @@ -1,3 +1,7 @@ +#!/usr/bin/env -S nvim -l +local root = vim.trim(vim.system({ 'git', 'rev-parse', '--show-toplevel' }):wait().stdout) +vim.opt.rtp:append(root) + require 'lspconfig' local configs = require 'lspconfig.configs' local util = require 'lspconfig.util' @@ -89,7 +93,7 @@ vim.env.XDG_CACHE_HOME = '/home/user/.cache' -- Configs are lazy-loaded, tickle them to populate the `configs` singleton. - for _, v in ipairs(vim.fn.glob('lua/lspconfig/configs/*.lua', true, true)) do + for _, v in ipairs(vim.fn.glob(vim.fs.joinpath(root, 'lua/lspconfig/configs/*.lua'), true, true)) do local module_name = v:gsub('.*/', ''):gsub('%.lua$', '') configs[module_name] = require('lspconfig.configs.' .. module_name) end @@ -107,7 +111,7 @@ local template_def = template_object.config_def local docs = template_def.docs -- "lua/lspconfig/configs/xx.lua" - local config_file = ('lua/lspconfig/configs/%s.lua'):format(config_name) + local config_file = (vim.fs.joinpath(root, 'lua/lspconfig/configs/%s.lua')):format(config_name) local params = { config_name = config_name, @@ -155,13 +159,14 @@ end end io.close(file) + local config_relpath = vim.fs.relpath(root, config_file) -- XXX: "../" because the path is outside of the doc/ dir. return ('- `%s` source (use "gF" to visit): [../%s:%d](../%s#L%d)'):format( k, - config_file, + config_relpath, linenr, - config_file, + config_relpath, linenr ) end), @@ -284,14 +289,17 @@ local input_template = readfile(template_file) local readme_data = template(input_template, params) - local writer = assert(io.open('doc/configs.md', 'w')) + local conf_md = vim.fs.joinpath(root, 'doc/configs.md') + local conf_txt = vim.fs.joinpath(root, 'doc/configs.txt') + + local writer = assert(io.open(conf_md, 'w')) writer:write(readme_data) writer:close() - vim.loop.fs_copyfile('doc/configs.md', 'doc/configs.txt') + vim.loop.fs_copyfile(conf_md, conf_txt) end require_all_configs() -generate_readme('scripts/docs_template.md', { +generate_readme(vim.fs.joinpath(root, 'scripts/docs_template.md'), { implemented_servers_list = make_implemented_servers_list(), lsp_server_details = make_lsp_sections(), }) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nvim-lspconfig-1.3.0/scripts/docgen.sh new/nvim-lspconfig-1.6.0/scripts/docgen.sh --- old/nvim-lspconfig-1.3.0/scripts/docgen.sh 2025-01-05 14:42:44.000000000 +0100 +++ new/nvim-lspconfig-1.6.0/scripts/docgen.sh 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -#!/bin/sh -exec nvim -u NONE -E -R --headless +'set rtp+=$PWD' +'luafile scripts/docgen.lua' +q
