1

Refresh generated neovim config

This commit is contained in:
2024-08-15 13:01:03 +02:00
parent 64b51cf53a
commit f5af8e2b28
1836 changed files with 38979 additions and 31094 deletions

View File

@ -1,3 +1,4 @@
als
edn
esy
protols

View File

@ -9,7 +9,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: LuaRocks Upload
uses: nvim-neorocks/luarocks-tag-release@v6
uses: nvim-neorocks/luarocks-tag-release@v7
env:
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
with:

View File

@ -21,8 +21,10 @@ autogenerated from the Lua files. You can view this file in Nvim by running
- [awk_ls](#awk_ls)
- [azure_pipelines_ls](#azure_pipelines_ls)
- [bacon_ls](#bacon_ls)
- [ballerina](#ballerina)
- [basedpyright](#basedpyright)
- [bashls](#bashls)
- [bazelrc-lsp](#bazelrc-lsp)
- [beancount](#beancount)
- [bicep](#bicep)
- [biome](#biome)
@ -107,6 +109,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running
- [ghdl_ls](#ghdl_ls)
- [ginko_ls](#ginko_ls)
- [gitlab_ci_ls](#gitlab_ci_ls)
- [glasgow](#glasgow)
- [gleam](#gleam)
- [glint](#glint)
- [glsl_analyzer](#glsl_analyzer)
@ -133,6 +136,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running
- [hyprls](#hyprls)
- [idris2_lsp](#idris2_lsp)
- [intelephense](#intelephense)
- [janet_lsp](#janet_lsp)
- [java_language_server](#java_language_server)
- [jdtls](#jdtls)
- [jedi_language_server](#jedi_language_server)
@ -207,7 +211,9 @@ autogenerated from the Lua files. You can view this file in Nvim by running
- [prismals](#prismals)
- [prolog_ls](#prolog_ls)
- [prosemd_lsp](#prosemd_lsp)
- [protols](#protols)
- [psalm](#psalm)
- [pug](#pug)
- [puppet](#puppet)
- [purescriptls](#purescriptls)
- [pylsp](#pylsp)
@ -269,6 +275,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running
- [steep](#steep)
- [stimulus_ls](#stimulus_ls)
- [stylelint_lsp](#stylelint_lsp)
- [superhtml](#superhtml)
- [svelte](#svelte)
- [svlangserver](#svlangserver)
- [svls](#svls)
@ -511,7 +518,7 @@ require'lspconfig'.angularls.setup{}
```
- `filetypes` :
```lua
{ "typescript", "html", "typescriptreact", "typescript.tsx" }
{ "typescript", "html", "typescriptreact", "typescript.tsx", "htmlangular" }
```
- `root_dir` :
```lua
@ -683,10 +690,10 @@ If you don't have a sketch yet create one.
```sh
$ arduino-cli sketch new test
$ cd test
$ cd test
```
You will need a `sketch.yaml` file in order for the language server to understand your project. It will also save you passing options to `arduino-cli` each time you compile or upload a file. You can generate the file like using the following commands.
You will need a `sketch.yaml` file in order for the language server to understand your project. It will also save you passing options to `arduino-cli` each time you compile or upload a file. You can generate the file by using the following commands.
First gather some information about your board. Make sure your board is connected and run the following:
@ -703,7 +710,7 @@ Then generate the file:
arduino-cli board attach -p /dev/ttyACM0 -b arduino:avr:uno test.ino
```
The resulting file should like like this:
The resulting file should look like this:
```yaml
default_fqbn: arduino:avr:uno
@ -718,7 +725,7 @@ Your folder structure should look like this:
└── sketch.yaml
```
For further instruction about configuration options, run `arduino-language-server --help`.
For further instructions about configuration options, run `arduino-language-server --help`.
Note that an upstream bug makes keywords in some cases become undefined by the language server.
Ref: https://github.com/arduino/arduino-ide/issues/159
@ -1055,6 +1062,36 @@ require'lspconfig'.bacon_ls.setup{}
```
## ballerina
Ballerina language server
The Ballerina language's CLI tool comes with its own language server implementation.
The `bal` command line tool must be installed and available in your system's PATH.
**Snippet to enable the language server:**
```lua
require'lspconfig'.ballerina.setup{}
```
**Default values:**
- `cmd` :
```lua
{ "bal", "start-language-server" }
```
- `filetypes` :
```lua
{ "ballerina" }
```
- `root_dir` :
```lua
see source file
```
## basedpyright
https://detachhead.github.io/basedpyright
@ -1148,6 +1185,45 @@ require'lspconfig'.bashls.setup{}
```
## bazelrc-lsp
https://github.com/salesforce-misc/bazelrc-lsp
`bazelrc-lsp` is a LSP for `.bazelrc` configuration files.
The `.bazelrc` file type is not detected automatically, you can register it manually (see below) or override the filetypes:
```lua
vim.filetype.add {
pattern = {
['.*.bazelrc'] = 'bazelrc',
},
}
```
**Snippet to enable the language server:**
```lua
require'lspconfig'.bazelrc-lsp.setup{}
```
**Default values:**
- `cmd` :
```lua
{ "bazelrc-lsp" }
```
- `filetypes` :
```lua
{ "bazelrc" }
```
- `root_dir` :
```lua
see source file
```
## beancount
https://github.com/polarmutex/beancount-language-server#installation
@ -3607,7 +3683,7 @@ require'lspconfig'.emmet_language_server.setup{}
```
- `filetypes` :
```lua
{ "css", "eruby", "html", "htmldjango", "javascriptreact", "less", "pug", "sass", "scss", "typescriptreact" }
{ "css", "eruby", "html", "htmldjango", "javascriptreact", "less", "pug", "sass", "scss", "typescriptreact", "htmlangular" }
```
- `root_dir` :
```lua
@ -3643,7 +3719,7 @@ require'lspconfig'.emmet_ls.setup{}
```
- `filetypes` :
```lua
{ "astro", "css", "eruby", "html", "htmldjango", "javascriptreact", "less", "pug", "sass", "scss", "svelte", "typescriptreact", "vue" }
{ "astro", "css", "eruby", "html", "htmldjango", "javascriptreact", "less", "pug", "sass", "scss", "svelte", "typescriptreact", "vue", "htmlangular" }
```
- `root_dir` :
```lua
@ -4246,6 +4322,29 @@ require'lspconfig'.fsautocomplete.setup{}
```lua
see source file
```
- `settings` :
```lua
{
FSharp = {
EnableReferenceCodeLens = true,
ExternalAutocomplete = false,
InterfaceStubGeneration = true,
InterfaceStubGenerationMethodBody = 'failwith "Not Implemented"',
InterfaceStubGenerationObjectIdentifier = "this",
Linter = true,
RecordStubGeneration = true,
RecordStubGenerationBody = 'failwith "Not Implemented"',
ResolveNamespaces = true,
SimplifyNameAnalyzer = true,
UnionCaseStubGeneration = true,
UnionCaseStubGenerationBody = 'failwith "Not Implemented"',
UnusedDeclarationsAnalyzer = true,
UnusedOpensAnalyzer = true,
UseSdkScripts = true,
keywordsAutocomplete = true
}
}
```
## fsharp_language_server
@ -4563,6 +4662,60 @@ require'lspconfig'.gitlab_ci_ls.setup{}
```
## glasgow
https://github.com/nolanderc/glasgow
Provides language features for WGSL (WebGPU Shading Language):
- Completions:
- Local functions/variables/types.
- Fields and swizzles.
- Builtin types and functions (`dot`, `reflect`, `textureSample`, `vec3`, `mat4x2`, etc.)
- Hover Documentation:
- Function signatures.
- Variable types.
- Includes builtin types and functions. Text is taken from the WGSL specification.
- Goto Definition
- Find all References
- Rename
- Formatter
`glasgow` can be installed via `cargo`:
```sh
cargo install glasgow
```
**Snippet to enable the language server:**
```lua
require'lspconfig'.glasgow.setup{}
```
**Default values:**
- `cmd` :
```lua
{ "glasgow" }
```
- `filetypes` :
```lua
{ "wgsl" }
```
- `root_dir` :
```lua
root_pattern(".git")
```
- `settings` :
```lua
{}
```
- `single_file_support` :
```lua
true
```
## gleam
https://github.com/gleam-lang/gleam
@ -5050,7 +5203,7 @@ require'lspconfig'.harper_ls.setup{}
```
- `filetypes` :
```lua
{ "markdown", "rust", "typescript", "typescriptreact", "javascript", "python", "go", "c", "cpp", "ruby", "swift", "csharp", "toml", "lua" }
{ "markdown", "rust", "typescript", "typescriptreact", "javascript", "python", "go", "c", "cpp", "ruby", "swift", "csharp", "toml", "lua", "gitcommit", "java", "html" }
```
- `root_dir` :
```lua
@ -5561,7 +5714,7 @@ require'lspconfig'.hyprls.setup{}
```
- `filetypes` :
```lua
{ "*.hl", "hypr*.conf", ".config/hypr/*.conf" }
{ "hyprlang", "*.hl", "hypr*.conf", ".config/hypr/*.conf" }
```
- `root_dir` :
```lua
@ -5659,6 +5812,39 @@ require'lspconfig'.intelephense.setup{}
```
## janet_lsp
https://github.com/CFiggers/janet-lsp
A Language Server Protocol implementation for Janet.
**Snippet to enable the language server:**
```lua
require'lspconfig'.janet_lsp.setup{}
```
**Default values:**
- `cmd` :
```lua
{ "janet-lsp", "--stdio" }
```
- `filetypes` :
```lua
{ "janet" }
```
- `root_dir` :
```lua
see source file
```
- `single_file_support` :
```lua
true
```
## java_language_server
https://github.com/georgewfraser/java-language-server
@ -6062,21 +6248,17 @@ require'lspconfig'.koka.setup{}
**Default values:**
- `capabilities` :
```lua
default capabilities, with offsetEncoding utf-8
```
- `cmd` :
```lua
{ "koka", "--language-server" }
{ "koka", "--language-server", "--lsstdio" }
```
- `filetypes` :
```lua
{ "kk" }
{ "koka" }
```
- `root_dir` :
```lua
git directory
```
- `single_file_support` :
```lua
@ -6185,8 +6367,8 @@ https://github.com/leanprover/lean4
Lean installation instructions can be found
[here](https://leanprover-community.github.io/get_started.html#regular-install).
The Lean 4 language server is built-in with a Lean 4 install
(and can be manually run with, e.g., `lean --server`).
The Lean language server is included in any Lean installation and
does not require any additional packages.
Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim),
that plugin fully handles the setup of the Lean language server,
@ -6213,15 +6395,9 @@ require'lspconfig'.leanls.setup{}
```lua
see source file
```
- `options` :
```lua
{
no_lake_lsp_cmd = { "lean", "--server" }
}
```
- `root_dir` :
```lua
root_pattern("lakefile.lean", "lean-toolchain", "leanpkg.toml", ".git")
root_pattern("lakefile.toml", "lakefile.lean", "lean-toolchain", ".git")
```
- `single_file_support` :
```lua
@ -7285,6 +7461,18 @@ https://github.com/Decodetalkers/neocmakelsp
CMake LSP Implementation
Neovim does not currently include built-in snippets. `neocmakelsp` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup.
```lua
--Enable (broadcasting) snippet capability for completion
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
require'lspconfig'.neocmake.setup {
capabilities = capabilities,
}
```
**Snippet to enable the language server:**
@ -8737,6 +8925,44 @@ require'lspconfig'.prosemd_lsp.setup{}
```
## protols
https://github.com/coder3101/protols
`protols` can be installed via `cargo`:
```sh
cargo install protols
```
A Language Server for proto3 files. It uses tree-sitter and runs in single file mode.
**Snippet to enable the language server:**
```lua
require'lspconfig'.protols.setup{}
```
**Default values:**
- `cmd` :
```lua
{ "protols" }
```
- `filetypes` :
```lua
{ "proto" }
```
- `root_dir` :
```lua
see source file
```
- `single_file_support` :
```lua
true
```
## psalm
https://github.com/vimeo/psalm
@ -8769,6 +8995,37 @@ require'lspconfig'.psalm.setup{}
```
## pug
https://github.com/opa-oz/pug-lsp
An implementation of the Language Protocol Server for [Pug.js](http://pugjs.org)
PugLSP can be installed via `go get github.com/opa-oz/pug-lsp`, or manually downloaded from [releases page](https://github.com/opa-oz/pug-lsp/releases)
**Snippet to enable the language server:**
```lua
require'lspconfig'.pug.setup{}
```
**Default values:**
- `cmd` :
```lua
{ "pug-lsp" }
```
- `filetypes` :
```lua
{ "pug" }
```
- `root_dir` :
```lua
see source file
```
## puppet
LSP server for Puppet.
@ -9802,22 +10059,29 @@ require'lspconfig'.ruby_lsp.setup{}
https://github.com/astral-sh/ruff
A Language Server Protocol implementation for Ruff, an extremely fast Python linter and code formatter, written in Rust. It can be installed via pip.
A Language Server Protocol implementation for Ruff, an extremely fast Python linter and code formatter, written in Rust. It can be installed via `pip`.
```sh
pip install ruff
```
_Requires Ruff v0.3.3 or later._
**Available in Ruff `v0.4.5` in beta and stabilized in Ruff `v0.5.3`.**
This is the new Rust-based version of the original `ruff-lsp` implementation. It's currently in alpha, meaning that some features are under development. Currently, the following capabilities are supported:
This is the new built-in language server written in Rust. It supports the same feature set as `ruff-lsp`, but with superior performance and no installation required. Note that the `ruff-lsp` server will continue to be maintained until further notice.
1. Diagnostics
2. Code actions
3. Formatting
4. Range Formatting
Server settings can be provided via:
Please note that the `ruff-lsp` server will continue to be maintained until further notice.
```lua
require('lspconfig').ruff.setup({
init_options = {
settings = {
-- Server settings should go here
}
}
})
```
Refer to the [documentation](https://docs.astral.sh/ruff/editors/) for more details.
@ -9831,7 +10095,7 @@ require'lspconfig'.ruff.setup{}
**Default values:**
- `cmd` :
```lua
{ "ruff", "server", "--preview" }
{ "ruff", "server" }
```
- `filetypes` :
```lua
@ -9959,6 +10223,9 @@ require'lspconfig'.rust_analyzer.setup{
}
}
```
Note: do not set `init_options` for this LS config, it will be automatically populated by the contents of settings["rust-analyzer"] per
https://github.com/rust-lang/rust-analyzer/blob/eb5da56d839ae0a9e9f50774fa3eb78eb0964550/docs/dev/lsp-extensions.md?plain=1#L26.
@ -9970,6 +10237,10 @@ require'lspconfig'.rust_analyzer.setup{}
- CargoReload: Reload current cargo workspace
**Default values:**
- `before_init` :
```lua
see source file
```
- `capabilities` :
```lua
{
@ -10137,10 +10408,6 @@ https://shopify.dev/docs/api/shopify-cli
`shopify` can be installed via npm `npm install -g @shopify/cli`.
```lua
require lspconfig.shopify_theme_ls.setup {}
```
Note: This LSP already includes Theme Check so you don't need to use the `theme_check` server configuration as well.
@ -11292,6 +11559,51 @@ require'lspconfig'.stylelint_lsp.setup{}
```
## superhtml
https://github.com/kristoff-it/superhtml
HTML Language Server & Templating Language Library
This LSP is designed to tightly adhere to the HTML spec as well as enforcing
some additional rules that ensure HTML clarity.
If you want to disable HTML support for another HTML LSP, add the following
to your configuration:
```lua
require'lspconfig'.superhtml.setup {
filetypes = { 'superhtml' }
}
```
**Snippet to enable the language server:**
```lua
require'lspconfig'.superhtml.setup{}
```
**Default values:**
- `cmd` :
```lua
{ "superhtml", "lsp" }
```
- `filetypes` :
```lua
{ "superhtml", "html" }
```
- `root_dir` :
```lua
util.find_git_ancestor
```
- `single_file_support` :
```lua
true
```
## svelte
https://github.com/sveltejs/language-tools/tree/master/packages/language-server
@ -11539,17 +11851,7 @@ require'lspconfig'.tailwindcss.setup{}
```
- `filetypes` :
```lua
{ "aspnetcorerazor", "astro", "astro-markdown", "blade", "clojure", "django-html", "htmldjango", "edge", "eelixir", "elixir", "ejs", "erb", "eruby", "gohtml", "gohtmltmpl", "haml", "handlebars", "hbs", "html", "html-eex", "heex", "jade", "leaf", "liquid", "markdown", "mdx", "mustache", "njk", "nunjucks", "php", "razor", "slim", "twig", "css", "less", "postcss", "sass", "scss", "stylus", "sugarss", "javascript", "javascriptreact", "reason", "rescript", "typescript", "typescriptreact", "vue", "svelte", "templ" }
```
- `init_options` :
```lua
{
userLanguages = {
eelixir = "html-eex",
eruby = "erb",
templ = "html"
}
}
{ "aspnetcorerazor", "astro", "astro-markdown", "blade", "clojure", "django-html", "htmldjango", "edge", "eelixir", "elixir", "ejs", "erb", "eruby", "gohtml", "gohtmltmpl", "haml", "handlebars", "hbs", "html", "htmlangular", "html-eex", "heex", "jade", "leaf", "liquid", "markdown", "mdx", "mustache", "njk", "nunjucks", "php", "razor", "slim", "twig", "css", "less", "postcss", "sass", "scss", "stylus", "sugarss", "javascript", "javascriptreact", "reason", "rescript", "typescript", "typescriptreact", "vue", "svelte", "templ" }
```
- `on_new_config` :
```lua
@ -11564,6 +11866,12 @@ require'lspconfig'.tailwindcss.setup{}
{
tailwindCSS = {
classAttributes = { "class", "className", "class:list", "classList", "ngClass" },
includeLanguages = {
eelixir = "html-eex",
eruby = "erb",
htmlangular = "html",
templ = "html"
},
lint = {
cssConflict = "warning",
invalidApply = "error",
@ -11835,6 +12143,12 @@ require'lspconfig'.texlab.setup{}
```
**Commands:**
- TexlabBuild: Build the current buffer
- TexlabCancelBuild: Cancel the current build
- TexlabChangeEnvironment: Change the environment at current position
- TexlabCleanArtifacts: Clean the artifacts
- TexlabCleanAuxiliary: Clean the auxiliary files
- TexlabDependencyGraph: Show the dependency graph
- TexlabFindEnvironments: Find the environments at current position
- TexlabForward: Forward search from current position
**Default values:**

View File

@ -21,8 +21,10 @@ autogenerated from the Lua files. You can view this file in Nvim by running
- [awk_ls](#awk_ls)
- [azure_pipelines_ls](#azure_pipelines_ls)
- [bacon_ls](#bacon_ls)
- [ballerina](#ballerina)
- [basedpyright](#basedpyright)
- [bashls](#bashls)
- [bazelrc-lsp](#bazelrc-lsp)
- [beancount](#beancount)
- [bicep](#bicep)
- [biome](#biome)
@ -107,6 +109,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running
- [ghdl_ls](#ghdl_ls)
- [ginko_ls](#ginko_ls)
- [gitlab_ci_ls](#gitlab_ci_ls)
- [glasgow](#glasgow)
- [gleam](#gleam)
- [glint](#glint)
- [glsl_analyzer](#glsl_analyzer)
@ -133,6 +136,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running
- [hyprls](#hyprls)
- [idris2_lsp](#idris2_lsp)
- [intelephense](#intelephense)
- [janet_lsp](#janet_lsp)
- [java_language_server](#java_language_server)
- [jdtls](#jdtls)
- [jedi_language_server](#jedi_language_server)
@ -207,7 +211,9 @@ autogenerated from the Lua files. You can view this file in Nvim by running
- [prismals](#prismals)
- [prolog_ls](#prolog_ls)
- [prosemd_lsp](#prosemd_lsp)
- [protols](#protols)
- [psalm](#psalm)
- [pug](#pug)
- [puppet](#puppet)
- [purescriptls](#purescriptls)
- [pylsp](#pylsp)
@ -269,6 +275,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running
- [steep](#steep)
- [stimulus_ls](#stimulus_ls)
- [stylelint_lsp](#stylelint_lsp)
- [superhtml](#superhtml)
- [svelte](#svelte)
- [svlangserver](#svlangserver)
- [svls](#svls)
@ -511,7 +518,7 @@ require'lspconfig'.angularls.setup{}
```
- `filetypes` :
```lua
{ "typescript", "html", "typescriptreact", "typescript.tsx" }
{ "typescript", "html", "typescriptreact", "typescript.tsx", "htmlangular" }
```
- `root_dir` :
```lua
@ -683,10 +690,10 @@ If you don't have a sketch yet create one.
```sh
$ arduino-cli sketch new test
$ cd test
$ cd test
```
You will need a `sketch.yaml` file in order for the language server to understand your project. It will also save you passing options to `arduino-cli` each time you compile or upload a file. You can generate the file like using the following commands.
You will need a `sketch.yaml` file in order for the language server to understand your project. It will also save you passing options to `arduino-cli` each time you compile or upload a file. You can generate the file by using the following commands.
First gather some information about your board. Make sure your board is connected and run the following:
@ -703,7 +710,7 @@ Then generate the file:
arduino-cli board attach -p /dev/ttyACM0 -b arduino:avr:uno test.ino
```
The resulting file should like like this:
The resulting file should look like this:
```yaml
default_fqbn: arduino:avr:uno
@ -718,7 +725,7 @@ Your folder structure should look like this:
└── sketch.yaml
```
For further instruction about configuration options, run `arduino-language-server --help`.
For further instructions about configuration options, run `arduino-language-server --help`.
Note that an upstream bug makes keywords in some cases become undefined by the language server.
Ref: https://github.com/arduino/arduino-ide/issues/159
@ -1055,6 +1062,36 @@ require'lspconfig'.bacon_ls.setup{}
```
## ballerina
Ballerina language server
The Ballerina language's CLI tool comes with its own language server implementation.
The `bal` command line tool must be installed and available in your system's PATH.
**Snippet to enable the language server:**
```lua
require'lspconfig'.ballerina.setup{}
```
**Default values:**
- `cmd` :
```lua
{ "bal", "start-language-server" }
```
- `filetypes` :
```lua
{ "ballerina" }
```
- `root_dir` :
```lua
see source file
```
## basedpyright
https://detachhead.github.io/basedpyright
@ -1148,6 +1185,45 @@ require'lspconfig'.bashls.setup{}
```
## bazelrc-lsp
https://github.com/salesforce-misc/bazelrc-lsp
`bazelrc-lsp` is a LSP for `.bazelrc` configuration files.
The `.bazelrc` file type is not detected automatically, you can register it manually (see below) or override the filetypes:
```lua
vim.filetype.add {
pattern = {
['.*.bazelrc'] = 'bazelrc',
},
}
```
**Snippet to enable the language server:**
```lua
require'lspconfig'.bazelrc-lsp.setup{}
```
**Default values:**
- `cmd` :
```lua
{ "bazelrc-lsp" }
```
- `filetypes` :
```lua
{ "bazelrc" }
```
- `root_dir` :
```lua
see source file
```
## beancount
https://github.com/polarmutex/beancount-language-server#installation
@ -3607,7 +3683,7 @@ require'lspconfig'.emmet_language_server.setup{}
```
- `filetypes` :
```lua
{ "css", "eruby", "html", "htmldjango", "javascriptreact", "less", "pug", "sass", "scss", "typescriptreact" }
{ "css", "eruby", "html", "htmldjango", "javascriptreact", "less", "pug", "sass", "scss", "typescriptreact", "htmlangular" }
```
- `root_dir` :
```lua
@ -3643,7 +3719,7 @@ require'lspconfig'.emmet_ls.setup{}
```
- `filetypes` :
```lua
{ "astro", "css", "eruby", "html", "htmldjango", "javascriptreact", "less", "pug", "sass", "scss", "svelte", "typescriptreact", "vue" }
{ "astro", "css", "eruby", "html", "htmldjango", "javascriptreact", "less", "pug", "sass", "scss", "svelte", "typescriptreact", "vue", "htmlangular" }
```
- `root_dir` :
```lua
@ -4246,6 +4322,29 @@ require'lspconfig'.fsautocomplete.setup{}
```lua
see source file
```
- `settings` :
```lua
{
FSharp = {
EnableReferenceCodeLens = true,
ExternalAutocomplete = false,
InterfaceStubGeneration = true,
InterfaceStubGenerationMethodBody = 'failwith "Not Implemented"',
InterfaceStubGenerationObjectIdentifier = "this",
Linter = true,
RecordStubGeneration = true,
RecordStubGenerationBody = 'failwith "Not Implemented"',
ResolveNamespaces = true,
SimplifyNameAnalyzer = true,
UnionCaseStubGeneration = true,
UnionCaseStubGenerationBody = 'failwith "Not Implemented"',
UnusedDeclarationsAnalyzer = true,
UnusedOpensAnalyzer = true,
UseSdkScripts = true,
keywordsAutocomplete = true
}
}
```
## fsharp_language_server
@ -4563,6 +4662,60 @@ require'lspconfig'.gitlab_ci_ls.setup{}
```
## glasgow
https://github.com/nolanderc/glasgow
Provides language features for WGSL (WebGPU Shading Language):
- Completions:
- Local functions/variables/types.
- Fields and swizzles.
- Builtin types and functions (`dot`, `reflect`, `textureSample`, `vec3`, `mat4x2`, etc.)
- Hover Documentation:
- Function signatures.
- Variable types.
- Includes builtin types and functions. Text is taken from the WGSL specification.
- Goto Definition
- Find all References
- Rename
- Formatter
`glasgow` can be installed via `cargo`:
```sh
cargo install glasgow
```
**Snippet to enable the language server:**
```lua
require'lspconfig'.glasgow.setup{}
```
**Default values:**
- `cmd` :
```lua
{ "glasgow" }
```
- `filetypes` :
```lua
{ "wgsl" }
```
- `root_dir` :
```lua
root_pattern(".git")
```
- `settings` :
```lua
{}
```
- `single_file_support` :
```lua
true
```
## gleam
https://github.com/gleam-lang/gleam
@ -5050,7 +5203,7 @@ require'lspconfig'.harper_ls.setup{}
```
- `filetypes` :
```lua
{ "markdown", "rust", "typescript", "typescriptreact", "javascript", "python", "go", "c", "cpp", "ruby", "swift", "csharp", "toml", "lua" }
{ "markdown", "rust", "typescript", "typescriptreact", "javascript", "python", "go", "c", "cpp", "ruby", "swift", "csharp", "toml", "lua", "gitcommit", "java", "html" }
```
- `root_dir` :
```lua
@ -5561,7 +5714,7 @@ require'lspconfig'.hyprls.setup{}
```
- `filetypes` :
```lua
{ "*.hl", "hypr*.conf", ".config/hypr/*.conf" }
{ "hyprlang", "*.hl", "hypr*.conf", ".config/hypr/*.conf" }
```
- `root_dir` :
```lua
@ -5659,6 +5812,39 @@ require'lspconfig'.intelephense.setup{}
```
## janet_lsp
https://github.com/CFiggers/janet-lsp
A Language Server Protocol implementation for Janet.
**Snippet to enable the language server:**
```lua
require'lspconfig'.janet_lsp.setup{}
```
**Default values:**
- `cmd` :
```lua
{ "janet-lsp", "--stdio" }
```
- `filetypes` :
```lua
{ "janet" }
```
- `root_dir` :
```lua
see source file
```
- `single_file_support` :
```lua
true
```
## java_language_server
https://github.com/georgewfraser/java-language-server
@ -6062,21 +6248,17 @@ require'lspconfig'.koka.setup{}
**Default values:**
- `capabilities` :
```lua
default capabilities, with offsetEncoding utf-8
```
- `cmd` :
```lua
{ "koka", "--language-server" }
{ "koka", "--language-server", "--lsstdio" }
```
- `filetypes` :
```lua
{ "kk" }
{ "koka" }
```
- `root_dir` :
```lua
git directory
```
- `single_file_support` :
```lua
@ -6185,8 +6367,8 @@ https://github.com/leanprover/lean4
Lean installation instructions can be found
[here](https://leanprover-community.github.io/get_started.html#regular-install).
The Lean 4 language server is built-in with a Lean 4 install
(and can be manually run with, e.g., `lean --server`).
The Lean language server is included in any Lean installation and
does not require any additional packages.
Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim),
that plugin fully handles the setup of the Lean language server,
@ -6213,15 +6395,9 @@ require'lspconfig'.leanls.setup{}
```lua
see source file
```
- `options` :
```lua
{
no_lake_lsp_cmd = { "lean", "--server" }
}
```
- `root_dir` :
```lua
root_pattern("lakefile.lean", "lean-toolchain", "leanpkg.toml", ".git")
root_pattern("lakefile.toml", "lakefile.lean", "lean-toolchain", ".git")
```
- `single_file_support` :
```lua
@ -7285,6 +7461,18 @@ https://github.com/Decodetalkers/neocmakelsp
CMake LSP Implementation
Neovim does not currently include built-in snippets. `neocmakelsp` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup.
```lua
--Enable (broadcasting) snippet capability for completion
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
require'lspconfig'.neocmake.setup {
capabilities = capabilities,
}
```
**Snippet to enable the language server:**
@ -8737,6 +8925,44 @@ require'lspconfig'.prosemd_lsp.setup{}
```
## protols
https://github.com/coder3101/protols
`protols` can be installed via `cargo`:
```sh
cargo install protols
```
A Language Server for proto3 files. It uses tree-sitter and runs in single file mode.
**Snippet to enable the language server:**
```lua
require'lspconfig'.protols.setup{}
```
**Default values:**
- `cmd` :
```lua
{ "protols" }
```
- `filetypes` :
```lua
{ "proto" }
```
- `root_dir` :
```lua
see source file
```
- `single_file_support` :
```lua
true
```
## psalm
https://github.com/vimeo/psalm
@ -8769,6 +8995,37 @@ require'lspconfig'.psalm.setup{}
```
## pug
https://github.com/opa-oz/pug-lsp
An implementation of the Language Protocol Server for [Pug.js](http://pugjs.org)
PugLSP can be installed via `go get github.com/opa-oz/pug-lsp`, or manually downloaded from [releases page](https://github.com/opa-oz/pug-lsp/releases)
**Snippet to enable the language server:**
```lua
require'lspconfig'.pug.setup{}
```
**Default values:**
- `cmd` :
```lua
{ "pug-lsp" }
```
- `filetypes` :
```lua
{ "pug" }
```
- `root_dir` :
```lua
see source file
```
## puppet
LSP server for Puppet.
@ -9802,22 +10059,29 @@ require'lspconfig'.ruby_lsp.setup{}
https://github.com/astral-sh/ruff
A Language Server Protocol implementation for Ruff, an extremely fast Python linter and code formatter, written in Rust. It can be installed via pip.
A Language Server Protocol implementation for Ruff, an extremely fast Python linter and code formatter, written in Rust. It can be installed via `pip`.
```sh
pip install ruff
```
_Requires Ruff v0.3.3 or later._
**Available in Ruff `v0.4.5` in beta and stabilized in Ruff `v0.5.3`.**
This is the new Rust-based version of the original `ruff-lsp` implementation. It's currently in alpha, meaning that some features are under development. Currently, the following capabilities are supported:
This is the new built-in language server written in Rust. It supports the same feature set as `ruff-lsp`, but with superior performance and no installation required. Note that the `ruff-lsp` server will continue to be maintained until further notice.
1. Diagnostics
2. Code actions
3. Formatting
4. Range Formatting
Server settings can be provided via:
Please note that the `ruff-lsp` server will continue to be maintained until further notice.
```lua
require('lspconfig').ruff.setup({
init_options = {
settings = {
-- Server settings should go here
}
}
})
```
Refer to the [documentation](https://docs.astral.sh/ruff/editors/) for more details.
@ -9831,7 +10095,7 @@ require'lspconfig'.ruff.setup{}
**Default values:**
- `cmd` :
```lua
{ "ruff", "server", "--preview" }
{ "ruff", "server" }
```
- `filetypes` :
```lua
@ -9959,6 +10223,9 @@ require'lspconfig'.rust_analyzer.setup{
}
}
```
Note: do not set `init_options` for this LS config, it will be automatically populated by the contents of settings["rust-analyzer"] per
https://github.com/rust-lang/rust-analyzer/blob/eb5da56d839ae0a9e9f50774fa3eb78eb0964550/docs/dev/lsp-extensions.md?plain=1#L26.
@ -9970,6 +10237,10 @@ require'lspconfig'.rust_analyzer.setup{}
- CargoReload: Reload current cargo workspace
**Default values:**
- `before_init` :
```lua
see source file
```
- `capabilities` :
```lua
{
@ -10137,10 +10408,6 @@ https://shopify.dev/docs/api/shopify-cli
`shopify` can be installed via npm `npm install -g @shopify/cli`.
```lua
require lspconfig.shopify_theme_ls.setup {}
```
Note: This LSP already includes Theme Check so you don't need to use the `theme_check` server configuration as well.
@ -11292,6 +11559,51 @@ require'lspconfig'.stylelint_lsp.setup{}
```
## superhtml
https://github.com/kristoff-it/superhtml
HTML Language Server & Templating Language Library
This LSP is designed to tightly adhere to the HTML spec as well as enforcing
some additional rules that ensure HTML clarity.
If you want to disable HTML support for another HTML LSP, add the following
to your configuration:
```lua
require'lspconfig'.superhtml.setup {
filetypes = { 'superhtml' }
}
```
**Snippet to enable the language server:**
```lua
require'lspconfig'.superhtml.setup{}
```
**Default values:**
- `cmd` :
```lua
{ "superhtml", "lsp" }
```
- `filetypes` :
```lua
{ "superhtml", "html" }
```
- `root_dir` :
```lua
util.find_git_ancestor
```
- `single_file_support` :
```lua
true
```
## svelte
https://github.com/sveltejs/language-tools/tree/master/packages/language-server
@ -11539,17 +11851,7 @@ require'lspconfig'.tailwindcss.setup{}
```
- `filetypes` :
```lua
{ "aspnetcorerazor", "astro", "astro-markdown", "blade", "clojure", "django-html", "htmldjango", "edge", "eelixir", "elixir", "ejs", "erb", "eruby", "gohtml", "gohtmltmpl", "haml", "handlebars", "hbs", "html", "html-eex", "heex", "jade", "leaf", "liquid", "markdown", "mdx", "mustache", "njk", "nunjucks", "php", "razor", "slim", "twig", "css", "less", "postcss", "sass", "scss", "stylus", "sugarss", "javascript", "javascriptreact", "reason", "rescript", "typescript", "typescriptreact", "vue", "svelte", "templ" }
```
- `init_options` :
```lua
{
userLanguages = {
eelixir = "html-eex",
eruby = "erb",
templ = "html"
}
}
{ "aspnetcorerazor", "astro", "astro-markdown", "blade", "clojure", "django-html", "htmldjango", "edge", "eelixir", "elixir", "ejs", "erb", "eruby", "gohtml", "gohtmltmpl", "haml", "handlebars", "hbs", "html", "htmlangular", "html-eex", "heex", "jade", "leaf", "liquid", "markdown", "mdx", "mustache", "njk", "nunjucks", "php", "razor", "slim", "twig", "css", "less", "postcss", "sass", "scss", "stylus", "sugarss", "javascript", "javascriptreact", "reason", "rescript", "typescript", "typescriptreact", "vue", "svelte", "templ" }
```
- `on_new_config` :
```lua
@ -11564,6 +11866,12 @@ require'lspconfig'.tailwindcss.setup{}
{
tailwindCSS = {
classAttributes = { "class", "className", "class:list", "classList", "ngClass" },
includeLanguages = {
eelixir = "html-eex",
eruby = "erb",
htmlangular = "html",
templ = "html"
},
lint = {
cssConflict = "warning",
invalidApply = "error",
@ -11835,6 +12143,12 @@ require'lspconfig'.texlab.setup{}
```
**Commands:**
- TexlabBuild: Build the current buffer
- TexlabCancelBuild: Cancel the current build
- TexlabChangeEnvironment: Change the environment at current position
- TexlabCleanArtifacts: Clean the artifacts
- TexlabCleanAuxiliary: Clean the auxiliary files
- TexlabDependencyGraph: Show the dependency graph
- TexlabFindEnvironments: Find the environments at current position
- TexlabForward: Forward search from current position
**Default values:**

View File

@ -13,6 +13,7 @@ local configs = {}
--- @field on_new_config? function
--- @field autostart? boolean
--- @field package _on_attach? fun(client: vim.lsp.Client, bufnr: integer)
--- @field root_dir? string|fun(filename: string, bufnr: number)
--- @param cmd any
local function sanitize_cmd(cmd)

View File

@ -21,7 +21,7 @@ return {
'--ngProbeLocations',
default_probe_dir,
},
filetypes = { 'typescript', 'html', 'typescriptreact', 'typescript.tsx' },
filetypes = { 'typescript', 'html', 'typescriptreact', 'typescript.tsx', 'htmlangular' },
-- Check for angular.json since that is the root of the project.
-- Don't check for tsconfig.json or package.json since there are multiple of these
-- in an angular monorepo setup.

View File

@ -46,10 +46,10 @@ If you don't have a sketch yet create one.
```sh
$ arduino-cli sketch new test
$ cd test
$ cd test
```
You will need a `sketch.yaml` file in order for the language server to understand your project. It will also save you passing options to `arduino-cli` each time you compile or upload a file. You can generate the file like using the following commands.
You will need a `sketch.yaml` file in order for the language server to understand your project. It will also save you passing options to `arduino-cli` each time you compile or upload a file. You can generate the file by using the following commands.
First gather some information about your board. Make sure your board is connected and run the following:
@ -66,7 +66,7 @@ Then generate the file:
arduino-cli board attach -p /dev/ttyACM0 -b arduino:avr:uno test.ino
```
The resulting file should like like this:
The resulting file should look like this:
```yaml
default_fqbn: arduino:avr:uno
@ -81,7 +81,7 @@ Your folder structure should look like this:
└── sketch.yaml
```
For further instruction about configuration options, run `arduino-language-server --help`.
For further instructions about configuration options, run `arduino-language-server --help`.
Note that an upstream bug makes keywords in some cases become undefined by the language server.
Ref: https://github.com/arduino/arduino-ide/issues/159

View File

@ -14,6 +14,7 @@ return {
'sass',
'scss',
'typescriptreact',
'htmlangular',
},
root_dir = util.find_git_ancestor,
single_file_support = true,

View File

@ -17,6 +17,7 @@ return {
'svelte',
'typescriptreact',
'vue',
'htmlangular',
},
root_dir = util.find_git_ancestor,
single_file_support = true,

View File

@ -8,6 +8,27 @@ return {
init_options = {
AutomaticWorkspaceInit = true,
},
-- this recommended settings values taken from https://github.com/ionide/FsAutoComplete?tab=readme-ov-file#settings
settings = {
FSharp = {
keywordsAutocomplete = true,
ExternalAutocomplete = false,
Linter = true,
UnionCaseStubGeneration = true,
UnionCaseStubGenerationBody = 'failwith "Not Implemented"',
RecordStubGeneration = true,
RecordStubGenerationBody = 'failwith "Not Implemented"',
InterfaceStubGeneration = true,
InterfaceStubGenerationObjectIdentifier = 'this',
InterfaceStubGenerationMethodBody = 'failwith "Not Implemented"',
UnusedOpensAnalyzer = true,
UnusedDeclarationsAnalyzer = true,
UseSdkScripts = true,
SimplifyNameAnalyzer = true,
ResolveNamespaces = true,
EnableReferenceCodeLens = true,
},
},
},
docs = {
description = [[

View File

@ -18,6 +18,9 @@ return {
'csharp',
'toml',
'lua',
'gitcommit',
'java',
'html',
},
root_dir = util.find_git_ancestor,
single_file_support = true,

View File

@ -3,7 +3,7 @@ local util = require 'lspconfig.util'
return {
default_config = {
cmd = { 'hyprls', '--stdio' },
filetypes = { '*.hl', 'hypr*.conf', '.config/hypr/*.conf' },
filetypes = { 'hyprlang', '*.hl', 'hypr*.conf', '.config/hypr/*.conf' },
root_dir = util.find_git_ancestor,
single_file_support = true,
},

View File

@ -1,36 +1,21 @@
local util = require 'lspconfig.util'
local root_files = {}
local default_capabilities = {
textDocument = {
completion = {
editsNearCursor = true,
},
},
offsetEncoding = { 'utf-8' },
}
return {
default_config = {
cmd = { 'koka', '--language-server' },
filetypes = { 'kk' },
root_dir = function(fname)
return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname)
end,
cmd = { 'koka', '--language-server', '--lsstdio' },
filetypes = { 'koka' },
single_file_support = true,
capabilities = default_capabilities,
root_dir = util.find_git_ancestor,
},
commands = {},
docs = {
description = [[
https://koka-lang.github.io/koka/doc/index.html
Koka is a functional programming language with effect types and handlers.
]],
default_config = {
root_dir = [[
]],
capabilities = [[default capabilities, with offsetEncoding utf-8]],
root_dir = [[git directory]],
capabilities = [[default capabilities]],
},
},
}

View File

@ -21,36 +21,11 @@ return {
end
end
return util.root_pattern('lakefile.lean', 'lean-toolchain', 'leanpkg.toml')(fname)
return util.root_pattern('lakefile.toml', 'lakefile.lean', 'lean-toolchain')(fname)
or stdlib_dir
or util.find_git_ancestor(fname)
end,
options = {
-- Only Lake 3.0+ supports lake serve, so for old enough Lean 4,
-- or core Lean itself, this command (typically using the in-built
-- Lean 4 language server) will be used instead.
no_lake_lsp_cmd = { 'lean', '--server' },
},
on_new_config = function(config, root_dir)
local use_lake_serve = false
if util.path.exists(util.path.join(root_dir, 'lakefile.lean')) then
local lake_version = ''
local lake_job = vim.fn.jobstart({ 'lake', '--version' }, {
on_stdout = function(_, d, _)
lake_version = table.concat(d, '\n')
end,
stdout_buffered = true,
})
if lake_job > 0 and vim.fn.jobwait({ lake_job })[1] == 0 then
local major = lake_version:match 'Lake version (%d).'
if major and tonumber(major) >= 3 then
use_lake_serve = true
end
end
end
if not use_lake_serve then
config.cmd = config.options.no_lake_lsp_cmd
end
-- add root dir as command-line argument for `ps aux`
table.insert(config.cmd, root_dir)
end,
@ -63,15 +38,15 @@ https://github.com/leanprover/lean4
Lean installation instructions can be found
[here](https://leanprover-community.github.io/get_started.html#regular-install).
The Lean 4 language server is built-in with a Lean 4 install
(and can be manually run with, e.g., `lean --server`).
The Lean language server is included in any Lean installation and
does not require any additional packages.
Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim),
that plugin fully handles the setup of the Lean language server,
and you shouldn't set up `leanls` both with it and `lspconfig`.
]],
default_config = {
root_dir = [[root_pattern("lakefile.lean", "lean-toolchain", "leanpkg.toml", ".git")]],
root_dir = [[root_pattern("lakefile.toml", "lakefile.lean", "lean-toolchain", ".git")]],
},
},
}

View File

@ -15,6 +15,18 @@ return {
https://github.com/Decodetalkers/neocmakelsp
CMake LSP Implementation
Neovim does not currently include built-in snippets. `neocmakelsp` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup.
```lua
--Enable (broadcasting) snippet capability for completion
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
require'lspconfig'.neocmake.setup {
capabilities = capabilities,
}
```
]],
default_config = {
root_dir = [[root_pattern('.git', 'cmake')]],

View File

@ -8,7 +8,7 @@ local root_files = {
return {
default_config = {
cmd = { 'ruff', 'server', '--preview' },
cmd = { 'ruff', 'server' },
filetypes = { 'python' },
root_dir = util.root_pattern(unpack(root_files)) or util.find_git_ancestor(),
single_file_support = true,
@ -18,22 +18,29 @@ return {
description = [[
https://github.com/astral-sh/ruff
A Language Server Protocol implementation for Ruff, an extremely fast Python linter and code formatter, written in Rust. It can be installed via pip.
A Language Server Protocol implementation for Ruff, an extremely fast Python linter and code formatter, written in Rust. It can be installed via `pip`.
```sh
pip install ruff
```
_Requires Ruff v0.3.3 or later._
**Available in Ruff `v0.4.5` in beta and stabilized in Ruff `v0.5.3`.**
This is the new Rust-based version of the original `ruff-lsp` implementation. It's currently in alpha, meaning that some features are under development. Currently, the following capabilities are supported:
This is the new built-in language server written in Rust. It supports the same feature set as `ruff-lsp`, but with superior performance and no installation required. Note that the `ruff-lsp` server will continue to be maintained until further notice.
1. Diagnostics
2. Code actions
3. Formatting
4. Range Formatting
Server settings can be provided via:
Please note that the `ruff-lsp` server will continue to be maintained until further notice.
```lua
require('lspconfig').ruff.setup({
init_options = {
settings = {
-- Server settings should go here
}
}
})
```
Refer to the [documentation](https://docs.astral.sh/ruff/editors/) for more details.
]],
root_dir = [[root_pattern("pyproject.toml", "ruff.toml", ".ruff.toml", ".git")]],

View File

@ -77,6 +77,12 @@ return {
serverStatusNotification = true,
},
},
before_init = function(init_params, config)
-- See https://github.com/rust-lang/rust-analyzer/blob/eb5da56d839ae0a9e9f50774fa3eb78eb0964550/docs/dev/lsp-extensions.md?plain=1#L26
if config.settings and config.settings['rust-analyzer'] then
init_params.initializationOptions = config.settings['rust-analyzer']
end
end,
},
commands = {
CargoReload = {
@ -105,6 +111,9 @@ require'lspconfig'.rust_analyzer.setup{
}
}
```
Note: do not set `init_options` for this LS config, it will be automatically populated by the contents of settings["rust-analyzer"] per
https://github.com/rust-lang/rust-analyzer/blob/eb5da56d839ae0a9e9f50774fa3eb78eb0964550/docs/dev/lsp-extensions.md?plain=1#L26.
]],
default_config = {
root_dir = [[root_pattern("Cargo.toml", "rust-project.json")]],

View File

@ -26,10 +26,6 @@ https://shopify.dev/docs/api/shopify-cli
`shopify` can be installed via npm `npm install -g @shopify/cli`.
```lua
require lspconfig.shopify_theme_ls.setup {}
```
Note: This LSP already includes Theme Check so you don't need to use the `theme_check` server configuration as well.
]],
},

View File

@ -25,8 +25,7 @@ return {
'handlebars',
'hbs',
'html',
-- 'HTML (Eex)',
-- 'HTML (EEx)',
'htmlangular',
'html-eex',
'heex',
'jade',
@ -61,13 +60,6 @@ return {
'svelte',
'templ',
},
init_options = {
userLanguages = {
eelixir = 'html-eex',
eruby = 'erb',
templ = 'html',
},
},
settings = {
tailwindCSS = {
validate = true,
@ -87,6 +79,12 @@ return {
'classList',
'ngClass',
},
includeLanguages = {
eelixir = 'html-eex',
eruby = 'erb',
templ = 'html',
htmlangular = 'html',
},
},
},
on_new_config = function(new_config)

View File

@ -27,10 +27,13 @@ local function buf_build(bufnr)
if err then
error(tostring(err))
end
print('Build ' .. texlab_build_status[result.status])
vim.notify('Build ' .. texlab_build_status[result.status], vim.log.levels.INFO)
end, bufnr)
else
print 'method textDocument/build is not supported by any servers active on the current buffer'
vim.notify(
'method textDocument/build is not supported by any servers active on the current buffer',
vim.log.levels.WARN
)
end
end
@ -47,13 +50,108 @@ local function buf_search(bufnr)
if err then
error(tostring(err))
end
print('Search ' .. texlab_forward_status[result.status])
vim.notify('Search ' .. texlab_forward_status[result.status], vim.log.levels.INFO)
end, bufnr)
else
print 'method textDocument/forwardSearch is not supported by any servers active on the current buffer'
vim.notify(
'method textDocument/forwardSearch is not supported by any servers active on the current buffer',
vim.log.levels.WARN
)
end
end
local function buf_cancel_build(bufnr)
bufnr = util.validate_bufnr(bufnr)
if not util.get_active_client_by_name(bufnr, 'texlab') then
return vim.notify('Texlab client not found', vim.log.levels.ERROR)
end
vim.lsp.buf.execute_command { command = 'texlab.cancelBuild' }
vim.notify('Build cancelled', vim.log.levels.INFO)
end
local function dependency_graph(bufnr)
bufnr = util.validate_bufnr(bufnr)
local texlab_client = util.get_active_client_by_name(bufnr, 'texlab')
if not texlab_client then
return vim.notify('Texlab client not found', vim.log.levels.ERROR)
end
texlab_client.request('workspace/executeCommand', { command = 'texlab.showDependencyGraph' }, function(err, result)
if err then
return vim.notify(err.code .. ': ' .. err.message, vim.log.levels.ERROR)
end
vim.notify('The dependency graph has been generated:\n' .. result, vim.log.levels.INFO)
end, 0)
end
local function cleanArtifacts(bufnr)
bufnr = util.validate_bufnr(bufnr)
if not util.get_active_client_by_name(bufnr, 'texlab') then
return vim.notify('Texlab client not found', vim.log.levels.ERROR)
end
vim.lsp.buf.execute_command {
command = 'texlab.cleanArtifacts',
arguments = { { uri = vim.uri_from_bufnr(bufnr) } },
}
vim.notify('Artifacts cleaned successfully', vim.log.levels.INFO)
end
local function cleanAuxiliary(bufnr)
bufnr = util.validate_bufnr(bufnr)
if not util.get_active_client_by_name(bufnr, 'texlab') then
return vim.notify('Texlab client not found', vim.log.levels.ERROR)
end
vim.lsp.buf.execute_command {
command = 'texlab.cleanAuxiliary',
arguments = { { uri = vim.uri_from_bufnr(bufnr) } },
}
vim.notify('Auxiliary files cleaned successfully', vim.log.levels.INFO)
end
local function buf_find_envs(bufnr)
bufnr = util.validate_bufnr(bufnr)
local texlab_client = util.get_active_client_by_name(bufnr, 'texlab')
if not texlab_client then
return vim.notify('Texlab client not found', vim.log.levels.ERROR)
end
local pos = vim.api.nvim_win_get_cursor(0)
texlab_client.request('workspace/executeCommand', {
command = 'texlab.findEnvironments',
arguments = {
{
textDocument = { uri = vim.uri_from_bufnr(bufnr) },
position = { line = pos[1] - 1, character = pos[2] },
},
},
}, function(err, result)
if err then
return vim.notify(err.code .. ': ' .. err.message, vim.log.levels.ERROR)
end
return vim.notify('The environments are:\n' .. vim.inspect(result), vim.log.levels.INFO)
end, bufnr)
end
local function buf_change_env(bufnr)
bufnr = util.validate_bufnr(bufnr)
if not util.get_active_client_by_name(bufnr, 'texlab') then
return vim.notify('Texlab client not found', vim.log.levels.ERROR)
end
local new = vim.fn.input 'Enter the new environment name: '
if not new or new == '' then
return vim.notify('No environment name provided', vim.log.levels.WARN)
end
local pos = vim.api.nvim_win_get_cursor(0)
vim.lsp.buf.execute_command {
command = 'texlab.changeEnvironment',
arguments = {
{
textDocument = { uri = vim.uri_from_bufnr(bufnr) },
position = { line = pos[1] - 1, character = pos[2] },
newName = tostring(new),
},
},
}
end
-- bufnr isn't actually required here, but we need a valid buffer in order to
-- be able to find the client for buf_request.
-- TODO find a client by looking through buffers for a valid client?
@ -114,6 +212,42 @@ return {
end,
description = 'Forward search from current position',
},
TexlabCancelBuild = {
function()
buf_cancel_build(0)
end,
description = 'Cancel the current build',
},
TexlabDependencyGraph = {
function()
dependency_graph(0)
end,
description = 'Show the dependency graph',
},
TexlabCleanArtifacts = {
function()
cleanArtifacts(0)
end,
description = 'Clean the artifacts',
},
TexlabCleanAuxiliary = {
function()
cleanAuxiliary(0)
end,
description = 'Clean the auxiliary files',
},
TexlabFindEnvironments = {
function()
buf_find_envs(0)
end,
description = 'Find the environments at current position',
},
TexlabChangeEnvironment = {
function()
buf_change_env(0)
end,
description = 'Change the environment at current position',
},
},
docs = {
description = [[

View File

@ -88,10 +88,12 @@ end
function M.create_module_commands(module_name, commands)
for command_name, def in pairs(commands) do
local opts = M._parse_user_command_options(def)
api.nvim_create_user_command(command_name, function(info)
require('lspconfig')[module_name].commands[command_name][1](unpack(info.fargs))
end, opts)
if type(def) ~= 'function' then
local opts = M._parse_user_command_options(def)
api.nvim_create_user_command(command_name, function(info)
require('lspconfig')[module_name].commands[command_name][1](unpack(info.fargs))
end, opts)
end
end
end

View File

@ -1,2 +1,2 @@
#!/nix/store/agkxax48k35wdmkhmmija2i2sxg8i7ny-bash-5.2p26/bin/sh
#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/sh
exec nvim -u NONE -E -R --headless +'set rtp+=$PWD' +'luafile scripts/docgen.lua' +q