diff options
author | Michael Smith <mikesmiffy128@gmail.com> | 2024-07-15 20:05:47 +0100 |
---|---|---|
committer | Michael Smith <mikesmiffy128@gmail.com> | 2024-07-15 20:05:47 +0100 |
commit | 522d56557b00246286d803425751a4334f3a94a5 (patch) | |
tree | 23ca335a3526197c2a6327ce10bfd58411b0a609 /start/lspconfig-0.1.8 | |
parent | a7b72fc27edac2305dbf0af807981bd703835b25 (diff) |
indent-blankline is probably old because I've actually been using it for
ages, but I have a strict if-it-ain't-broke policy, so I'm not going to
update it.
lspconfig *was* broke though with nvim 0.10, so now it's fixed.
Diffstat (limited to 'start/lspconfig-0.1.8')
325 files changed, 41238 insertions, 0 deletions
diff --git a/start/lspconfig-0.1.8/LICENSE.md b/start/lspconfig-0.1.8/LICENSE.md new file mode 100644 index 0000000..d9a10c0 --- /dev/null +++ b/start/lspconfig-0.1.8/LICENSE.md @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/start/lspconfig-0.1.8/doc/lspconfig.txt b/start/lspconfig-0.1.8/doc/lspconfig.txt new file mode 100644 index 0000000..50a8f9d --- /dev/null +++ b/start/lspconfig-0.1.8/doc/lspconfig.txt @@ -0,0 +1,646 @@ +*lspconfig.txt* For Nvim version 0.8+ + +nvim-lspconfig provides user-contributed configs for the Nvim |lsp| client. + + Type |gO| to see the table of contents. + +============================================================================== +INTRODUCTION *lspconfig* + +nvim-lspconfig is a collection of community-contributed configurations for the +built-in language server client in Nvim core. This plugin provides four +primary functionalities: + + - default launch commands, initialization options, and settings for each + server + - a root directory resolver which attempts to detect the root of your project + - an autocommand mapping that either launches a new language server or + attempts to attach a language server to each opened buffer if it falls + under a tracked project + - utility commands such as LspInfo, LspStart, LspStop, and LspRestart for + managing language server instances + +nvim-lspconfig is not required to use the builtin Nvim |lsp| client, it is +just a convenience layer. + +See |lspconfig-all| for the complete list of language server configurations. + +============================================================================== +QUICKSTART *lspconfig-quickstart* + +- ensure the server is installed and executable from the command line + +- enable the server in your Neovim configuration (Lua example): +> + require'lspconfig'.clangd.setup{} +< +- create a new project, ensure that it contains a root marker which matches the + server requirements specified in |lspconfig-all|. + +- open a file within that project, such as `main.c`. + +- If you need more information about a server configuration, read the corresponding + entry in |lspconfig-all|. + +============================================================================== +THE SETUP METAMETHOD *lspconfig-setup* + +`lspconfig` consists of a collection of language server configurations. Each +configuration exposes a `setup {}` metamethod which makes it easy to directly +use the default configuration or selectively override the defaults. +`setup {}` is the primary interface by which users interact with `lspconfig`. + +Using the default configuration for a server is simple: +> + require'lspconfig'.clangd.setup{} +< +The available server names are listed in |lspconfig-all| and match the server +name in `config.SERVER_NAME` defined in each configuration's source file. + +The purpose of `setup{}` is to wrap the call to Nvim's built-in +`vim.lsp.start_client()` with an autocommand that automatically launch a +language server. + +This autocommand calls `start_client()` or `vim.lsp.buf_attach_client()` +depending on whether the current file belongs to a project with a currently +running client. See |lspconfig-root-detection| for more details. + +The `setup{}` function takes a table which contains a superset of the keys +listed in `:help vim.lsp.start_client()` with the following unique entries: + +- {root_dir} + + `function(filename, bufnr)` + + Returns either a filepath (string) or nil. The language server will only + start if the function returns a filepath. + + If a root directory (string) is returned which is unique from any + previously returned root_dir, a new server will be spawned with that + root directory. See |lspconfig-root-detection| for more details + +- {name} + + `string` + + Defaults to the server's name (`clangd`, `pyright`, etc.). + +- {filetypes} + + `list[string] | nil` + + Set of filetypes for which to attempt to resolve {root_dir}. + + May be empty, or server may specify a default value. + +- {autostart} + + `bool` (default: true) + + Controls if the `FileType` autocommand that launches a language server is + created. If `false`, allows for deferring language servers until manually + launched with `:LspStart` (|lspconfig-commands|). + +- {single_file_support} + + `bool` (default: nil) + + Determines if a server is started without a matching root directory. + See |lspconfig-single-file-support|. + +- {on_new_config} + + `function(new_config, new_root_dir)` + + Function executed after a root directory is detected. This is used to + modify the server configuration (including `cmd` itself). Most commonly, + this is used to inject additional arguments into `cmd`. + + If overriding `on_new_config`, ensure that you read the + `on_new_config` defined in the source file of the default configuration + in `lspconfig`. The original `on_new_config` snippet for a given server + should likely be included in your new override. Some configurations + use `on_new_config` to dynamically set or modify `cmd`. + +Note: all entries passed to `setup {}` override the entry in the default +configuration. There is no composition. + +All `config` elements described in `:help vim.lsp.start_client()` can +additionally be overridden via the `setup {}` call. The most commonly +passed overrides to `setup {}` are: + +- {capabilities} `table <string, string|table|bool|function>` + + a table which represents the neovim client capabilities. Useful for + broadcasting to the server additional functionality (snippets, off-protocol + features) provided by plugins. + +- {cmd} `list[string]` + + a list where each entry corresponds to the blankspace delimited part of + the command that launches the server. The first entry is the binary used + to run the language server. Additional entries are passed as arguments. + + The equivalent `cmd` for: +> + foo --bar baz +< + is: +> + {'foo', '--bar', 'baz'} +< +- {handlers} `list[functions]` + + a list of handlers which override the function used to process a response + from a given language server. Applied only to the server referenced by + setup. See |lsp-handler|. + +- {init_options} `table <string, string|table|bool>` + + a table passed during the initialization notification after launching + a language server. Equivalent to the `initializationOptions` field found + in `InitializeParams` in the LSP specification. + + See upstream server documentation for available initialization + options. + +- {on_attach} `function(client, bufnr)` + + Callback invoked by Nvim's built-in client when attaching a buffer to a + language server. Often used to set Nvim (buffer or global) options or to + override the Nvim client properties (`server_capabilities`) after a + language server attaches. Most commonly used for settings buffer + local keybindings. See |lspconfig-keybindings| for a usage example. + +- {settings} `table <string, string|table|bool>` + + The `settings` table is sent after initialization via a + `workspace/didChangeConfiguration` notification from the Nvim client to + the language server. These settings allow a user to change optional runtime + settings of the language server. + + As an example, to set the following settings found in the pyright + documentation: + + `pyright.disableLanguageServices`: `boolean` + `pyright.disableOrganizeImports`: `boolean` + + Nested keys need to be translated into a nested table and passed to + the settings field in `setup {}` as follows: +> + require('lspconfig').pyright.setup{ + settings = { + pyright = { + disableLanguageServices = true, + disableOrganizeImports = true, + } + } + } +< +============================================================================== +OVERRIDING GLOBAL DEFAULTS *lspconfig-global-defaults* + +The global defaults for all servers can be overridden by extending the +`default_config` table. + +> + local lspconfig = require'lspconfig' + lspconfig.util.default_config = vim.tbl_extend( + "force", + lspconfig.util.default_config, + { + autostart = false, + handlers = { + ["window/logMessage"] = function(err, method, params, client_id) + if params and params.type <= vim.lsp.protocol.MessageType.Log then + vim.lsp.handlers["window/logMessage"](err, method, params, client_id) + end + end, + ["window/showMessage"] = function(err, method, params, client_id) + if params and params.type <= vim.lsp.protocol.MessageType.Warning.Error then + vim.lsp.handlers["window/showMessage"](err, method, params, client_id) + end + end, + } + } + ) +< +`setup {}` can additionally override these defaults in subsequent calls. + +============================================================================== +SETUP HOOK *lspconfig-setup-hook* + +`lspconfig` will execute the `on_setup` hook for each setup call to a server after +validating its configuration, and before attempting to launch the server +itself. One typical usage is to allow ad-hoc substitution for any +configuration entry, such as `cmd`. + +> + local lspconfig = require 'lspconfig' + lspconfig.util.on_setup = lspconfig.util.add_hook_before(lspconfig.util.on_setup, function(config) + if some_condition and config.name == "clangd" then + local custom_server_prefix = "/my/custom/server/prefix" + config.cmd = { custom_server_prefix .. "/bin/clangd" } + end + end) + + +Note: This is primarily targeted at plugins developers, so make sure to use +`util.add_hook_before()` as a wrapper instead of overriding the original function +completely, to void breaking external integrations with lspconfig. + +============================================================================== +SERVER CONFIGURATIONS *lspconfig-configurations* + +See |lspconfig-all| for the complete list of language server configurations. + +While the `setup {}` function is the primary interface to `lspconfig`, for +servers for which there is not a configuration, it is necessary to define a +configuration directly. This can be useful if there is an outstanding PR that +is in review, or when developing a language server that is unavailable +publicly. This can be done through the `configs` module. + +The `configs` module is a singleton where configs are defined. The schema for +validating using `vim.validate` is: +> + configs.SERVER_NAME = { + default_config = {'t'}, + on_new_config = {'f', true}, + on_attach = {'f', true}, + commands = {'t', true}, + docs = {'t', true}, + } +< +where the structure of the docs table is as follows: +> + docs = { + description = {'s', true}, + default_config = {'t', true}, + } +< +`commands` is a map of `name:definition` key:value pairs, where `definition` +is a list whose first value is a function implementing the command, and the +rest are either array values which will be formed into flags for the command, +or special keys like `description`. + +Warning: Commands is deprecated and will be removed in future releases. +It is recommended to use `vim.api.nvim_create_user_command()` instead in an `on_attach` function. + +Example: +> + local function organize_imports() + local params = { + command = 'pyright.organizeimports', + arguments = { vim.uri_from_bufnr(0) }, + } + vim.lsp.buf.execute_command(params) + end + + local on_attach = function(client, bufnr) + if client.name == "pyright" then + vim.api.nvim_create_user_command("PyrightOrganizeImports", organize_imports, {desc = 'Organize Imports'}) + end + end + + require("lspconfig")['pyright'].setup({ + on_attach = on_attach + }) +< + +The `configs.__newindex` metamethod consumes the config definition and returns +an object with a `setup()` method, to be invoked by users: +> + require'lspconfig'.SERVER_NAME.setup{} + +After you set `configs.SERVER_NAME` you can add arbitrary language-specific +functions to it if necessary. + +Example: +> + configs.texlab.buf_build = buf_build +< + +============================================================================== +ADDING NEW SERVERS *lspconfig-new* + +The steps for adding and enabling a new server configuration are: + +1. load the `lspconfig` module (note that this is a stylistic choice) > + local lspconfig = require 'lspconfig' +< +2. define the configuration > + local configs = require 'lspconfig.configs' + + -- Check if the config is already defined (useful when reloading this file) + if not configs.foo_lsp then + configs.foo_lsp = { + default_config = { + cmd = {'/home/neovim/lua-language-server/run.sh'}, + filetypes = {'lua'}, + root_dir = function(fname) + return lspconfig.util.find_git_ancestor(fname) + end, + settings = {}, + }, + } + end + +3. call `setup()` to enable the FileType autocmd > + lspconfig.foo_lsp.setup{} +< +============================================================================== +ROOT DETECTION *lspconfig-root-detection* + *lspconfig-root-dir* + +A project's `root_dir` is used by `lspconfig` to determine whether `lspconfig` +should start a new server, or attach a previous one, to the current file. + +`lspconfig` automatically launches language servers by defining a filetype +autocommand based on the `filetypes` specified in the default configuration of +each server, optionally overridable by the `filetypes` table passed to +`setup`. + +This autocommand triggers a search from the current file position in the +filesystem hierarchy up to the top level directory of your filesystem. The +`root_dir` entry of each configuration is a function that returns true if the +current directory in this traversal matches a given root pattern. + +The following utility functions are provided by `lspconfig`. Each function call +below returns a function that takes as its argument the current buffer path. + +- `util.root_pattern`: function which takes multiple arguments, each + corresponding to a different root pattern against which the contents of the + current directory are matched using |vim.fn.glob()| while traversing up the + filesystem. Parent directories are traversed once per pattern, in the order + the patterns are specified. +> + root_dir = util.root_pattern('pyproject.toml', 'requirements.txt') +< +- `util.find_git_ancestor`: a function that locates the first parent directory + containing a `.git` directory. +> + root_dir = util.find_git_ancestor + +- `util.find_node_modules_ancestor`: a function that locates the first parent + directory containing a `node_modules` directory. +> + root_dir = util.find_node_modules_ancestor +< + +- `util.find_package_json_ancestor`: a function that locates the first parent + directory containing a `package.json`. +> + root_dir = util.find_package_json_ancestor +< +Note: On Windows, `lspconfig` always assumes forward slash normalized paths with +capitalized drive letters. + +============================================================================== +ADVANCED ROOT DIRECTORY DETECTION *lspconfig-root-advanced* + *lspconfig-root-composition* + +The `root_dir` key in `config` and `setup` can hold any function of the form +> + function custom_root_dir(filename, bufnr) + returns nil | string +> +This allows for rich composition of root directory patterns which is necessary +for some project structures. Example (for Kotlin): +> + local root_files = { + 'settings.gradle', -- Gradle (multi-project) + 'settings.gradle.kts', -- Gradle (multi-project) + 'build.xml', -- Ant + 'pom.xml', -- Maven + } + + local fallback_root_files = { + 'build.gradle', -- Gradle + 'build.gradle.kts', -- Gradle + } + root_dir = function(fname) + local primary = util.root_pattern(unpack(root_files))(fname) + local fallback = util.root_pattern(unpack(fallback_root_files))(fname) + return primary or fallback + end +< +Browsing the source of the default configurations is recommended. + +============================================================================== +SINGLE FILE SUPPORT *lspconfig-single-file-support* + +Language servers require each project to have a `root` in order to provide +features that require cross-file indexing. + +Some servers support not passing a root directory as a proxy for single file +mode under which cross-file features may be degraded. + +`lspconfig` offers limited support for an implicit single-file mode by: + +- first trying to resolve the root directory pattern +- then, if `single_file_support` is enabled for a given language server + configuration, starting the server without sending `rootDirectory` or + `workspaceFolders` during initialization. +- attaching subsequent files in the parent directory to the same server + instance, depending on filetype. +- also supports unnamed buffer if filetype matches the server filetype + settings. + +Cross-file features (navigation, hover) may or may not work depending on the +language server. For a full feature-set, consider moving your files to a +directory with a project structure `lspconfig` can infer. + +Note that in the event that the LSP specification is extended to support a +standard for single-file mode, lspconfig will adopt that standard. + +============================================================================== +COMMANDS *lspconfig-commands* + +- `:LspInfo` shows the status of active and configured language servers. Note + that client id refers to the Nvim RPC instance connected to a given + language server. + +The following commands support tab-completion for all arguments. All commands +that require a client id can either leverage tab-completion or the info +contained in `:LspInfo`: + +- `:LspStart <config_name>` launches the requested (configured) client, but only + if it successfully resolves a root directory. Note: Defaults to all + configured servers matching the current buffer filetype. +- `:LspStop <client_id>` stops the server with the given client id. Defaults to + stopping all servers active on the current buffer. if you want to force stop + a language server you can do it like `:LspStop <client_id> ++force` +- `:LspRestart <client_id>` restarts the client with the given client id, and + will attempt to reattach to all previously attached buffers. + +============================================================================== +EXAMPLE KEYBINDINGS *lspconfig-keybindings* + +`lspconfig`, and the core client, do not map any keybindings by default. The +following is an example Lua block which demonstrates how to leverage the +`LspAttach` (Nvim 0.8+) autocommand to apply keybindings after a language +server has attached to a given buffer. +> + -- Setup language servers. + local lspconfig = require('lspconfig') + lspconfig.pyright.setup {} + lspconfig.tsserver.setup {} + lspconfig.rust_analyzer.setup { + -- Server-specific settings. See `:help lspconfig-setup` + settings = { + ['rust-analyzer'] = {}, + }, + } + + + -- Global mappings. + -- See `:help vim.diagnostic.*` for documentation on any of the below functions + vim.keymap.set('n', '<space>e', vim.diagnostic.open_float) + vim.keymap.set('n', '[d', vim.diagnostic.goto_prev) + vim.keymap.set('n', ']d', vim.diagnostic.goto_next) + vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist) + + -- Use LspAttach autocommand to only map the following keys + -- after the language server attaches to the current buffer + vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('UserLspConfig', {}), + callback = function(ev) + -- Enable completion triggered by <c-x><c-o> + vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' + + -- Buffer local mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + local opts = { buffer = ev.buf } + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) + vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts) + vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts) + vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts) + vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts) + vim.keymap.set('n', '<space>wl', function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, opts) + vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts) + vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts) + vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) + vim.keymap.set('n', '<space>f', function() + vim.lsp.buf.format { async = true } + end, opts) + end, + }) + +============================================================================== +COMPLETION SUPPORT *lspconfig-completion* + +Manually triggered completion can be provided by Nvim's built-in omnifunc. +See |lspconfig|. + +For autocompletion, Nvim does not provide built-in functionality. Consult the +nvim-lspconfig wiki, which provides configuration examples for using +a completion plugin with the built-in client + +============================================================================== +DEBUGGING *lspconfig-debugging* + +While using language servers should be easy, debugging issues can be +challenging. First, it is important to identify the source of the issue, which +is typically (in rough order): + +- the language server itself +- a plugin +- overrides in a user configuration +- the built-in client in Nvim core +- nvim-lspconfig + +The first step in debugging is to test with a minimal configuration (such as +`../test/minimal_init.lua`). Historically, many users problems are due to +plugins or misconfiguration. + +Should that fail, identifying which component is the culprit is challenging. +The following are the only categories of bugs that pertain to nvim-lspconfig. + +- The root directory inferred for your project is wrong, or it should be + detected but is not due to a bug in the nvim-lspconfig path utilities. +- The server is launching, but you believe that the default settings, + initialization options, or command arguments are suboptimal and should be + replaced based on your understanding of the server documentation. + +All bugs Nvim's built-in client should be reported to the Nvim core issue +tracker. All bugs pertaining to plugins should be reported to the respective +plugin. All missing features in a language server should be reported to the +upstream language server issue tracker. + +For debugging nvim-lspconfig issues, the most common hurdles users face are: + + - The language server is not installed or is otherwise not executable. + nvim-lspconfig does not install language servers for you. Ensure the `cmd` + defined in `server_configurations.md` is executable from the command + line. If the absolute path to the binary is not supplied in `cmd`, ensure + it is on your PATH. + - No root detected. nvim-lspconfig is built around the concept of projects. See + |lspconfig-root-detection| for more details. Most of the time, + initializing a git repo will suffice. + - Misconfiguration. Often users will override `cmd`, `on_init`, or + `handlers`. Ensure that you debug by using a stock configuration to ensure + your customizations are not introducing issues. + +|LspInfo| provides an overview of your active and configured language servers +which can be useful for debugging. + +Note that it will not report any configuration changes applied in +`on_new_config`. + +============================================================================== +LOGGING *lspconfig-logging* + +When debugging language servers, it is helpful to enable additional logging in +the built-in client, specifically considering the RPC logs. Example: +> + vim.lsp.set_log_level 'trace' + if vim.fn.has 'nvim-0.5.1' == 1 then + require('vim.lsp.log').set_format_func(vim.inspect) + end +< +Attempt to run the language server, and open the log with: + +> + :LspLog +< +Note that `ERROR` messages containing `stderr` only indicate that the log was +sent to `stderr`. Many servers counter-intuitively send harmless messages +via stderr. + +============================================================================== +SCOPE *lspconfig-scope* + +`lspconfig` is a community effort to create default configurations that fit +within the scope of an official plugin for Nvim. All features that are not +strictly providing default configurations for language servers will be removed +from `lspconfig` in time. The power of the Neovim LSP ecosystem is in the +composability and flexibility of integrating multiple plugins which maximizes +user choice and freedom. + +`lspconfig` also opts to adhere strictly to the LSP specification, with some +small allowances when small modifications to a server configuration are +necessary to enable features critical to its usability. For more featureful +options, the `lspconfig` wiki lists community created plugins that build upon +the built-in client to provide functionality tailored to specific language +servers. + +============================================================================== +Highlights *lspconfig-highlight* + +LspInfoTitle Client name +LspInfoList Server name list +LspInfoFiletype `filetypes` area +LspInfoTip Tip +LspInfoBorder Window border + To set the border use: > + require('lspconfig.ui.windows').default_options.border = 'single' +< Accepts the same values as the `border` option to |nvim_open_win()| + +============================================================================== + +vim:tw=78:ts=8:ft=help:norl: diff --git a/start/lspconfig-0.1.8/doc/server_configurations.md b/start/lspconfig-0.1.8/doc/server_configurations.md new file mode 100644 index 0000000..45946af --- /dev/null +++ b/start/lspconfig-0.1.8/doc/server_configurations.md @@ -0,0 +1,13815 @@ +# Configurations +<!-- *lspconfig-all* *lspconfig-server-configurations* --> + +LSP configs provided by nvim-lspconfig are listed below. This documentation is +autogenerated from the Lua files. You can view this file in Nvim by running +`:help lspconfig-all`. + +- [agda_ls](#agda_ls) +- [aiken](#aiken) +- [als](#als) +- [anakin_language_server](#anakin_language_server) +- [angularls](#angularls) +- [ansiblels](#ansiblels) +- [antlersls](#antlersls) +- [apex_ls](#apex_ls) +- [arduino_language_server](#arduino_language_server) +- [asm_lsp](#asm_lsp) +- [ast_grep](#ast_grep) +- [astro](#astro) +- [autotools_ls](#autotools_ls) +- [awk_ls](#awk_ls) +- [azure_pipelines_ls](#azure_pipelines_ls) +- [basedpyright](#basedpyright) +- [bashls](#bashls) +- [beancount](#beancount) +- [bicep](#bicep) +- [biome](#biome) +- [bitbake_language_server](#bitbake_language_server) +- [blueprint_ls](#blueprint_ls) +- [bqnlsp](#bqnlsp) +- [bright_script](#bright_script) +- [bsl_ls](#bsl_ls) +- [buck2](#buck2) +- [buddy_ls](#buddy_ls) +- [bufls](#bufls) +- [bzl](#bzl) +- [cadence](#cadence) +- [cairo_ls](#cairo_ls) +- [ccls](#ccls) +- [cds_lsp](#cds_lsp) +- [circom-lsp](#circom-lsp) +- [clangd](#clangd) +- [clarity_lsp](#clarity_lsp) +- [clojure_lsp](#clojure_lsp) +- [cmake](#cmake) +- [cobol_ls](#cobol_ls) +- [codeqlls](#codeqlls) +- [coffeesense](#coffeesense) +- [contextive](#contextive) +- [coq_lsp](#coq_lsp) +- [crystalline](#crystalline) +- [csharp_ls](#csharp_ls) +- [css_variables](#css_variables) +- [cssls](#cssls) +- [cssmodules_ls](#cssmodules_ls) +- [cucumber_language_server](#cucumber_language_server) +- [custom_elements_ls](#custom_elements_ls) +- [cypher_ls](#cypher_ls) +- [dafny](#dafny) +- [dagger](#dagger) +- [dartls](#dartls) +- [dcmls](#dcmls) +- [debputy](#debputy) +- [delphi_ls](#delphi_ls) +- [denols](#denols) +- [dhall_lsp_server](#dhall_lsp_server) +- [diagnosticls](#diagnosticls) +- [digestif](#digestif) +- [docker_compose_language_service](#docker_compose_language_service) +- [dockerls](#dockerls) +- [dolmenls](#dolmenls) +- [dotls](#dotls) +- [dprint](#dprint) +- [drools_lsp](#drools_lsp) +- [ds_pinyin_lsp](#ds_pinyin_lsp) +- [earthlyls](#earthlyls) +- [ecsact](#ecsact) +- [efm](#efm) +- [elixirls](#elixirls) +- [elmls](#elmls) +- [elp](#elp) +- [ember](#ember) +- [emmet_language_server](#emmet_language_server) +- [emmet_ls](#emmet_ls) +- [erg_language_server](#erg_language_server) +- [erlangls](#erlangls) +- [esbonio](#esbonio) +- [eslint](#eslint) +- [facility_language_server](#facility_language_server) +- [fennel_language_server](#fennel_language_server) +- [fennel_ls](#fennel_ls) +- [flow](#flow) +- [flux_lsp](#flux_lsp) +- [foam_ls](#foam_ls) +- [fortls](#fortls) +- [fsautocomplete](#fsautocomplete) +- [fsharp_language_server](#fsharp_language_server) +- [fstar](#fstar) +- [futhark_lsp](#futhark_lsp) +- [gdscript](#gdscript) +- [gdshader_lsp](#gdshader_lsp) +- [ghcide](#ghcide) +- [ghdl_ls](#ghdl_ls) +- [ginko_ls](#ginko_ls) +- [gitlab_ci_ls](#gitlab_ci_ls) +- [gleam](#gleam) +- [glint](#glint) +- [glsl_analyzer](#glsl_analyzer) +- [glslls](#glslls) +- [golangci_lint_ls](#golangci_lint_ls) +- [gopls](#gopls) +- [gradle_ls](#gradle_ls) +- [grammarly](#grammarly) +- [graphql](#graphql) +- [groovyls](#groovyls) +- [guile_ls](#guile_ls) +- [harper_ls](#harper_ls) +- [haxe_language_server](#haxe_language_server) +- [hdl_checker](#hdl_checker) +- [helm_ls](#helm_ls) +- [hhvm](#hhvm) +- [hie](#hie) +- [hlasm](#hlasm) +- [hls](#hls) +- [hoon_ls](#hoon_ls) +- [html](#html) +- [htmx](#htmx) +- [hydra_lsp](#hydra_lsp) +- [hyprls](#hyprls) +- [idris2_lsp](#idris2_lsp) +- [intelephense](#intelephense) +- [java_language_server](#java_language_server) +- [jdtls](#jdtls) +- [jedi_language_server](#jedi_language_server) +- [jinja_lsp](#jinja_lsp) +- [jqls](#jqls) +- [jsonls](#jsonls) +- [jsonnet_ls](#jsonnet_ls) +- [julials](#julials) +- [koka](#koka) +- [kotlin_language_server](#kotlin_language_server) +- [lean3ls](#lean3ls) +- [leanls](#leanls) +- [lelwel_ls](#lelwel_ls) +- [lemminx](#lemminx) +- [lexical](#lexical) +- [ltex](#ltex) +- [lua_ls](#lua_ls) +- [luau_lsp](#luau_lsp) +- [lwc_ls](#lwc_ls) +- [m68k](#m68k) +- [markdown_oxide](#markdown_oxide) +- [marksman](#marksman) +- [matlab_ls](#matlab_ls) +- [mdx_analyzer](#mdx_analyzer) +- [mesonlsp](#mesonlsp) +- [metals](#metals) +- [millet](#millet) +- [mint](#mint) +- [mlir_lsp_server](#mlir_lsp_server) +- [mlir_pdll_lsp_server](#mlir_pdll_lsp_server) +- [mm0_ls](#mm0_ls) +- [mojo](#mojo) +- [motoko_lsp](#motoko_lsp) +- [move_analyzer](#move_analyzer) +- [mutt_ls](#mutt_ls) +- [nelua_lsp](#nelua_lsp) +- [neocmake](#neocmake) +- [nextls](#nextls) +- [nginx_language_server](#nginx_language_server) +- [nickel_ls](#nickel_ls) +- [nil_ls](#nil_ls) +- [nim_langserver](#nim_langserver) +- [nimls](#nimls) +- [nixd](#nixd) +- [nomad_lsp](#nomad_lsp) +- [ntt](#ntt) +- [nushell](#nushell) +- [nxls](#nxls) +- [ocamlls](#ocamlls) +- [ocamllsp](#ocamllsp) +- [ols](#ols) +- [omnisharp](#omnisharp) +- [opencl_ls](#opencl_ls) +- [openedge_ls](#openedge_ls) +- [openscad_ls](#openscad_ls) +- [openscad_lsp](#openscad_lsp) +- [pact_ls](#pact_ls) +- [pasls](#pasls) +- [pbls](#pbls) +- [perlls](#perlls) +- [perlnavigator](#perlnavigator) +- [perlpls](#perlpls) +- [pest_ls](#pest_ls) +- [phan](#phan) +- [phpactor](#phpactor) +- [pico8_ls](#pico8_ls) +- [pkgbuild_language_server](#pkgbuild_language_server) +- [please](#please) +- [postgres_lsp](#postgres_lsp) +- [powershell_es](#powershell_es) +- [prismals](#prismals) +- [prolog_ls](#prolog_ls) +- [prosemd_lsp](#prosemd_lsp) +- [psalm](#psalm) +- [puppet](#puppet) +- [purescriptls](#purescriptls) +- [pylsp](#pylsp) +- [pylyzer](#pylyzer) +- [pyre](#pyre) +- [pyright](#pyright) +- [qml_lsp](#qml_lsp) +- [qmlls](#qmlls) +- [quick_lint_js](#quick_lint_js) +- [r_language_server](#r_language_server) +- [racket_langserver](#racket_langserver) +- [raku_navigator](#raku_navigator) +- [reason_ls](#reason_ls) +- [regal](#regal) +- [regols](#regols) +- [relay_lsp](#relay_lsp) +- [remark_ls](#remark_ls) +- [rescriptls](#rescriptls) +- [rls](#rls) +- [rnix](#rnix) +- [robotframework_ls](#robotframework_ls) +- [roc_ls](#roc_ls) +- [rome](#rome) +- [rubocop](#rubocop) +- [ruby_lsp](#ruby_lsp) +- [ruff](#ruff) +- [ruff_lsp](#ruff_lsp) +- [rune_languageserver](#rune_languageserver) +- [rust_analyzer](#rust_analyzer) +- [salt_ls](#salt_ls) +- [scheme_langserver](#scheme_langserver) +- [scry](#scry) +- [serve_d](#serve_d) +- [shopify_theme_ls](#shopify_theme_ls) +- [sixtyfps](#sixtyfps) +- [slangd](#slangd) +- [slint_lsp](#slint_lsp) +- [smarty_ls](#smarty_ls) +- [smithy_ls](#smithy_ls) +- [snyk_ls](#snyk_ls) +- [solang](#solang) +- [solargraph](#solargraph) +- [solc](#solc) +- [solidity](#solidity) +- [solidity_ls](#solidity_ls) +- [solidity_ls_nomicfoundation](#solidity_ls_nomicfoundation) +- [somesass_ls](#somesass_ls) +- [sorbet](#sorbet) +- [sourcekit](#sourcekit) +- [sourcery](#sourcery) +- [spectral](#spectral) +- [spyglassmc_language_server](#spyglassmc_language_server) +- [sqlls](#sqlls) +- [sqls](#sqls) +- [standardrb](#standardrb) +- [starlark_rust](#starlark_rust) +- [starpls](#starpls) +- [statix](#statix) +- [steep](#steep) +- [stimulus_ls](#stimulus_ls) +- [stylelint_lsp](#stylelint_lsp) +- [svelte](#svelte) +- [svlangserver](#svlangserver) +- [svls](#svls) +- [swift_mesonls](#swift_mesonls) +- [syntax_tree](#syntax_tree) +- [tabby_ml](#tabby_ml) +- [tailwindcss](#tailwindcss) +- [taplo](#taplo) +- [tblgen_lsp_server](#tblgen_lsp_server) +- [teal_ls](#teal_ls) +- [templ](#templ) +- [terraform_lsp](#terraform_lsp) +- [terraformls](#terraformls) +- [texlab](#texlab) +- [textlsp](#textlsp) +- [tflint](#tflint) +- [theme_check](#theme_check) +- [thriftls](#thriftls) +- [tilt_ls](#tilt_ls) +- [tinymist](#tinymist) +- [tsp_server](#tsp_server) +- [tsserver](#tsserver) +- [ttags](#ttags) +- [turtle_ls](#turtle_ls) +- [twiggy_language_server](#twiggy_language_server) +- [typeprof](#typeprof) +- [typos_lsp](#typos_lsp) +- [typst_lsp](#typst_lsp) +- [uiua](#uiua) +- [unison](#unison) +- [unocss](#unocss) +- [uvls](#uvls) +- [v_analyzer](#v_analyzer) +- [vacuum](#vacuum) +- [vala_ls](#vala_ls) +- [vale_ls](#vale_ls) +- [vdmj](#vdmj) +- [verible](#verible) +- [veridian](#veridian) +- [veryl_ls](#veryl_ls) +- [vhdl_ls](#vhdl_ls) +- [vimls](#vimls) +- [visualforce_ls](#visualforce_ls) +- [vls](#vls) +- [volar](#volar) +- [vtsls](#vtsls) +- [vuels](#vuels) +- [wgsl_analyzer](#wgsl_analyzer) +- [yamlls](#yamlls) +- [yang_lsp](#yang_lsp) +- [yls](#yls) +- [zk](#zk) +- [zls](#zls) + +## agda_ls + +https://github.com/agda/agda-language-server + +Language Server for Agda. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.agda_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "als" } + ``` + - `filetypes` : + ```lua + { "agda" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## aiken + +https://github.com/aiken-lang/aiken + +A language server for Aiken Programming Language. +[Installation](https://aiken-lang.org/installation-instructions) + +It can be i + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.aiken.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "aiken", "lsp" } + ``` + - `filetypes` : + ```lua + { "aiken" } + ``` + - `root_dir` : + ```lua + root_pattern("aiken.toml", ".git") + ``` + + +## als + +https://github.com/AdaCore/ada_language_server + +Installation instructions can be found [here](https://github.com/AdaCore/ada_language_server#Install). + +Can be configured by passing a "settings" object to `als.setup{}`: + +```lua +require('lspconfig').als.setup{ + settings = { + ada = { + projectFile = "project.gpr"; + scenarioVariables = { ... }; + } + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.als.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ada_language_server" } + ``` + - `filetypes` : + ```lua + { "ada" } + ``` + - `root_dir` : + ```lua + util.root_pattern("Makefile", ".git", "*.gpr", "*.adc") + ``` + + +## anakin_language_server + +https://pypi.org/project/anakin-language-server/ + +`anakin-language-server` is yet another Jedi Python language server. + +Available options: + +* Initialization: https://github.com/muffinmad/anakin-language-server#initialization-option +* Configuration: https://github.com/muffinmad/anakin-language-server#configuration-options + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.anakin_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "anakinls" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + anakinls = { + pyflakes_errors = { "ImportStarNotPermitted", "UndefinedExport", "UndefinedLocal", "UndefinedName", "DuplicateArgument", "MultiValueRepeatedKeyLiteral", "MultiValueRepeatedKeyVariable", "FutureFeatureNotDefined", "LateFutureImport", "ReturnOutsideFunction", "YieldOutsideFunction", "ContinueOutsideLoop", "BreakOutsideLoop", "TwoStarredExpressions", "TooManyExpressionsInStarredAssignment", "ForwardAnnotationSyntaxError", "RaiseNotImplemented", "StringDotFormatExtraPositionalArguments", "StringDotFormatExtraNamedArguments", "StringDotFormatMissingArgument", "StringDotFormatMixingAutomatic", "StringDotFormatInvalidFormat", "PercentFormatInvalidFormat", "PercentFormatMixedPositionalAndNamed", "PercentFormatUnsupportedFormat", "PercentFormatPositionalCountMismatch", "PercentFormatExtraNamedArguments", "PercentFormatMissingArgument", "PercentFormatExpectedMapping", "PercentFormatExpectedSequence", "PercentFormatStarRequiresSequence" } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## angularls + +https://github.com/angular/vscode-ng-language-service + +`angular-language-server` can be installed via npm `npm install -g @angular/language-server`. + +Note, that if you override the default `cmd`, you must also update `on_new_config` to set `new_config.cmd` during startup. + +```lua +local project_library_path = "/path/to/project/lib" +local cmd = {"ngserver", "--stdio", "--tsProbeLocations", project_library_path , "--ngProbeLocations", project_library_path} + +require'lspconfig'.angularls.setup{ + cmd = cmd, + on_new_config = function(new_config,new_root_dir) + new_config.cmd = cmd + end, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.angularls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ngserver", "--stdio", "--tsProbeLocations", "", "--ngProbeLocations", "" } + ``` + - `filetypes` : + ```lua + { "typescript", "html", "typescriptreact", "typescript.tsx" } + ``` + - `root_dir` : + ```lua + root_pattern("angular.json") + ``` + + +## ansiblels + +https://github.com/ansible/vscode-ansible + +Language server for the ansible configuration management tool. + +`ansible-language-server` can be installed via `npm`: + +```sh +npm install -g @ansible/ansible-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ansiblels.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ansible-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml.ansible" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + ansible = { + ansible = { + path = "ansible" + }, + executionEnvironment = { + enabled = false + }, + python = { + interpreterPath = "python" + }, + validation = { + enabled = true, + lint = { + enabled = true, + path = "ansible-lint" + } + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## antlersls + +https://www.npmjs.com/package/antlers-language-server + +`antlersls` can be installed via `npm`: +```sh +npm install -g antlers-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.antlersls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "antlersls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "html", "antlers" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## apex_ls + +https://github.com/forcedotcom/salesforcedx-vscode + +Language server for Apex. + +For manual installation, download the JAR file from the [VSCode +extension](https://github.com/forcedotcom/salesforcedx-vscode/tree/develop/packages/salesforcedx-vscode-apex). + +```lua +require'lspconfig'.apex_ls.setup { + apex_jar_path = '/path/to/apex-jorje-lsp.jar', + apex_enable_semantic_errors = false, -- Whether to allow Apex Language Server to surface semantic errors + apex_enable_completion_statistics = false, -- Whether to allow Apex Language Server to collect telemetry on code completion usage +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.apex_ls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "apexcode" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern('sfdx-project.json') + ``` + + +## arduino_language_server + +https://github.com/arduino/arduino-language-server + +Language server for Arduino + +The `arduino-language-server` can be installed by running: + +``` +go install github.com/arduino/arduino-language-server@latest +``` + +The `arduino-cli` tool must also be installed. Follow [these +installation instructions](https://arduino.github.io/arduino-cli/latest/installation/) for +your platform. + +After installing `arduino-cli`, follow [these +instructions](https://arduino.github.io/arduino-cli/latest/getting-started/#create-a-configuration-file) +for generating a configuration file if you haven't done so already, and make +sure you [install any relevant platforms +libraries](https://arduino.github.io/arduino-cli/latest/getting-started/#install-the-core-for-your-board). + +The language server also requires `clangd` to be installed. Follow [these +installation instructions](https://clangd.llvm.org/installation) for your +platform. + +If you don't have a sketch yet create one. + +```sh +$ arduino-cli sketch new test +$ cd test +``` + +You will need a `sketch.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. + + +First gather some information about your board. Make sure your board is connected and run the following: + +```sh +$ arduino-cli board list +Port Protocol Type Board Name FQBN Core +/dev/ttyACM0 serial Serial Port (USB) Arduino Uno arduino:avr:uno arduino:avr +``` + +Then generate the file: + +```sh +arduino-cli board attach -p /dev/ttyACM0 -b arduino:avr:uno test.ino +``` + +The resulting file should like like this: + +```yaml +default_fqbn: arduino:avr:uno +default_port: /dev/ttyACM0 +``` + +Your folder structure should look like this: + +``` +. +├── test.ino +└── sketch.yaml +``` + +For further instruction about configuration options, run `arduino-language-server --help`. + +Note that an upstream bug makes keywords in some cases become undefined by the language server. +Ref: https://github.com/arduino/arduino-ide/issues/159 + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.arduino_language_server.setup{} +``` + + +**Default values:** + - `capabilities` : + ```lua + { + general = { + positionEncodings = { "utf-16" } + }, + textDocument = { + callHierarchy = { + dynamicRegistration = false + }, + codeAction = { + codeActionLiteralSupport = { + codeActionKind = { + valueSet = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" } + } + }, + dataSupport = true, + dynamicRegistration = true, + isPreferredSupport = true, + resolveSupport = { + properties = { "edit" } + } + }, + completion = { + completionItem = { + commitCharactersSupport = false, + deprecatedSupport = false, + documentationFormat = { "markdown", "plaintext" }, + preselectSupport = false, + snippetSupport = false + }, + completionItemKind = { + valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 } + }, + completionList = { + itemDefaults = { "editRange", "insertTextFormat", "insertTextMode", "data" } + }, + contextSupport = false, + dynamicRegistration = false + }, + declaration = { + linkSupport = true + }, + definition = { + dynamicRegistration = true, + linkSupport = true + }, + diagnostic = { + dynamicRegistration = false + }, + documentHighlight = { + dynamicRegistration = false + }, + documentSymbol = { + dynamicRegistration = false, + hierarchicalDocumentSymbolSupport = true, + symbolKind = { + valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } + } + }, + formatting = { + dynamicRegistration = true + }, + hover = { + contentFormat = { "markdown", "plaintext" }, + dynamicRegistration = true + }, + implementation = { + linkSupport = true + }, + inlayHint = { + dynamicRegistration = true, + resolveSupport = { + properties = { "textEdits", "tooltip", "location", "command" } + } + }, + publishDiagnostics = { + dataSupport = true, + relatedInformation = true, + tagSupport = { + valueSet = { 1, 2 } + } + }, + rangeFormatting = { + dynamicRegistration = true + }, + references = { + dynamicRegistration = false + }, + rename = { + dynamicRegistration = true, + prepareSupport = true + }, + semanticTokens = vim.NIL, + signatureHelp = { + dynamicRegistration = false, + signatureInformation = { + activeParameterSupport = true, + documentationFormat = { "markdown", "plaintext" }, + parameterInformation = { + labelOffsetSupport = true + } + } + }, + synchronization = { + didSave = true, + dynamicRegistration = false, + willSave = true, + willSaveWaitUntil = true + }, + typeDefinition = { + linkSupport = true + } + }, + window = { + showDocument = { + support = true + }, + showMessage = { + messageActionItem = { + additionalPropertiesSupport = false + } + }, + workDoneProgress = true + }, + workspace = { + applyEdit = true, + configuration = true, + didChangeConfiguration = { + dynamicRegistration = false + }, + didChangeWatchedFiles = { + dynamicRegistration = false, + relativePatternSupport = true + }, + inlayHint = { + refreshSupport = true + }, + semanticTokens = vim.NIL, + symbol = { + dynamicRegistration = false, + symbolKind = { + valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } + } + }, + workspaceEdit = { + resourceOperations = { "rename", "create", "delete" } + }, + workspaceFolders = true + } + } + ``` + - `cmd` : + ```lua + { "arduino-language-server" } + ``` + - `filetypes` : + ```lua + { "arduino" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## asm_lsp + +https://github.com/bergercookie/asm-lsp + +Language Server for GAS/GO Assembly + +`asm-lsp` can be installed via cargo: +cargo install asm-lsp + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.asm_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "asm-lsp" } + ``` + - `filetypes` : + ```lua + { "asm", "vmasm" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## ast_grep + +https://ast-grep.github.io/ + +ast-grep(sg) is a fast and polyglot tool for code structural search, lint, rewriting at large scale. +ast-grep LSP only works in projects that have `sgconfig.y[a]ml` in their root directories. +```sh +npm install [-g] @ast-grep/cli +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ast_grep.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ast-grep", "lsp" } + ``` + - `filetypes` : + ```lua + { "c", "cpp", "rust", "go", "java", "python", "javascript", "typescript", "html", "css", "kotlin", "dart", "lua" } + ``` + - `root_dir` : + ```lua + root_pattern('sgconfig.yaml', 'sgconfig.yml') + ``` + + +## astro + +https://github.com/withastro/language-tools/tree/main/packages/language-server + +`astro-ls` can be installed via `npm`: +```sh +npm install -g @astrojs/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.astro.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "astro-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "astro" } + ``` + - `init_options` : + ```lua + { + typescript = {} + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git") + ``` + + +## autotools_ls + +https://github.com/Freed-Wu/autotools-language-server + +`autotools-language-server` can be installed via `pip`: +```sh +pip install autotools-language-server +``` + +Language server for autoconf, automake and make using tree sitter in python. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.autotools_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "autotools-language-server" } + ``` + - `filetypes` : + ```lua + { "config", "automake", "make" } + ``` + - `root_dir` : + ```lua + { "configure.ac", "Makefile", "Makefile.am", "*.mk" } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## awk_ls + +https://github.com/Beaglefoot/awk-language-server/ + +`awk-language-server` can be installed via `npm`: +```sh +npm install -g awk-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.awk_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "awk-language-server" } + ``` + - `filetypes` : + ```lua + { "awk" } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## azure_pipelines_ls + +https://github.com/microsoft/azure-pipelines-language-server + +An Azure Pipelines language server + +`azure-pipelines-ls` can be installed via `npm`: + +```sh +npm install -g azure-pipelines-language-server +``` + +By default `azure-pipelines-ls` will only work in files named `azure-pipelines.yml`, this can be changed by providing additional settings like so: +```lua +require("lspconfig").azure_pipelines_ls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + schemas = { + ["https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/master/service-schema.json"] = { + "/azure-pipeline*.y*l", + "/*.azure*", + "Azure-Pipelines/**/*.y*l", + "Pipelines/*.y*l", + }, + }, + }, + }, +} +``` +The Azure Pipelines LSP is a fork of `yaml-language-server` and as such the same settings can be passed to it as `yaml-language-server`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.azure_pipelines_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "azure-pipelines-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## basedpyright + +https://detachhead.github.io/basedpyright + +`basedpyright`, a static type checker and language server for python + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.basedpyright.setup{} +``` +**Commands:** +- PyrightOrganizeImports: Organize Imports +- PyrightSetPythonPath: Reconfigure basedpyright with the provided python path + +**Default values:** + - `cmd` : + ```lua + { "basedpyright-langserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + basedpyright = { + analysis = { + autoSearchPaths = true, + diagnosticMode = "openFilesOnly", + useLibraryCodeForTypes = true + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bashls + +https://github.com/bash-lsp/bash-language-server + +`bash-language-server` can be installed via `npm`: +```sh +npm i -g bash-language-server +``` + +Language server for bash, written using tree sitter in typescript. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bashls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "bash-language-server", "start" } + ``` + - `filetypes` : + ```lua + { "sh" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `settings` : + ```lua + { + bashIde = { + globPattern = "*@(.sh|.inc|.bash|.command)" + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## beancount + +https://github.com/polarmutex/beancount-language-server#installation + +See https://github.com/polarmutex/beancount-language-server#configuration for configuration options + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.beancount.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "beancount-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "beancount", "bean" } + ``` + - `init_options` : + ```lua + {} + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bicep + +https://github.com/azure/bicep +Bicep language server + +Bicep language server can be installed by downloading and extracting a release of bicep-langserver.zip from [Bicep GitHub releases](https://github.com/Azure/bicep/releases). + +Bicep language server requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +Neovim does not have built-in support for the bicep filetype which is required for lspconfig to automatically launch the language server. + +Filetype detection can be added via an autocmd: +```lua +vim.cmd [[ autocmd BufNewFile,BufRead *.bicep set filetype=bicep ]] +``` + +**By default, bicep language server does not have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. + +```lua +local bicep_lsp_bin = "/path/to/bicep-langserver/Bicep.LangServer.dll" +require'lspconfig'.bicep.setup{ + cmd = { "dotnet", bicep_lsp_bin }; + ... +} +``` + +To download the latest release and place in /usr/local/bin/bicep-langserver: +```bash +(cd $(mktemp -d) \ + && curl -fLO https://github.com/Azure/bicep/releases/latest/download/bicep-langserver.zip \ + && rm -rf /usr/local/bin/bicep-langserver \ + && unzip -d /usr/local/bin/bicep-langserver bicep-langserver.zip) +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bicep.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "bicep" } + ``` + - `init_options` : + ```lua + {} + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## biome + +https://biomejs.dev + +Toolchain of the web. [Successor of Rome](https://biomejs.dev/blog/annoucing-biome). + +```sh +npm install [-g] @biomejs/biome +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.biome.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "biome", "lsp-proxy" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "json", "jsonc", "typescript", "typescript.tsx", "typescriptreact", "astro", "svelte", "vue" } + ``` + - `root_dir` : + ```lua + root_pattern('biome.json', 'biome.jsonc') + ``` + - `single_file_support` : + ```lua + false + ``` + + +## bitbake_language_server + +🛠️ bitbake language server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bitbake_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "bitbake-language-server" } + ``` + - `filetypes` : + ```lua + { "bitbake" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## blueprint_ls + +https://gitlab.gnome.org/jwestman/blueprint-compiler + +`blueprint-compiler` can be installed via your system package manager. + +Language server for the blueprint markup language, written in python and part +of the blueprint-compiler. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.blueprint_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "blueprint-compiler", "lsp" } + ``` + - `cmd_env` : + ```lua + { + GLOB_PATTERN = "*@(.blp)" + } + ``` + - `filetypes` : + ```lua + { "blueprint" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bqnlsp + +https://git.sr.ht/~detegr/bqnlsp + + +`bqnlsp`, a language server for BQN. + +The binary depends on the shared library of [CBQN](https://github.com/dzaima/CBQN) `libcbqn.so`. +If CBQN is installed system-wide (using `sudo make install` in its source directory) and `bqnlsp` errors that it can't find the shared library, update the linker cache by executing `sudo ldconfig`. +If CBQN has been installed in a non-standard directory or can't be installed globally pass `libcbqnPath = '/path/to/CBQN'` to the setup function. +This will set the environment variables `LD_LIBRARY_PATH` (Linux) or `DYLD_LIBRARY_PATH` (macOS) to the provided path. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bqnlsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "bqnlsp" } + ``` + - `filetypes` : + ```lua + { "bqn" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bright_script + +https://github.com/RokuCommunity/brighterscript + +`brightscript` can be installed via `npm`: +```sh +npm install -g brighterscript +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bright_script.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "bsc", "--lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "brs" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bsl_ls + + https://github.com/1c-syntax/bsl-language-server + + Language Server Protocol implementation for 1C (BSL) - 1C:Enterprise 8 and OneScript languages. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bsl_ls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "bsl", "os" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## buck2 + +https://github.com/facebook/buck2 + +Build system, successor to Buck + +To better detect Buck2 project files, the following can be added: + +``` +vim.cmd [[ autocmd BufRead,BufNewFile *.bxl,BUCK,TARGETS set filetype=bzl ]] +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.buck2.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "buck2", "lsp" } + ``` + - `filetypes` : + ```lua + { "bzl" } + ``` + - `root_dir` : + ```lua + root_pattern(".buckconfig") + ``` + + +## buddy_ls + +https://github.com/buddy-compiler/buddy-mlir#buddy-lsp-server +The Language Server for the buddy-mlir, a drop-in replacement for mlir-lsp-server, +supporting new dialects defined in buddy-mlir. +`buddy-lsp-server` can be installed at the buddy-mlir repository (buddy-compiler/buddy-mlir) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.buddy_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "buddy-lsp-server" } + ``` + - `filetypes` : + ```lua + { "mlir" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bufls + +https://github.com/bufbuild/buf-language-server + +`buf-language-server` can be installed via `go install`: +```sh +go install github.com/bufbuild/buf-language-server/cmd/bufls@latest +``` + +bufls is a Protobuf language server compatible with Buf modules and workspaces + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bufls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "bufls", "serve" } + ``` + - `filetypes` : + ```lua + { "proto" } + ``` + - `root_dir` : + ```lua + root_pattern("buf.work.yaml", ".git") + ``` + + +## bzl + +https://bzl.io/ + +https://docs.stack.build/docs/cli/installation + +https://docs.stack.build/docs/vscode/starlark-language-server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bzl.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "bzl", "lsp", "serve" } + ``` + - `filetypes` : + ```lua + { "bzl" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## cadence + +[Cadence Language Server](https://github.com/onflow/cadence-tools/tree/master/languageserver) +using the [flow-cli](https://developers.flow.com/tools/flow-cli). + +The `flow` command from flow-cli must be available. For install instructions see +[the docs](https://developers.flow.com/tools/flow-cli/install#install-the-flow-cli) or the +[Github page](https://github.com/onflow/flow-cli). + +By default the configuration is taken from the closest `flow.json` or the `flow.json` in the users home directory. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cadence.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "flow", "cadence", "language-server" } + ``` + - `filetypes` : + ```lua + { "cdc" } + ``` + - `init_options` : + ```lua + { + numberOfAccounts = "1" + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + util.root_pattern('flow.json') or vim.env.HOME + ``` + + +## cairo_ls + +[Cairo Language Server](https://github.com/starkware-libs/cairo/tree/main/crates/cairo-lang-language-server) + +First, install cairo following [this tutorial](https://medium.com/@elias.tazartes/ahead-of-the-curve-install-cairo-1-0-alpha-and-prepare-for-regenesis-85f4e3940e20) + +Then enable cairo language server in your lua configuration. +```lua +require'lspconfig'.cairo_ls.setup{} +``` + +*cairo-language-server is still under active development, some features might not work yet !* + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cairo_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cairo-language-server", "/C", "--node-ipc" } + ``` + - `filetypes` : + ```lua + { "cairo" } + ``` + - `init_options` : + ```lua + { + hostInfo = "neovim" + } + ``` + - `root_dir` : + ```lua + root_pattern("Scarb.toml", "cairo_project.toml", ".git") + ``` + + +## ccls + +https://github.com/MaskRay/ccls/wiki + +ccls relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) specified +as compile_commands.json or, for simpler projects, a .ccls. +For details on how to automatically generate one using CMake look [here](https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html). Alternatively, you can use [Bear](https://github.com/rizsotto/Bear). + +Customization options are passed to ccls at initialization time via init_options, a list of available options can be found [here](https://github.com/MaskRay/ccls/wiki/Customization#initialization-options). For example: + +```lua +local lspconfig = require'lspconfig' +lspconfig.ccls.setup { + init_options = { + compilationDatabaseDirectory = "build"; + index = { + threads = 0; + }; + clang = { + excludeArgs = { "-frounding-math"} ; + }; + } +} + +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ccls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ccls" } + ``` + - `filetypes` : + ```lua + { "c", "cpp", "objc", "objcpp", "cuda" } + ``` + - `offset_encoding` : + ```lua + "utf-32" + ``` + - `root_dir` : + ```lua + root_pattern('compile_commands.json', '.ccls', '.git') + ``` + - `single_file_support` : + ```lua + false + ``` + + +## cds_lsp + + +https://cap.cloud.sap/docs/ + +`cds-lsp` can be installed via `npm`: + +```sh +npm i -g @sap/cds-lsp +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cds_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cds-lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "cds" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + cds = { + validate = true + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## circom-lsp + +[Circom Language Server](https://github.com/rubydusa/circom-lsp) + +`circom-lsp`, the language server for the Circom language. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.circom-lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "circom-lsp" } + ``` + - `filetypes` : + ```lua + { "circom" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## clangd + +https://clangd.llvm.org/installation.html + +- **NOTE:** Clang >= 11 is recommended! See [#23](https://github.com/neovim/nvim-lsp/issues/23). +- If `compile_commands.json` lives in a build directory, you should + symlink it to the root of your source tree. + ``` + ln -s /path/to/myproject/build/compile_commands.json /path/to/myproject/ + ``` +- clangd relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) + specified as compile_commands.json, see https://clangd.llvm.org/installation#compile_commandsjson + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.clangd.setup{} +``` +**Commands:** +- ClangdSwitchSourceHeader: Switch between source/header + +**Default values:** + - `capabilities` : + ```lua + default capabilities, with offsetEncoding utf-8 + ``` + - `cmd` : + ```lua + { "clangd" } + ``` + - `filetypes` : + ```lua + { "c", "cpp", "objc", "objcpp", "cuda", "proto" } + ``` + - `root_dir` : + ```lua + root_pattern( + '.clangd', + '.clang-tidy', + '.clang-format', + 'compile_commands.json', + 'compile_flags.txt', + 'configure.ac', + '.git' + ) + + ``` + - `single_file_support` : + ```lua + true + ``` + + +## clarity_lsp + +`clarity-lsp` is a language server for the Clarity language. Clarity is a decidable smart contract language that optimizes for predictability and security. Smart contracts allow developers to encode essential business logic on a blockchain. + +To learn how to configure the clarity language server, see the [clarity-lsp documentation](https://github.com/hirosystems/clarity-lsp). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.clarity_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "clarity-lsp" } + ``` + - `filetypes` : + ```lua + { "clar", "clarity" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## clojure_lsp + +https://github.com/clojure-lsp/clojure-lsp + +Clojure Language Server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.clojure_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "clojure-lsp" } + ``` + - `filetypes` : + ```lua + { "clojure", "edn" } + ``` + - `root_dir` : + ```lua + root_pattern("project.clj", "deps.edn", "build.boot", "shadow-cljs.edn", ".git", "bb.edn") + ``` + + +## cmake + +https://github.com/regen100/cmake-language-server + +CMake LSP Implementation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cmake.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cmake-language-server" } + ``` + - `filetypes` : + ```lua + { "cmake" } + ``` + - `init_options` : + ```lua + { + buildDirectory = "build" + } + ``` + - `root_dir` : + ```lua + root_pattern('CMakePresets.json', 'CTestConfig.cmake', '.git', 'build', 'cmake') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## cobol_ls + +Cobol language support + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cobol_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cobol-language-support" } + ``` + - `filetypes` : + ```lua + { "cobol" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## codeqlls + +Reference: +https://codeql.github.com/docs/codeql-cli/ + +Binaries: +https://github.com/github/codeql-cli-binaries + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.codeqlls.setup{} +``` + + +**Default values:** + - `before_init` : + ```lua + see source file + ``` + - `cmd` : + ```lua + { "codeql", "execute", "language-server", "--check-errors", "ON_CHANGE", "-q" } + ``` + - `filetypes` : + ```lua + { "ql" } + ``` + - `log_level` : + ```lua + 2 + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + search_path = "list containing all search paths, eg: '~/codeql-home/codeql-repo'" + } + ``` + + +## coffeesense + +https://github.com/phil294/coffeesense + +CoffeeSense Language Server +`coffeesense-language-server` can be installed via `npm`: +```sh +npm install -g coffeesense-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.coffeesense.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "coffeesense-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "coffee" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## contextive + +https://github.com/dev-cycles/contextive + +Language Server for Contextive. + +Contextive allows you to define terms in a central file and provides auto-completion suggestions and hover panels for these terms wherever they're used. + +To install the language server, you need to download the appropriate [GitHub release asset](https://github.com/dev-cycles/contextive/releases/) for your operating system and architecture. + +After the download unzip the Contextive.LanguageServer binary and copy the file into a folder that is included in your system's PATH. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.contextive.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "Contextive.LanguageServer" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## coq_lsp + +https://github.com/ejgallego/coq-lsp/ + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.coq_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "coq-lsp" } + ``` + - `filetypes` : + ```lua + { "coq" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## crystalline + +https://github.com/elbywan/crystalline + +Crystal language server. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.crystalline.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "crystalline" } + ``` + - `filetypes` : + ```lua + { "crystal" } + ``` + - `root_dir` : + ```lua + root_pattern('shard.yml', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## csharp_ls + +https://github.com/razzmatazz/csharp-language-server + +Language Server for C#. + +csharp-ls requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +The preferred way to install csharp-ls is with `dotnet tool install --global csharp-ls`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.csharp_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "csharp-ls" } + ``` + - `filetypes` : + ```lua + { "cs" } + ``` + - `init_options` : + ```lua + { + AutomaticWorkspaceInit = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## css_variables + +https://github.com/vunguyentuan/vscode-css-variables/tree/master/packages/css-variables-language-server + +CSS variables autocompletion and go-to-definition + +`css-variables-language-server` can be installed via `npm`: + +```sh +npm i -g css-variables-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.css_variables.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "css-variables-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "css", "scss", "less" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") or bufdir + ``` + - `settings` : + ```lua + cssVariables = { + lookupFiles = { '**/*.less', '**/*.scss', '**/*.sass', '**/*.css' }, + blacklistFolders = { + '**/.cache', + '**/.DS_Store', + '**/.git', + '**/.hg', + '**/.next', + '**/.svn', + '**/bower_components', + '**/CVS', + '**/dist', + '**/node_modules', + '**/tests', + '**/tmp', + }, + }, + + ``` + + +## cssls + + +https://github.com/hrsh7th/vscode-langservers-extracted + +`css-languageserver` can be installed via `npm`: + +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-css-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.cssls.setup { + capabilities = capabilities, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cssls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vscode-css-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "css", "scss", "less" } + ``` + - `init_options` : + ```lua + { + provideFormatter = true + } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") or bufdir + ``` + - `settings` : + ```lua + { + css = { + validate = true + }, + less = { + validate = true + }, + scss = { + validate = true + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## cssmodules_ls + +https://github.com/antonk52/cssmodules-language-server + +Language server for autocompletion and go-to-definition functionality for CSS modules. + +You can install cssmodules-language-server via npm: +```sh +npm install -g cssmodules-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cssmodules_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cssmodules-language-server" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "typescript", "typescriptreact" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json") + ``` + + +## cucumber_language_server + +https://cucumber.io +https://github.com/cucumber/common +https://www.npmjs.com/package/@cucumber/language-server + +Language server for Cucumber. + +`cucumber-language-server` can be installed via `npm`: +```sh +npm install -g @cucumber/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cucumber_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cucumber-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "cucumber" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## custom_elements_ls + +https://github.com/Matsuuu/custom-elements-language-server + +`custom-elements-languageserver` depends on `typescript`. Both packages can be installed via `npm`: +```sh +npm install -g typescript custom-elements-languageserver +``` +To configure typescript language server, add a +[`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or +[`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to the root of your +project. +Here's an example that disables type checking in JavaScript files. +```json +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "checkJs": false + }, + "exclude": [ + "node_modules" + ] +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.custom_elements_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "custom-elements-languageserver", "--stdio" } + ``` + - `init_options` : + ```lua + { + hostInfo = "neovim" + } + ``` + - `root_dir` : + ```lua + root_pattern("tsconfig.json", "package.json", "jsconfig.json", ".git") + ``` + + +## cypher_ls + +https://github.com/neo4j/cypher-language-support/tree/main/packages/language-server + +`cypher-language-server`, language server for Cypher query language. +Part of the umbrella project cypher-language-support: https://github.com/neo4j/cypher-language-support + +`cypher-language-server` can be installed via `npm`: +```sh +npm i -g @neo4j-cypher/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cypher_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cypher-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "cypher" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dafny + + Support for the Dafny language server. + + The default `cmd` uses "dafny server", which works on Dafny 4.0.0+. For + older versions of Dafny, you can compile the language server from source at + [dafny-lang/language-server-csharp](https://github.com/dafny-lang/language-server-csharp) + and set `cmd = {"dotnet", "<Path to your language server>"}`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dafny.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dafny", "server" } + ``` + - `filetypes` : + ```lua + { "dfy", "dafny" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dagger + +https://github.com/dagger/cuelsp + +Dagger's lsp server for cuelang. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dagger.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cuelsp" } + ``` + - `filetypes` : + ```lua + { "cue" } + ``` + - `root_dir` : + ```lua + root_pattern("cue.mod", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dartls + +https://github.com/dart-lang/sdk/tree/master/pkg/analysis_server/tool/lsp_spec + +Language server for dart. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dartls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dart", "language-server", "--protocol=lsp" } + ``` + - `filetypes` : + ```lua + { "dart" } + ``` + - `init_options` : + ```lua + { + closingLabels = true, + flutterOutline = true, + onlyAnalyzeProjectsWithOpenFiles = true, + outline = true, + suggestFromUnimportedLibraries = true + } + ``` + - `root_dir` : + ```lua + root_pattern("pubspec.yaml") + ``` + - `settings` : + ```lua + { + dart = { + completeFunctionCalls = true, + showTodos = true + } + } + ``` + + +## dcmls + +https://dcm.dev/ + +Language server for DCM analyzer. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dcmls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dcm", "start-server", "--client=neovim" } + ``` + - `filetypes` : + ```lua + { "dart" } + ``` + - `root_dir` : + ```lua + root_pattern("pubspec.yaml") + ``` + + +## debputy + +https://salsa.debian.org/debian/debputy + +Language Server for Debian packages. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.debputy.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "debputy", "lsp", "server" } + ``` + - `filetypes` : + ```lua + { "debcontrol", "debcopyright", "debchangelog", "make", "yaml" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## delphi_ls + +Language server for Delphi from Embarcadero. +https://marketplace.visualstudio.com/items?itemName=EmbarcaderoTechnologies.delphilsp + +Note, the '*.delphilsp.json' file is required, more details at: +https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Using_DelphiLSP_Code_Insight_with_Other_Editors + +Below, you'll find a sample configuration for the lazy manager. +When on_attach is triggered, it signals DelphiLSP to load settings from a configuration file. +Without this step, DelphiLSP initializes but remains non-functional: + +```lua +"neovim/nvim-lspconfig", +lazy = false, +config = function() + local capabilities = require("cmp_nvim_lsp").default_capabilities() + local lspconfig = require("lspconfig") + + lspconfig.delphi_ls.setup({ + capabilities = capabilities, + + on_attach = function(client) + local lsp_config = vim.fs.find(function(name) + return name:match(".*%.delphilsp.json$") + end, { type = "file", path = client.config.root_dir, upward = false })[1] + + if lsp_config then + client.config.settings = { settingsFile = lsp_config } + client.notify("workspace/didChangeConfiguration", { settings = client.config.settings }) + else + vim.notify_once("delphi_ls: '*.delphilsp.json' config file not found") + end + end, + }) +end, +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.delphi_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "DelphiLSP.exe" } + ``` + - `filetypes` : + ```lua + { "pascal" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + false + ``` + + +## denols + +https://github.com/denoland/deno + +Deno's built-in language server + +To appropriately highlight codefences returned from denols, you will need to augment vim.g.markdown_fenced languages + in your init.lua. Example: + +```lua +vim.g.markdown_fenced_languages = { + "ts=typescript" +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.denols.setup{} +``` +**Commands:** +- DenolsCache: Cache a module and all of its dependencies. + +**Default values:** + - `cmd` : + ```lua + { "deno", "lsp" } + ``` + - `cmd_env` : + ```lua + { + NO_COLOR = true + } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" } + ``` + - `handlers` : + ```lua + { + ["textDocument/definition"] = <function 1>, + ["textDocument/references"] = <function 1>, + ["textDocument/typeDefinition"] = <function 1> + } + ``` + - `root_dir` : + ```lua + root_pattern("deno.json", "deno.jsonc", ".git") + ``` + - `settings` : + ```lua + { + deno = { + enable = true, + suggest = { + imports = { + hosts = { + ["https://deno.land"] = true + } + } + } + } + } + ``` + + +## dhall_lsp_server + +https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-lsp-server + +language server for dhall + +`dhall-lsp-server` can be installed via cabal: +```sh +cabal install dhall-lsp-server +``` +prebuilt binaries can be found [here](https://github.com/dhall-lang/dhall-haskell/releases). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dhall_lsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dhall-lsp-server" } + ``` + - `filetypes` : + ```lua + { "dhall" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## diagnosticls + +https://github.com/iamcco/diagnostic-languageserver + +Diagnostic language server integrate with linters. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.diagnosticls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "diagnostic-languageserver", "--stdio" } + ``` + - `filetypes` : + ```lua + Empty by default, override to add filetypes + ``` + - `root_dir` : + ```lua + Vim's starting directory + ``` + - `single_file_support` : + ```lua + true + ``` + + +## digestif + +https://github.com/astoff/digestif + +Digestif is a code analyzer, and a language server, for LaTeX, ConTeXt et caterva. It provides + +context-sensitive completion, documentation, code navigation, and related functionality to any + +text editor that speaks the LSP protocol. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.digestif.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "digestif" } + ``` + - `filetypes` : + ```lua + { "tex", "plaintex", "context" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## docker_compose_language_service + +https://github.com/microsoft/compose-language-service +This project contains a language service for Docker Compose. + +`compose-language-service` can be installed via `npm`: + +```sh +npm install @microsoft/compose-language-service +``` + +Note: If the docker-compose-langserver doesn't startup when entering a `docker-compose.yaml` file, make sure that the filetype is `yaml.docker-compose`. You can set with: `:set filetype=yaml.docker-compose`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.docker_compose_language_service.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "docker-compose-langserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml.docker-compose" } + ``` + - `root_dir` : + ```lua + root_pattern("docker-compose.yaml", "docker-compose.yml", "compose.yaml", "compose.yml") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dockerls + +https://github.com/rcjsuen/dockerfile-language-server-nodejs + +`docker-langserver` can be installed via `npm`: +```sh +npm install -g dockerfile-language-server-nodejs +``` + +Additional configuration can be applied in the following way: +```lua +require("lspconfig").dockerls.setup { + settings = { + docker = { + languageserver = { + formatter = { + ignoreMultilineInstructions = true, + }, + }, + } + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dockerls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "docker-langserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "dockerfile" } + ``` + - `root_dir` : + ```lua + root_pattern("Dockerfile") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dolmenls + +https://github.com/Gbury/dolmen/blob/master/doc/lsp.md + +`dolmenls` can be installed via `opam` +```sh +opam install dolmen_lsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dolmenls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dolmenls" } + ``` + - `filetypes` : + ```lua + { "smt2", "tptp", "p", "cnf", "icnf", "zf" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dotls + +https://github.com/nikeee/dot-language-server + +`dot-language-server` can be installed via `npm`: +```sh +npm install -g dot-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dotls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dot-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "dot" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dprint + +https://github.com/dprint/dprint + +Pluggable and configurable code formatting platform written in Rust. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dprint.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dprint", "lsp" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "typescript", "typescriptreact", "json", "jsonc", "markdown", "python", "toml", "rust", "roslyn" } + ``` + - `root_dir` : + ```lua + <function 1> + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## drools_lsp + +https://github.com/kiegroup/drools-lsp + +Language server for the [Drools Rule Language (DRL)](https://docs.drools.org/latest/drools-docs/docs-website/drools/language-reference/#con-drl_drl-rules). + +The `drools-lsp` server is a self-contained java jar file (`drools-lsp-server-jar-with-dependencies.jar`), and can be downloaded from [https://github.com/kiegroup/drools-lsp/releases/](https://github.com/kiegroup/drools-lsp/releases/). + +Configuration information: +```lua +-- Option 1) Specify the entire command: +require('lspconfig').drools_lsp.setup { + cmd = { '/path/to/java', '-jar', '/path/to/drools-lsp-server-jar-with-dependencies.jar' }, +} + +-- Option 2) Specify just the jar path (the JAVA_HOME environment variable will be respected if present): +require('lspconfig').drools_lsp.setup { + drools = { jar = '/path/to/drools-lsp-server-jar-with-dependencies.jar' }, +} + +-- Option 3) Specify the java bin and/or java opts in addition to the jar path: +require('lspconfig').drools_lsp.setup { + drools = { + java = { bin = '/path/to/java', opts = { '-Xmx100m' } }, + jar = '/path/to/drools-lsp-server-jar-with-dependencies.jar', + }, +} +``` + +Neovim does not yet have automatic detection for the `drools` filetype, but it can be added with: +```lua +vim.cmd [[ autocmd BufNewFile,BufRead *.drl set filetype=drools ]] +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.drools_lsp.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "drools" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ds_pinyin_lsp + +https://github.com/iamcco/ds-pinyin-lsp +Dead simple Pinyin language server for input Chinese without IME(input method). +To install, download the latest [release](https://github.com/iamcco/ds-pinyin-lsp/releases) and ensure `ds-pinyin-lsp` is on your path. +And make ensure the database file `dict.db3` is also downloaded. And put the path to `dict.dbs` in the following code. + +```lua + +require('lspconfig').ds_pinyin_lsp.setup { + init_options = { + db_path = "your_path_to_database" + } +} + +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ds_pinyin_lsp.setup{} +``` +**Commands:** +- DsPinyinCompletionOff: Turn off the ds-pinyin-lsp completion +- DsPinyinCompletionOn: Turn on the ds-pinyin-lsp completion + +**Default values:** + - `cmd` : + ```lua + { "ds-pinyin-lsp" } + ``` + - `filetypes` : + ```lua + { "markdown", "org" } + ``` + - `init_options` : + ```lua + { + completion_on = true, + match_as_same_as_input = true, + match_long_input = true, + max_suggest = 15, + show_symbols = true, + show_symbols_by_n_times = 0, + show_symbols_only_follow_by_hanzi = false + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## earthlyls + +https://github.com/glehmann/earthlyls + +A fast language server for earthly. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.earthlyls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "earthlyls" } + ``` + - `filetypes` : + ```lua + { "earthfile" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## ecsact + +https://github.com/ecsact-dev/ecsact_lsp_server + +Language server for Ecsact. + +The default cmd assumes `ecsact_lsp_server` is in your PATH. Typically from the +Ecsact SDK: https://ecsact.dev/start + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ecsact.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ecsact_lsp_server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "ecsact" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## efm + +https://github.com/mattn/efm-langserver + +General purpose Language Server that can use specified error message format generated from specified command. + +Requires at minimum EFM version [v0.0.38](https://github.com/mattn/efm-langserver/releases/tag/v0.0.38) to support +launching the language server on single files. If on an older version of EFM, disable single file support: + +```lua +require('lspconfig')['efm'].setup{ + settings = ..., -- You must populate this according to the EFM readme + filetypes = ..., -- Populate this according to the note below + single_file_support = false, -- This is the important line for supporting older version of EFM +} +``` + +Note: In order for neovim's built-in language server client to send the appropriate `languageId` to EFM, **you must +specify `filetypes` in your call to `setup{}`**. Otherwise `lspconfig` will launch EFM on the `BufEnter` instead +of the `FileType` autocommand, and the `filetype` variable used to populate the `languageId` will not yet be set. + +```lua +require('lspconfig')['efm'].setup{ + settings = ..., -- You must populate this according to the EFM readme + filetypes = { 'python','cpp','lua' } +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.efm.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "efm-langserver" } + ``` + - `root_dir` : + ```lua + util.root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## elixirls + +https://github.com/elixir-lsp/elixir-ls + +`elixir-ls` can be installed by following the instructions [here](https://github.com/elixir-lsp/elixir-ls#building-and-running). + +```bash +curl -fLO https://github.com/elixir-lsp/elixir-ls/releases/latest/download/elixir-ls.zip +unzip elixir-ls.zip -d /path/to/elixir-ls +# Unix +chmod +x /path/to/elixir-ls/language_server.sh +``` + +**By default, elixir-ls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of your unzipped elixir-ls. + +```lua +require'lspconfig'.elixirls.setup{ + -- Unix + cmd = { "/path/to/elixir-ls/language_server.sh" }; + -- Windows + cmd = { "/path/to/elixir-ls/language_server.bat" }; + ... +} +``` + +'root_dir' is chosen like this: if two or more directories containing `mix.exs` were found when searching directories upward, the second one (higher up) is chosen, with the assumption that it is the root of an umbrella app. Otherwise the directory containing the single mix.exs that was found is chosen. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.elixirls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "elixir", "eelixir", "heex", "surface" } + ``` + - `root_dir` : + ```lua + {{see description above}} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## elmls + +https://github.com/elm-tooling/elm-language-server#installation + +If you don't want to use Nvim to install it, then you can use: +```sh +npm install -g elm elm-test elm-format @elm-tooling/elm-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.elmls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "elm-language-server" } + ``` + - `filetypes` : + ```lua + { "elm" } + ``` + - `init_options` : + ```lua + { + disableElmLSDiagnostics = false, + elmReviewDiagnostics = "off", + onlyUpdateDiagnosticsOnSave = false, + skipInstallPackageConfirmation = false + } + ``` + - `root_dir` : + ```lua + root_pattern("elm.json") + ``` + + +## elp + +https://whatsapp.github.io/erlang-language-platform + +ELP integrates Erlang into modern IDEs via the language server protocol and was +inspired by rust-analyzer. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.elp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "elp", "server" } + ``` + - `filetypes` : + ```lua + { "erlang" } + ``` + - `root_dir` : + ```lua + root_pattern('rebar.config', 'erlang.mk', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ember + +https://github.com/ember-tooling/ember-language-server + +`ember-language-server` can be installed via `npm`: + +```sh +npm install -g @ember-tooling/ember-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ember.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ember-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "handlebars", "typescript", "javascript", "typescript.glimmer", "javascript.glimmer" } + ``` + - `root_dir` : + ```lua + root_pattern("ember-cli-build.js", ".git") + ``` + + +## emmet_language_server + +https://github.com/olrtg/emmet-language-server + +Package can be installed via `npm`: +```sh +npm install -g @olrtg/emmet-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.emmet_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "emmet-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "css", "eruby", "html", "htmldjango", "javascriptreact", "less", "pug", "sass", "scss", "typescriptreact" } + ``` + - `root_dir` : + ```lua + git root + ``` + - `single_file_support` : + ```lua + true + ``` + + +## emmet_ls + +https://github.com/aca/emmet-ls + +Package can be installed via `npm`: +```sh +npm install -g emmet-ls +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.emmet_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "emmet-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "astro", "css", "eruby", "html", "htmldjango", "javascriptreact", "less", "pug", "sass", "scss", "svelte", "typescriptreact", "vue" } + ``` + - `root_dir` : + ```lua + git root + ``` + - `single_file_support` : + ```lua + true + ``` + + +## erg_language_server + +https://github.com/erg-lang/erg#flags ELS + +ELS (erg-language-server) is a language server for the Erg programming language. + +erg-language-server can be installed via `cargo` and used as follows: + ```sh + cargo install erg --features els + erg --language-server + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.erg_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "erg", "--language-server" } + ``` + - `filetypes` : + ```lua + { "erg" } + ``` + - `root_dir` : + ```lua + root_pattern("package.er") or find_git_ancestor + ``` + + +## erlangls + +https://erlang-ls.github.io + +Language Server for Erlang. + +Clone [erlang_ls](https://github.com/erlang-ls/erlang_ls) +Compile the project with `make` and copy resulting binaries somewhere in your $PATH eg. `cp _build/*/bin/* ~/local/bin` + +Installation instruction can be found [here](https://github.com/erlang-ls/erlang_ls). + +Installation requirements: + - [Erlang OTP 21+](https://github.com/erlang/otp) + - [rebar3 3.9.1+](https://github.com/erlang/rebar3) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.erlangls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "erlang_ls" } + ``` + - `filetypes` : + ```lua + { "erlang" } + ``` + - `root_dir` : + ```lua + root_pattern('rebar.config', 'erlang.mk', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## esbonio + +https://github.com/swyddfa/esbonio + +Esbonio is a language server for [Sphinx](https://www.sphinx-doc.org/en/master/) documentation projects. +The language server can be installed via pip + +``` +pip install esbonio +``` + +Since Sphinx is highly extensible you will get best results if you install the language server in the same +Python environment as the one used to build your documentation. To ensure that the correct Python environment +is picked up, you can either launch `nvim` with the correct environment activated. + +``` +source env/bin/activate +nvim +``` + +Or you can modify the default `cmd` to include the full path to the Python interpreter. + +```lua +require'lspconfig'.esbonio.setup { + cmd = { '/path/to/virtualenv/bin/python', '-m', 'esbonio' } +} +``` + +Esbonio supports a number of config values passed as `init_options` on startup, for example. + +```lua +require'lspconfig'.esbonio.setup { + init_options = { + server = { + logLevel = "debug" + }, + sphinx = { + confDir = "/path/to/docs", + srcDir = "${confDir}/../docs-src" + } +} +``` + +A full list and explanation of the available options can be found [here](https://docs.esbon.io/en/esbonio-language-server-v0.16.4/lsp/getting-started.html?editor=neovim-lspconfig#configuration) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.esbonio.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "python3", "-m", "esbonio" } + ``` + - `filetypes` : + ```lua + { "rst" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## eslint + +https://github.com/hrsh7th/vscode-langservers-extracted + +`vscode-eslint-language-server` is a linting engine for JavaScript / Typescript. +It can be installed via `npm`: + +```sh +npm i -g vscode-langservers-extracted +``` + +`vscode-eslint-language-server` provides an `EslintFixAll` command that can be used to format a document on save: +```lua +lspconfig.eslint.setup({ + --- ... + on_attach = function(client, bufnr) + vim.api.nvim_create_autocmd("BufWritePre", { + buffer = bufnr, + command = "EslintFixAll", + }) + end, +}) +``` + +See [vscode-eslint](https://github.com/microsoft/vscode-eslint/blob/55871979d7af184bf09af491b6ea35ebd56822cf/server/src/eslintServer.ts#L216-L229) for configuration options. + +Messages handled in lspconfig: `eslint/openDoc`, `eslint/confirmESLintExecution`, `eslint/probeFailed`, `eslint/noLibrary` + +Additional messages you can handle: `eslint/noConfig` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.eslint.setup{} +``` +**Commands:** +- EslintFixAll: Fix all eslint problems for this buffer + +**Default values:** + - `cmd` : + ```lua + { "vscode-eslint-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx", "vue", "svelte", "astro" } + ``` + - `handlers` : + ```lua + { + ["eslint/confirmESLintExecution"] = <function 1>, + ["eslint/noLibrary"] = <function 2>, + ["eslint/openDoc"] = <function 3>, + ["eslint/probeFailed"] = <function 4> + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + codeAction = { + disableRuleComment = { + enable = true, + location = "separateLine" + }, + showDocumentation = { + enable = true + } + }, + codeActionOnSave = { + enable = false, + mode = "all" + }, + experimental = { + useFlatConfig = false + }, + format = true, + nodePath = "", + onIgnoredFiles = "off", + problems = { + shortenToSingleLine = false + }, + quiet = false, + rulesCustomizations = {}, + run = "onType", + useESLintClass = false, + validate = "on", + workingDirectory = { + mode = "location" + } + } + ``` + + +## facility_language_server + +https://github.com/FacilityApi/FacilityLanguageServer + +Facility language server protocol (LSP) support. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.facility_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "facility-language-server" } + ``` + - `filetypes` : + ```lua + { "fsd" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## fennel_language_server + +https://github.com/rydesun/fennel-language-server + +Fennel language server protocol (LSP) support. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fennel_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fennel-language-server" } + ``` + - `filetypes` : + ```lua + { "fennel" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## fennel_ls + +https://sr.ht/~xerool/fennel-ls/ + +A language server for fennel. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fennel_ls.setup{} +``` + + +**Default values:** + - `capabilities` : + ```lua + { + general = { + positionEncodings = { "utf-16" } + }, + offsetEncoding = { "utf-8", "utf-16" }, + textDocument = { + callHierarchy = { + dynamicRegistration = false + }, + codeAction = { + codeActionLiteralSupport = { + codeActionKind = { + valueSet = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" } + } + }, + dataSupport = true, + dynamicRegistration = true, + isPreferredSupport = true, + resolveSupport = { + properties = { "edit" } + } + }, + completion = { + completionItem = { + commitCharactersSupport = false, + deprecatedSupport = false, + documentationFormat = { "markdown", "plaintext" }, + preselectSupport = false, + snippetSupport = false + }, + completionItemKind = { + valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 } + }, + completionList = { + itemDefaults = { "editRange", "insertTextFormat", "insertTextMode", "data" } + }, + contextSupport = false, + dynamicRegistration = false + }, + declaration = { + linkSupport = true + }, + definition = { + dynamicRegistration = true, + linkSupport = true + }, + diagnostic = { + dynamicRegistration = false + }, + documentHighlight = { + dynamicRegistration = false + }, + documentSymbol = { + dynamicRegistration = false, + hierarchicalDocumentSymbolSupport = true, + symbolKind = { + valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } + } + }, + formatting = { + dynamicRegistration = true + }, + hover = { + contentFormat = { "markdown", "plaintext" }, + dynamicRegistration = true + }, + implementation = { + linkSupport = true + }, + inlayHint = { + dynamicRegistration = true, + resolveSupport = { + properties = { "textEdits", "tooltip", "location", "command" } + } + }, + publishDiagnostics = { + dataSupport = true, + relatedInformation = true, + tagSupport = { + valueSet = { 1, 2 } + } + }, + rangeFormatting = { + dynamicRegistration = true + }, + references = { + dynamicRegistration = false + }, + rename = { + dynamicRegistration = true, + prepareSupport = true + }, + semanticTokens = { + augmentsSyntaxTokens = true, + dynamicRegistration = false, + formats = { "relative" }, + multilineTokenSupport = false, + overlappingTokenSupport = true, + requests = { + full = { + delta = true + }, + range = false + }, + serverCancelSupport = false, + tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary" }, + tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator" } + }, + signatureHelp = { + dynamicRegistration = false, + signatureInformation = { + activeParameterSupport = true, + documentationFormat = { "markdown", "plaintext" }, + parameterInformation = { + labelOffsetSupport = true + } + } + }, + synchronization = { + didSave = true, + dynamicRegistration = false, + willSave = true, + willSaveWaitUntil = true + }, + typeDefinition = { + linkSupport = true + } + }, + window = { + showDocument = { + support = true + }, + showMessage = { + messageActionItem = { + additionalPropertiesSupport = false + } + }, + workDoneProgress = true + }, + workspace = { + applyEdit = true, + configuration = true, + didChangeConfiguration = { + dynamicRegistration = false + }, + didChangeWatchedFiles = { + dynamicRegistration = false, + relativePatternSupport = true + }, + inlayHint = { + refreshSupport = true + }, + semanticTokens = { + refreshSupport = true + }, + symbol = { + dynamicRegistration = false, + symbolKind = { + valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } + } + }, + workspaceEdit = { + resourceOperations = { "rename", "create", "delete" } + }, + workspaceFolders = true + } + } + ``` + - `cmd` : + ```lua + { "fennel-ls" } + ``` + - `filetypes` : + ```lua + { "fennel" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## flow + +https://flow.org/ +https://github.com/facebook/flow + +See below for how to setup Flow itself. +https://flow.org/en/docs/install/ + +See below for lsp command options. + +```sh +npx flow lsp --help +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.flow.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "npx", "--no-install", "flow", "lsp" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx" } + ``` + - `root_dir` : + ```lua + root_pattern(".flowconfig") + ``` + + +## flux_lsp + +https://github.com/influxdata/flux-lsp +`flux-lsp` can be installed via `cargo`: +```sh +cargo install --git https://github.com/influxdata/flux-lsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.flux_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "flux-lsp" } + ``` + - `filetypes` : + ```lua + { "flux" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## foam_ls + +https://github.com/FoamScience/foam-language-server + +`foam-language-server` can be installed via `npm` +```sh +npm install -g foam-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.foam_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "foam-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "foam", "OpenFOAM" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## fortls + +https://github.com/gnikit/fortls + +fortls is a Fortran Language Server, the server can be installed via pip + +```sh +pip install fortls +``` + +Settings to the server can be passed either through the `cmd` option or through +a local configuration file e.g. `.fortls`. For more information +see the `fortls` [documentation](https://gnikit.github.io/fortls/options.html). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fortls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fortls", "--notify_init", "--hover_signature", "--hover_language=fortran", "--use_signature_help" } + ``` + - `filetypes` : + ```lua + { "fortran" } + ``` + - `root_dir` : + ```lua + root_pattern(".fortls") + ``` + - `settings` : + ```lua + {} + ``` + + +## fsautocomplete + +https://github.com/fsharp/FsAutoComplete + +Language Server for F# provided by FsAutoComplete (FSAC). + +FsAutoComplete requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +The preferred way to install FsAutoComplete is with `dotnet tool install --global fsautocomplete`. + +Instructions to compile from source are found on the main [repository](https://github.com/fsharp/FsAutoComplete). + +You may also need to configure the filetype as Vim defaults to Forth for `*.fs` files: + +`autocmd BufNewFile,BufRead *.fs,*.fsx,*.fsi set filetype=fsharp` + +This is automatically done by plugins such as [PhilT/vim-fsharp](https://github.com/PhilT/vim-fsharp), [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp), and [adelarsq/neofsharp.vim](https://github.com/adelarsq/neofsharp.vim). + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fsautocomplete.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fsautocomplete", "--adaptive-lsp-server-enabled" } + ``` + - `filetypes` : + ```lua + { "fsharp" } + ``` + - `init_options` : + ```lua + { + AutomaticWorkspaceInit = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## fsharp_language_server + +F# Language Server +https://github.com/faldor20/fsharp-language-server + +An implementation of the language server protocol using the F# Compiler Service. + +Build the project from source and override the command path to location of DLL. + +If filetype determination is not already performed by an available plugin ([PhilT/vim-fsharp](https://github.com/PhilT/vim-fsharp), [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp), and [adelarsq/neofsharp.vim](https://github.com/adelarsq/neofsharp.vim). +), then the following must be added to initialization configuration: + + +`autocmd BufNewFile,BufRead *.fs,*.fsx,*.fsi set filetype=fsharp` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fsharp_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dotnet", "FSharpLanguageServer.dll" } + ``` + - `filetypes` : + ```lua + { "fsharp" } + ``` + - `init_options` : + ```lua + { + AutomaticWorkspaceInit = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## fstar + +https://github.com/FStarLang/FStar + +LSP support is included in FStar. Make sure `fstar.exe` is in your PATH. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fstar.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fstar.exe", "--lsp" } + ``` + - `filetypes` : + ```lua + { "fstar" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## futhark_lsp + +https://github.com/diku-dk/futhark + +Futhark Language Server + +This language server comes with the futhark compiler and is run with the command +``` +futhark lsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.futhark_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "futhark", "lsp" } + ``` + - `filetypes` : + ```lua + { "futhark", "fut" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## gdscript + +https://github.com/godotengine/godot + +Language server for GDScript, used by Godot Engine. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gdscript.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + see source file + ``` + - `filetypes` : + ```lua + { "gd", "gdscript", "gdscript3" } + ``` + - `root_dir` : + ```lua + util.root_pattern("project.godot", ".git") + ``` + + +## gdshader_lsp + +https://github.com/godofavacyn/gdshader-lsp + +A language server for the Godot Shading language. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gdshader_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "gdshader-lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "gdshader", "gdshaderinc" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## ghcide + +https://github.com/digital-asset/ghcide + +A library for building Haskell IDE tooling. +"ghcide" isn't for end users now. Use "haskell-language-server" instead of "ghcide". + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ghcide.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ghcide", "--lsp" } + ``` + - `filetypes` : + ```lua + { "haskell", "lhaskell" } + ``` + - `root_dir` : + ```lua + root_pattern("stack.yaml", "hie-bios", "BUILD.bazel", "cabal.config", "package.yaml") + ``` + + +## ghdl_ls + +https://github.com/ghdl/ghdl-language-server + +A language server for VHDL, using ghdl as its backend. + +`ghdl-ls` is part of pyghdl, for installation instructions see +[the upstream README](https://github.com/ghdl/ghdl/tree/master/pyGHDL/lsp). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ghdl_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ghdl-ls" } + ``` + - `filetypes` : + ```lua + { "vhdl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ginko_ls + +`ginko_ls` is meant to be a feature-complete language server for device-trees. +Language servers can be used in many editors, such as Visual Studio Code, Emacs +or Vim + +Install `ginko_ls` from https://github.com/Schottkyc137/ginko and add it to path + +`ginko_ls` doesn't require any configuration. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ginko_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ginko_ls" } + ``` + - `filetypes` : + ```lua + { "dts" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## gitlab_ci_ls + +https://github.com/alesbrelih/gitlab-ci-ls + +Language Server for Gitlab CI + +`gitlab-ci-ls` can be installed via cargo: +cargo install gitlab-ci-ls + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gitlab_ci_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "gitlab-ci-ls" } + ``` + - `filetypes` : + ```lua + { "yaml.gitlab" } + ``` + - `init_options` : + ```lua + { + cache_path = "util.path.join(vim.loop.os_homedir(), '.cache/gitlab-ci-ls/')", + log_path = "util.path.join(util.path.join(vim.loop.os_homedir(), '.cache/gitlab-ci-ls/'), 'log/gitlab-ci-ls.log')" + } + ``` + - `root_dir` : + ```lua + util.root_pattern('.gitlab*', '.git') + ``` + + +## gleam + +https://github.com/gleam-lang/gleam + +A language server for Gleam Programming Language. +[Installation](https://gleam.run/getting-started/installing/) + +It can be i + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gleam.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "gleam", "lsp" } + ``` + - `filetypes` : + ```lua + { "gleam" } + ``` + - `root_dir` : + ```lua + root_pattern("gleam.toml", ".git") + ``` + + +## glint + + https://github.com/typed-ember/glint + + https://typed-ember.gitbook.io/glint/ + + `glint-language-server` is installed when adding `@glint/core` to your project's devDependencies: + + ```sh + npm install @glint/core --save-dev + ``` + + or + + ```sh + yarn add -D @glint/core + ``` + + or + + ```sh + pnpm add -D @glint/core + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.glint.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "glint-language-server" } + ``` + - `filetypes` : + ```lua + { "html.handlebars", "handlebars", "typescript", "typescript.glimmer", "javascript", "javascript.glimmer" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## glsl_analyzer + +https://github.com/nolanderc/glsl_analyzer + +Language server for GLSL + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.glsl_analyzer.setup{} +``` + + +**Default values:** + - `capabilities` : + ```lua + {} + ``` + - `cmd` : + ```lua + { "glsl_analyzer" } + ``` + - `filetypes` : + ```lua + { "glsl", "vert", "tesc", "tese", "frag", "geom", "comp" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## glslls + +https://github.com/svenstaro/glsl-language-server + +Language server implementation for GLSL + +`glslls` can be compiled and installed manually, or, if your distribution has access to the AUR, +via the `glsl-language-server` AUR package + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.glslls.setup{} +``` + + +**Default values:** + - `capabilities` : + ```lua + { + offsetEncoding = { "utf-8", "utf-16" }, + textDocument = { + completion = { + editsNearCursor = true + } + } + } + ``` + - `cmd` : + ```lua + { "glslls", "--stdin" } + ``` + - `filetypes` : + ```lua + { "glsl", "vert", "tesc", "tese", "frag", "geom", "comp" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## golangci_lint_ls + +Combination of both lint server and client + +https://github.com/nametake/golangci-lint-langserver +https://github.com/golangci/golangci-lint + + +Installation of binaries needed is done via + +``` +go install github.com/nametake/golangci-lint-langserver@latest +go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.golangci_lint_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "golangci-lint-langserver" } + ``` + - `filetypes` : + ```lua + { "go", "gomod" } + ``` + - `init_options` : + ```lua + { + command = { "golangci-lint", "run", "--out-format", "json" } + } + ``` + - `root_dir` : + ```lua + root_pattern('.golangci.yml', '.golangci.yaml', '.golangci.toml', '.golangci.json', 'go.work', 'go.mod', '.git') + ``` + + +## gopls + +https://github.com/golang/tools/tree/master/gopls + +Google's lsp server for golang. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gopls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "gopls" } + ``` + - `filetypes` : + ```lua + { "go", "gomod", "gowork", "gotmpl" } + ``` + - `root_dir` : + ```lua + root_pattern("go.work", "go.mod", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## gradle_ls + +https://github.com/microsoft/vscode-gradle + +Microsoft's lsp server for gradle files + +If you're setting this up manually, build vscode-gradle using `./gradlew installDist` and point `cmd` to the `gradle-language-server` generated in the build directory + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gradle_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "gradle-language-server" } + ``` + - `filetypes` : + ```lua + { "groovy" } + ``` + - `init_options` : + ```lua + { + settings = { + gradleWrapperEnabled = true + } + } + ``` + - `root_dir` : + ```lua + root_pattern("settings.gradle", "build.gradle") + ``` + + +## grammarly + +https://github.com/znck/grammarly + +`grammarly-languageserver` can be installed via `npm`: + +```sh +npm i -g grammarly-languageserver +``` + +WARNING: Since this language server uses Grammarly's API, any document you open with it running is shared with them. Please evaluate their [privacy policy](https://www.grammarly.com/privacy-policy) before using this. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.grammarly.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "grammarly-languageserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `handlers` : + ```lua + { + ["$/updateDocumentState"] = <function 1> + } + ``` + - `init_options` : + ```lua + { + clientId = "client_BaDkMgx4X19X9UxxYRCXZo" + } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## graphql + +https://github.com/graphql/graphiql/tree/main/packages/graphql-language-service-cli + +`graphql-lsp` can be installed via `npm`: + +```sh +npm install -g graphql-language-service-cli +``` + +Note that you must also have [the graphql package](https://github.com/graphql/graphql-js) installed within your project and create a [GraphQL config file](https://the-guild.dev/graphql/config/docs). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.graphql.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "graphql-lsp", "server", "-m", "stream" } + ``` + - `filetypes` : + ```lua + { "graphql", "typescriptreact", "javascriptreact" } + ``` + - `root_dir` : + ```lua + util.root_pattern('.git', '.graphqlrc*', '.graphql.config.*', 'graphql.config.*') + ``` + + +## groovyls + +https://github.com/prominic/groovy-language-server.git + +Requirements: + - Linux/macOS (for now) + - Java 11+ + +`groovyls` can be installed by following the instructions [here](https://github.com/prominic/groovy-language-server.git#build). + +If you have installed groovy language server, you can set the `cmd` custom path as follow: + +```lua +require'lspconfig'.groovyls.setup{ + -- Unix + cmd = { "java", "-jar", "path/to/groovyls/groovy-language-server-all.jar" }, + ... +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.groovyls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "java", "-jar", "groovy-language-server-all.jar" } + ``` + - `filetypes` : + ```lua + { "groovy" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## guile_ls + +https://codeberg.org/rgherdt/scheme-lsp-server + +The recommended way is to install guile-lsp-server is using Guix. Unfortunately it is still not available at the official Guix channels, but you can use the provided channel guix.scm in the repo: +```sh +guix package -f guix.scm +``` + +Checkout the repo for more info. + +Note: This LSP will start on `scheme.guile` filetype. You can set this file type using `:help modeline` or adding https://gitlab.com/HiPhish/guile.vim to your plugins to automatically set it. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.guile_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "guile-lsp-server" } + ``` + - `filetypes` : + ```lua + { "scheme.guile" } + ``` + - `root_dir` : + ```lua + root_pattern("guix.scm", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## harper_ls + +https://github.com/chilipepperhott/harper + +The language server for Harper, the slim, clean language checker for developers. + +See [docs](https://github.com/chilipepperhott/harper/tree/master/harper-ls#configuration) for more information on settings. + +In short, however, they should look something like this: +```lua +lspconfig.harper_ls.setup { + settings = { + ["harper-ls"] = { + userDictPath = "~/dict.txt" + } + }, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.harper_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "harper-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown", "rust", "typescript", "typescriptreact", "javascript", "python", "go", "c", "cpp", "ruby", "swift", "csharp", "toml", "lua" } + ``` + - `root_dir` : + ```lua + bufdir + ``` + - `single_file_support` : + ```lua + true + ``` + + +## haxe_language_server + +https://github.com/vshaxe/haxe-language-server + +The Haxe language server can be built by running the following commands from +the project's root directory: + + npm install + npx lix run vshaxe-build -t language-server + +This will create `bin/server.js`. Note that the server requires Haxe 3.4.0 or +higher. + +After building the language server, set the `cmd` setting in your setup +function: + +```lua +lspconfig.haxe_language_server.setup({ + cmd = {"node", "path/to/bin/server.js"}, +}) +``` + +By default, an HXML compiler arguments file named `build.hxml` is expected in +your project's root directory. If your file is named something different, +specify it using the `init_options.displayArguments` setting. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.haxe_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "haxe-language-server" } + ``` + - `filetypes` : + ```lua + { "haxe" } + ``` + - `init_options` : + ```lua + { + displayArguments = { "build.hxml" } + } + ``` + - `root_dir` : + ```lua + root_pattern("*.hxml") + ``` + - `settings` : + ```lua + { + haxe = { + executable = "haxe" + } + } + ``` + + +## hdl_checker + +https://github.com/suoto/hdl_checker +Language server for hdl-checker. +Install using: `pip install hdl-checker --upgrade` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hdl_checker.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hdl_checker", "--lsp" } + ``` + - `filetypes` : + ```lua + { "vhdl", "verilog", "systemverilog" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## helm_ls + +https://github.com/mrjosh/helm-ls + +Helm Language server. (This LSP is in early development) + +`helm Language server` can be installed by following the instructions [here](https://github.com/mrjosh/helm-ls). + +The default `cmd` assumes that the `helm_ls` binary can be found in `$PATH`. + +If need Helm file highlight use [vim-helm](https://github.com/towolf/vim-helm) plugin. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.helm_ls.setup{} +``` + + +**Default values:** + - `capabilities` : + ```lua + default capabilities, with dynamicRegistration for didChangeWatchedFiles true + ``` + - `cmd` : + ```lua + { "helm_ls", "serve" } + ``` + - `filetypes` : + ```lua + { "helm" } + ``` + - `root_dir` : + ```lua + root_pattern("Chart.yaml") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## hhvm + +Language server for programs written in Hack +https://hhvm.com/ +https://github.com/facebook/hhvm +See below for how to setup HHVM & typechecker: +https://docs.hhvm.com/hhvm/getting-started/getting-started + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hhvm.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hh_client", "lsp" } + ``` + - `filetypes` : + ```lua + { "php", "hack" } + ``` + - `root_dir` : + ```lua + root_pattern(".hhconfig") + ``` + + +## hie + +https://github.com/haskell/haskell-ide-engine + +the following init_options are supported (see https://github.com/haskell/haskell-ide-engine#configuration): +```lua +init_options = { + languageServerHaskell = { + hlintOn = bool; + maxNumberOfProblems = number; + diagnosticsDebounceDuration = number; + liquidOn = bool (default false); + completionSnippetsOn = bool (default true); + formatOnImportOn = bool (default true); + formattingProvider = string (default "brittany", alternate "floskell"); + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hie.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hie-wrapper", "--lsp" } + ``` + - `filetypes` : + ```lua + { "haskell" } + ``` + - `root_dir` : + ```lua + root_pattern("stack.yaml", "package.yaml", ".git") + ``` + + +## hlasm + + `hlasm_language_server` is a language server for the High Level Assembler language used on IBM SystemZ mainframes. + + To learn how to configure the HLASM language server, see the [HLASM Language Support documentation](https://github.com/eclipse-che4z/che-che4z-lsp-for-hlasm). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hlasm.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hlasm_language_server" } + ``` + - `filetypes` : + ```lua + { "hlasm" } + ``` + - `root_dir` : + ```lua + root_pattern(".hlasmplugin") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## hls + +https://github.com/haskell/haskell-language-server + +Haskell Language Server + +If you are using HLS 1.9.0.0, enable the language server to launch on Cabal files as well: + +```lua +require('lspconfig')['hls'].setup{ + filetypes = { 'haskell', 'lhaskell', 'cabal' }, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "haskell-language-server-wrapper", "--lsp" } + ``` + - `filetypes` : + ```lua + { "haskell", "lhaskell" } + ``` + - `lspinfo` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("hie.yaml", "stack.yaml", "cabal.project", "*.cabal", "package.yaml") + ``` + - `settings` : + ```lua + { + haskell = { + cabalFormattingProvider = "cabalfmt", + formattingProvider = "ormolu" + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## hoon_ls + +https://github.com/urbit/hoon-language-server + +A language server for Hoon. + +The language server can be installed via `npm install -g @hoon-language-server` + +Start a fake ~zod with `urbit -F zod`. +Start the language server at the Urbit Dojo prompt with: `|start %language-server` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hoon_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hoon-language-server" } + ``` + - `filetypes` : + ```lua + { "hoon" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## html + +https://github.com/hrsh7th/vscode-langservers-extracted + +`vscode-html-language-server` can be installed via `npm`: +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-html-language-server` only provides completions when snippet support is enabled. +To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +The code-formatting feature of the lsp can be controlled with the `provideFormatter` option. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.html.setup { + capabilities = capabilities, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.html.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vscode-html-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "html", "templ" } + ``` + - `init_options` : + ```lua + { + configurationSection = { "html", "css", "javascript" }, + embeddedLanguages = { + css = true, + javascript = true + }, + provideFormatter = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## htmx + +https://github.com/ThePrimeagen/htmx-lsp + +`htmx-lsp` can be installed via `cargo`: +```sh +cargo install htmx-lsp +``` + +Lsp is still very much work in progress and experimental. Use at your own risk. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.htmx.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "htmx-lsp" } + ``` + - `filetypes` : + ```lua + { "html", "templ" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## hydra_lsp + +https://github.com/Retsediv/hydra-lsp + +LSP for Hydra Python package config files. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hydra_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hydra-lsp" } + ``` + - `filetypes` : + ```lua + { "yaml" } + ``` + - `root_dir` : + ```lua + util.root_pattern '.git' + ``` + - `single_file_support` : + ```lua + true + ``` + + +## hyprls + +https://github.com/hyprland-community/hyprls + +`hyprls` can be installed via `go`: +```sh +go install github.com/ewen-lbh/hyprls/cmd/hyprls@latest +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hyprls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hyprls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "*.hl", "hypr*.conf", ".config/hypr/*.conf" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## idris2_lsp + +https://github.com/idris-community/idris2-lsp + +The Idris 2 language server. + +Plugins for the Idris 2 filetype include +[Idris2-Vim](https://github.com/edwinb/idris2-vim) (fewer features, stable) and +[Nvim-Idris2](https://github.com/ShinKage/nvim-idris2) (cutting-edge, +experimental). + +Idris2-Lsp requires a build of Idris 2 that includes the "Idris 2 API" package. +Package managers with known support for this build include the +[AUR](https://aur.archlinux.org/packages/idris2/) and +[Homebrew](https://formulae.brew.sh/formula/idris2#default). + +If your package manager does not support the Idris 2 API, you will need to build +Idris 2 from source. Refer to the +[the Idris 2 installation instructions](https://github.com/idris-lang/Idris2/blob/main/INSTALL.md) +for details. Steps 5 and 8 are listed as "optional" in that guide, but they are +necessary in order to make the Idris 2 API available. + +You need to install a version of Idris2-Lsp that is compatible with your +version of Idris 2. There should be a branch corresponding to every released +Idris 2 version after v0.4.0. Use the latest commit on that branch. For example, +if you have Idris v0.5.1, you should use the v0.5.1 branch of Idris2-Lsp. + +If your Idris 2 version is newer than the newest Idris2-Lsp branch, use the +latest commit on the `master` branch, and set a reminder to check the Idris2-Lsp +repo for the release of a compatible versioned branch. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.idris2_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "idris2-lsp" } + ``` + - `filetypes` : + ```lua + { "idris2" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## intelephense + +https://intelephense.com/ + +`intelephense` can be installed via `npm`: +```sh +npm install -g intelephense +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.intelephense.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "intelephense", "--stdio" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("composer.json", ".git") + ``` + + +## java_language_server + +https://github.com/georgewfraser/java-language-server + +Java language server + +Point `cmd` to `lang_server_linux.sh` or the equivalent script for macOS/Windows provided by java-language-server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.java_language_server.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "java" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## jdtls + +https://projects.eclipse.org/projects/eclipse.jdt.ls + +Language server for Java. + +IMPORTANT: If you want all the features jdtls has to offer, [nvim-jdtls](https://github.com/mfussenegger/nvim-jdtls) +is highly recommended. If all you need is diagnostics, completion, imports, gotos and formatting and some code actions +you can keep reading here. + +For manual installation you can download precompiled binaries from the +[official downloads site](http://download.eclipse.org/jdtls/snapshots/?d) +and ensure that the `PATH` variable contains the `bin` directory of the extracted archive. + +```lua + -- init.lua + require'lspconfig'.jdtls.setup{} +``` + +You can also pass extra custom jvm arguments with the JDTLS_JVM_ARGS environment variable as a space separated list of arguments, +that will be converted to multiple --jvm-arg=<param> args when passed to the jdtls script. This will allow for example tweaking +the jvm arguments or integration with external tools like lombok: + +```sh +export JDTLS_JVM_ARGS="-javaagent:$HOME/.local/share/java/lombok.jar" +``` + +For automatic installation you can use the following unofficial installers/launchers under your own risk: + - [jdtls-launcher](https://github.com/eruizc-dev/jdtls-launcher) (Includes lombok support by default) + ```lua + -- init.lua + require'lspconfig'.jdtls.setup{ cmd = { 'jdtls' } } + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jdtls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "jdtls", "-configuration", "/home/user/.cache/jdtls/config", "-data", "/home/user/.cache/jdtls/workspace" } + ``` + - `filetypes` : + ```lua + { "java" } + ``` + - `handlers` : + ```lua + { + ["language/status"] = <function 1>, + ["textDocument/codeAction"] = <function 2>, + ["textDocument/rename"] = <function 3>, + ["workspace/applyEdit"] = <function 4> + } + ``` + - `init_options` : + ```lua + { + jvm_args = {}, + workspace = "/home/user/.cache/jdtls/workspace" + } + ``` + - `root_dir` : + ```lua + { + -- Single-module projects + { + 'build.xml', -- Ant + 'pom.xml', -- Maven + 'settings.gradle', -- Gradle + 'settings.gradle.kts', -- Gradle + }, + -- Multi-module projects + { 'build.gradle', 'build.gradle.kts' }, + } or vim.fn.getcwd() + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jedi_language_server + +https://github.com/pappasam/jedi-language-server + +`jedi-language-server`, a language server for Python, built on top of jedi + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jedi_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "jedi-language-server" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + vim's starting directory + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jinja_lsp + +jinja-lsp enhances minijinja development experience by providing Helix/Nvim users with advanced features such as autocomplete, syntax highlighting, hover, goto definition, code actions and linting. + +The file types are not detected automatically, you can register them manually (see below) or override the filetypes: + +```lua +vim.filetype.add { + extension = { + jinja = 'jinja', + jinja2 = 'jinja', + j2 = 'jinja', + }, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jinja_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "jinja-lsp" } + ``` + - `filetypes` : + ```lua + { "jinja" } + ``` + - `name` : + ```lua + "jinja_lsp" + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jqls + +https://github.com/wader/jq-lsp +Language server for jq, written using Go. +You can install the server easily using go install: +```sh +# install directly +go install github.com/wader/jq-lsp@master +# copy binary to $PATH +cp $(go env GOPATH)/bin/jq-lsp /usr/local/bin +``` +Note: To activate properly nvim needs to know the jq filetype. +You can add it via: +```lua +vim.cmd(\[\[au BufRead,BufNewFile *.jq setfiletype jq\]\]) +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jqls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "jq-lsp" } + ``` + - `filetypes` : + ```lua + { "jq" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jsonls + +https://github.com/hrsh7th/vscode-langservers-extracted + +vscode-json-language-server, a language server for JSON and JSON schema + +`vscode-json-language-server` can be installed via `npm`: +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-json-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.jsonls.setup { + capabilities = capabilities, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jsonls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vscode-json-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "json", "jsonc" } + ``` + - `init_options` : + ```lua + { + provideFormatter = true + } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jsonnet_ls + +https://github.com/grafana/jsonnet-language-server + +A Language Server Protocol (LSP) server for Jsonnet. + +The language server can be installed with `go`: +```sh +go install github.com/grafana/jsonnet-language-server@latest +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jsonnet_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "jsonnet-language-server" } + ``` + - `filetypes` : + ```lua + { "jsonnet", "libsonnet" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("jsonnetfile.json") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## julials + +https://github.com/julia-vscode/julia-vscode + +LanguageServer.jl can be installed with `julia` and `Pkg`: +```sh +julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.add("LanguageServer")' +``` +where `~/.julia/environments/nvim-lspconfig` is the location where +the default configuration expects LanguageServer.jl to be installed. + +To update an existing install, use the following command: +```sh +julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.update()' +``` + +Note: In order to have LanguageServer.jl pick up installed packages or dependencies in a +Julia project, you must make sure that the project is instantiated: +```sh +julia --project=/path/to/my/project -e 'using Pkg; Pkg.instantiate()' +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.julials.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "julia", "--startup-file=no", "--history-file=no", "-e", ' # Load LanguageServer.jl: attempt to load from ~/.julia/environments/nvim-lspconfig\n # with the regular load path as a fallback\n ls_install_path = joinpath(\n get(DEPOT_PATH, 1, joinpath(homedir(), ".julia")),\n "environments", "nvim-lspconfig"\n )\n pushfirst!(LOAD_PATH, ls_install_path)\n using LanguageServer\n popfirst!(LOAD_PATH)\n depot_path = get(ENV, "JULIA_DEPOT_PATH", "")\n project_path = let\n dirname(something(\n ## 1. Finds an explicitly set project (JULIA_PROJECT)\n Base.load_path_expand((\n p = get(ENV, "JULIA_PROJECT", nothing);\n p === nothing ? nothing : isempty(p) ? nothing : p\n )),\n ## 2. Look for a Project.toml file in the current working directory,\n ## or parent directories, with $HOME as an upper boundary\n Base.current_project(),\n ## 3. First entry in the load path\n get(Base.load_path(), 1, nothing),\n ## 4. Fallback to default global environment,\n ## this is more or less unreachable\n Base.load_path_expand("@v#.#"),\n ))\n end\n @info "Running language server" VERSION pwd() project_path depot_path\n server = LanguageServer.LanguageServerInstance(stdin, stdout, project_path, depot_path)\n server.runlinter = true\n run(server)\n ' } + ``` + - `filetypes` : + ```lua + { "julia" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## koka + + https://koka-lang.github.io/koka/doc/index.html +Koka is a functional programming language with effect types and handlers. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.koka.setup{} +``` + + +**Default values:** + - `capabilities` : + ```lua + default capabilities, with offsetEncoding utf-8 + ``` + - `cmd` : + ```lua + { "koka", "--language-server" } + ``` + - `filetypes` : + ```lua + { "kk" } + ``` + - `root_dir` : + ```lua + + ``` + - `single_file_support` : + ```lua + true + ``` + + +## kotlin_language_server + + A kotlin language server which was developed for internal usage and + released afterwards. Maintaining is not done by the original author, + but by fwcd. + + It is built via gradle and developed on github. + Source and additional description: + https://github.com/fwcd/kotlin-language-server + + This server requires vim to be aware of the kotlin-filetype. + You could refer for this capability to: + https://github.com/udalov/kotlin-vim (recommended) + Note that there is no LICENSE specified yet. + + For faster startup, you can setup caching by specifying a storagePath + in the init_options. The default is your home directory. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.kotlin_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "kotlin-language-server" } + ``` + - `filetypes` : + ```lua + { "kotlin" } + ``` + - `init_options` : + ```lua + { + storagePath = "Enables caching and use project root to store cache data. See source" + } + ``` + - `root_dir` : + ```lua + See source + ``` + + +## lean3ls + +https://github.com/leanprover/lean-client-js/tree/master/lean-language-server + +Lean installation instructions can be found +[here](https://leanprover-community.github.io/get_started.html#regular-install). + +Once Lean is installed, you can install the Lean 3 language server by running +```sh +npm install -g lean-language-server +``` + +Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim), +that plugin fully handles the setup of the Lean language server, +and you shouldn't set up `lean3ls` both with it and `lspconfig`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lean3ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lean-language-server", "--stdio", "--", "-M", "4096", "-T", "100000" } + ``` + - `filetypes` : + ```lua + { "lean3" } + ``` + - `offset_encoding` : + ```lua + "utf-32" + ``` + - `root_dir` : + ```lua + root_pattern("leanpkg.toml") or root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## leanls + +https://github.com/leanprover/lean4 + +Lean installation instructions can be found +[here](https://leanprover-community.github.io/get_started.html#regular-install). + +The Lean 4 language server is built-in with a Lean 4 install +(and can be manually run with, e.g., `lean --server`). + +Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim), +that plugin fully handles the setup of the Lean language server, +and you shouldn't set up `leanls` both with it and `lspconfig`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.leanls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lake", "serve", "--" } + ``` + - `filetypes` : + ```lua + { "lean" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `options` : + ```lua + { + no_lake_lsp_cmd = { "lean", "--server" } + } + ``` + - `root_dir` : + ```lua + root_pattern("lakefile.lean", "lean-toolchain", "leanpkg.toml", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## lelwel_ls + +https://github.com/0x2a-42/lelwel + +Language server for lelwel grammars. + +You can install `lelwel-ls` via cargo: +```sh +cargo install --features="lsp" lelwel +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lelwel_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lelwel-ls" } + ``` + - `filetypes` : + ```lua + { "llw" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## lemminx + +https://github.com/eclipse/lemminx + +The easiest way to install the server is to get a binary from https://github.com/redhat-developer/vscode-xml/releases and place it on your PATH. + +NOTE to macOS users: Binaries from unidentified developers are blocked by default. If you trust the downloaded binary, run it once, cancel the prompt, then remove the binary from Gatekeeper quarantine with `xattr -d com.apple.quarantine lemminx`. It should now run without being blocked. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lemminx.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lemminx" } + ``` + - `filetypes` : + ```lua + { "xml", "xsd", "xsl", "xslt", "svg" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## lexical + + https://github.com/lexical-lsp/lexical + + Lexical is a next-generation language server for the Elixir programming language. + + Follow the [Detailed Installation Instructions](https://github.com/lexical-lsp/lexical/blob/main/pages/installation.md) + + **By default, `lexical` doesn't have a `cmd` set.** + This is because nvim-lspconfig does not make assumptions about your path. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lexical.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "elixir", "eelixir", "heex", "surface" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ltex + +https://github.com/valentjn/ltex-ls + +LTeX Language Server: LSP language server for LanguageTool 🔍✔️ with support for LaTeX 🎓, Markdown 📝, and others + +To install, download the latest [release](https://github.com/valentjn/ltex-ls/releases) and ensure `ltex-ls` is on your path. + +This server accepts configuration via the `settings` key. + +```lua + settings = { + ltex = { + language = "en-GB", + }, + }, +``` + +To support org files or R sweave, users can define a custom filetype autocommand (or use a plugin which defines these filetypes): + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.org set filetype=org ]] +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ltex.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ltex-ls" } + ``` + - `filetypes` : + ```lua + { "bib", "gitcommit", "markdown", "org", "plaintex", "rst", "rnoweb", "tex", "pandoc", "quarto", "rmd", "context", "html", "xhtml", "mail", "text" } + ``` + - `get_language_id` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + ltex = { + enabled = { "bibtex", "gitcommit", "markdown", "org", "tex", "restructuredtext", "rsweave", "latex", "quarto", "rmd", "context", "html", "xhtml", "mail", "plaintext" } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## lua_ls + +https://github.com/luals/lua-language-server + +Lua language server. + +`lua-language-server` can be installed by following the instructions [here](https://luals.github.io/#neovim-install). + +The default `cmd` assumes that the `lua-language-server` binary can be found in `$PATH`. + +If you primarily use `lua-language-server` for Neovim, and want to provide completions, +analysis, and location handling for plugins on runtime path, you can use the following +settings. + +```lua +require'lspconfig'.lua_ls.setup { + on_init = function(client) + local path = client.workspace_folders[1].name + if vim.loop.fs_stat(path..'/.luarc.json') or vim.loop.fs_stat(path..'/.luarc.jsonc') then + return + end + + client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { + runtime = { + -- Tell the language server which version of Lua you're using + -- (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT' + }, + -- Make the server aware of Neovim runtime files + workspace = { + checkThirdParty = false, + library = { + vim.env.VIMRUNTIME + -- Depending on the usage, you might want to add additional paths here. + -- "${3rd}/luv/library" + -- "${3rd}/busted/library", + } + -- or pull in all of 'runtimepath'. NOTE: this is a lot slower + -- library = vim.api.nvim_get_runtime_file("", true) + } + }) + end, + settings = { + Lua = {} + } +} +``` + +See `lua-language-server`'s [documentation](https://luals.github.io/wiki/settings/) for an explanation of the above fields: +* [Lua.runtime.path](https://luals.github.io/wiki/settings/#runtimepath) +* [Lua.workspace.library](https://luals.github.io/wiki/settings/#workspacelibrary) + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lua_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lua-language-server" } + ``` + - `filetypes` : + ```lua + { "lua" } + ``` + - `log_level` : + ```lua + 2 + ``` + - `root_dir` : + ```lua + root_pattern(".luarc.json", ".luarc.jsonc", ".luacheckrc", ".stylua.toml", "stylua.toml", "selene.toml", "selene.yml", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## luau_lsp + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.luau_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "luau-lsp", "lsp" } + ``` + - `filetypes` : + ```lua + { "luau" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## lwc_ls + +https://github.com/forcedotcom/lightning-language-server/ + +Language server for Lightning Web Components. + +For manual installation, utilize the official [NPM package](https://www.npmjs.com/package/@salesforce/lwc-language-server). +Then, configure `cmd` to run the Node script at the unpacked location: + +```lua +require'lspconfig'.lwc_ls.setup { + cmd = { + 'node', + '/path/to/node_modules/@salesforce/lwc-language-server/bin/lwc-language-server.js', + '--stdio' + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lwc_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lwc-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "javascript", "html" } + ``` + - `init_options` : + ```lua + { + embeddedLanguages = { + javascript = true + } + } + ``` + - `root_dir` : + ```lua + root_pattern('sfdx-project.json') + ``` + + +## m68k + +https://github.com/grahambates/m68k-lsp + +Language server for Motorola 68000 family assembly + +`m68k-lsp-server` can be installed via `npm`: + +```sh +npm install -g m68k-lsp-server +``` + +Ensure you are using the 68k asm syntax variant in Neovim. + +```lua +vim.g.asmsyntax = 'asm68k' +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.m68k.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "m68k-lsp-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "asm68k" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## markdown_oxide + +https://github.com/Feel-ix-343/markdown-oxide + +Let's record your consciousness! Bring your own text editor! +Implemented as a language server compatible with any text +editor, Markdown-Oxide is attempting to be the best PKM +system for software enthusiasts. + +Check the readme to see how to properly setup nvim-cmp. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.markdown_oxide.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "markdown-oxide" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## marksman + +https://github.com/artempyanykh/marksman + +Marksman is a Markdown LSP server providing completion, cross-references, diagnostics, and more. + +Marksman works on MacOS, Linux, and Windows and is distributed as a self-contained binary for each OS. + +Pre-built binaries can be downloaded from https://github.com/artempyanykh/marksman/releases + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.marksman.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "marksman", "server" } + ``` + - `filetypes` : + ```lua + { "markdown", "markdown.mdx" } + ``` + - `root_dir` : + ```lua + root_pattern(".git", ".marksman.toml") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## matlab_ls + +https://github.com/mathworks/MATLAB-language-server + +MATLAB® language server implements the Microsoft® Language Server Protocol for the MATLAB language. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.matlab_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "matlab-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "matlab" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + MATLAB = { + indexWorkspace = false, + installPath = "", + matlabConnectionTiming = "onStart", + telemetry = true + } + } + ``` + - `single_file_support` : + ```lua + false + ``` + + +## mdx_analyzer + +https://github.com/mdx-js/mdx-analyzer + +`mdx-analyzer`, a language server for MDX + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mdx_analyzer.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mdx-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown.mdx" } + ``` + - `init_options` : + ```lua + { + typescript = {} + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## mesonlsp + +https://github.com/JCWasmx86/mesonlsp + +An unofficial, unendorsed language server for meson written in C++ + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mesonlsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mesonlsp", "--lsp" } + ``` + - `filetypes` : + ```lua + { "meson" } + ``` + - `root_dir` : + ```lua + util.root_pattern("meson_options.txt", "meson.options", ".git") + ``` + + +## metals + +https://scalameta.org/metals/ + +Scala language server with rich IDE features. + +See full instructions in the Metals documentation: + +https://scalameta.org/metals/docs/editors/vim#using-an-alternative-lsp-client + +Note: that if you're using [nvim-metals](https://github.com/scalameta/nvim-metals), that plugin fully handles the setup and installation of Metals, and you shouldn't set up Metals both with it and `lspconfig`. + +To install Metals, make sure to have [coursier](https://get-coursier.io/docs/cli-installation) installed, and once you do you can install the latest Metals with `cs install metals`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.metals.setup{} +``` + + +**Default values:** + - `capabilities` : + ```lua + { + workspace = { + configuration = false + } + } + ``` + - `cmd` : + ```lua + { "metals" } + ``` + - `filetypes` : + ```lua + { "scala" } + ``` + - `init_options` : + ```lua + { + compilerOptions = { + snippetAutoIndent = false + }, + isHttpEnabled = true, + statusBarProvider = "show-message" + } + ``` + - `message_level` : + ```lua + 4 + ``` + - `root_dir` : + ```lua + util.root_pattern("build.sbt", "build.sc", "build.gradle", "pom.xml") + ``` + + +## millet + +https://github.com/azdavis/millet + +Millet, a language server for Standard ML + +To use with nvim: + +1. Install a Rust toolchain: https://rustup.rs +2. Clone the repo +3. Run `cargo build --release --bin lang-srv` +4. Move `target/release/lang-srv` to somewhere on your $PATH as `millet` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.millet.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "millet" } + ``` + - `filetypes` : + ```lua + { "sml" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## mint + +https://www.mint-lang.com + +Install Mint using the [instructions](https://www.mint-lang.com/install). +The language server is included since version 0.12.0. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mint.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mint", "ls" } + ``` + - `filetypes` : + ```lua + { "mint" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## mlir_lsp_server + +https://mlir.llvm.org/docs/Tools/MLIRLSP/#mlir-lsp-language-server--mlir-lsp-server= + +The Language Server for the LLVM MLIR language + +`mlir-lsp-server` can be installed at the llvm-project repository (https://github.com/llvm/llvm-project) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mlir_lsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mlir-lsp-server" } + ``` + - `filetypes` : + ```lua + { "mlir" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## mlir_pdll_lsp_server + +https://mlir.llvm.org/docs/Tools/MLIRLSP/#pdll-lsp-language-server--mlir-pdll-lsp-server + +The Language Server for the LLVM PDLL language + +`mlir-pdll-lsp-server` can be installed at the llvm-project repository (https://github.com/llvm/llvm-project) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mlir_pdll_lsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mlir-pdll-lsp-server" } + ``` + - `filetypes` : + ```lua + { "pdll" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## mm0_ls + +https://github.com/digama0/mm0 + +Language Server for the metamath-zero theorem prover. + +Requires [mm0-rs](https://github.com/digama0/mm0/tree/master/mm0-rs) to be installed +and available on the `PATH`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mm0_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mm0-rs", "server" } + ``` + - `filetypes` : + ```lua + { "metamath-zero" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## mojo + +https://github.com/modularml/mojo + +`mojo-lsp-server` can be installed [via Modular](https://developer.modular.com/download) + +Mojo is a new programming language that bridges the gap between research and production by combining Python syntax and ecosystem with systems programming and metaprogramming features. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mojo.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mojo-lsp-server" } + ``` + - `filetypes` : + ```lua + { "mojo" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## motoko_lsp + +https://github.com/dfinity/vscode-motoko + +Language server for the Motoko programming language. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.motoko_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "motoko-lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "motoko" } + ``` + - `init_options` : + ```lua + { + formatter = "auto" + } + ``` + - `root_dir` : + ```lua + root_pattern("dfx.json", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## move_analyzer + +https://github.com/move-language/move/tree/main/language/move-analyzer + +Language server for Move + +The `move-analyzer` can be installed by running: + +``` +cargo install --git https://github.com/move-language/move move-analyzer +``` + +See [`move-analyzer`'s doc](https://github.com/move-language/move/blob/1b258a06e3c7d2bc9174578aac92cca3ac19de71/language/move-analyzer/editors/code/README.md#how-to-install) for details. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.move_analyzer.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "move-analyzer" } + ``` + - `filetypes` : + ```lua + { "move" } + ``` + - `root_dir` : + ```lua + root_pattern("Move.toml") + ``` + + +## mutt_ls + +https://github.com/neomutt/mutt-language-server + +A language server for (neo)mutt's muttrc. It can be installed via pip. + +```sh +pip install mutt-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mutt_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mutt-language-server" } + ``` + - `filetypes` : + ```lua + { "muttrc", "neomuttrc" } + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nelua_lsp + +https://github.com/codehz/nelua-lsp + +nelua-lsp is an experimental nelua language server. + +You need [nelua.vim](https://github.com/stefanos82/nelua.vim/blob/main/ftdetect/nelua.vim) for nelua files to be recognized or add this to your config: + +in vimscript: +```vimscript +au BufNewFile,BufRead *.nelua setf nelua +``` + +in lua: +```lua +vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, { pattern = { "*.nelua" }, command = "setf nelua"}) +``` + +**By default, nelua-lsp doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. + +```lua +require'lspconfig'.nelua_lsp.setup { + cmd = { "nelua", "-L", "/path/to/nelua-lsp/", "--script", "/path/to/nelua-lsp/nelua-lsp.lua" }, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nelua_lsp.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "nelua" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## neocmake + +https://github.com/Decodetalkers/neocmakelsp + +CMake LSP Implementation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.neocmake.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "neocmakelsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "cmake" } + ``` + - `root_dir` : + ```lua + root_pattern('.git', 'cmake') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nextls + +https://github.com/elixir-tools/next-ls + +**By default, next-ls does not set its `cmd`. Please see the following [detailed instructions](https://www.elixir-tools.dev/docs/next-ls/installation/) for possible installation methods.** + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nextls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "elixir", "eelixir", "heex", "surface" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nginx_language_server + +https://pypi.org/project/nginx-language-server/ + +`nginx-language-server` can be installed via pip: + +```sh +pip install -U nginx-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nginx_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nginx-language-server" } + ``` + - `filetypes` : + ```lua + { "nginx" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nickel_ls + +Nickel Language Server + +https://github.com/tweag/nickel + +`nls` can be installed with nix, or cargo, from the Nickel repository. +```sh +git clone https://github.com/tweag/nickel.git +``` + +Nix: +```sh +cd nickel +nix-env -f . -i +``` + +cargo: +```sh +cd nickel/lsp/nls +cargo install --path . +``` + +In order to have lspconfig detect Nickel filetypes (a prerequisite for autostarting a server), +install the [Nickel vim plugin](https://github.com/nickel-lang/vim-nickel). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nickel_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nls" } + ``` + - `filetypes` : + ```lua + { "ncl", "nickel" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## nil_ls + +https://github.com/oxalica/nil + +A new language server for Nix Expression Language. + +If you are using Nix with Flakes support, run `nix profile install github:oxalica/nil` to install. +Check the repository README for more information. + +_See an example config at https://github.com/oxalica/nil/blob/main/dev/nvim-lsp.nix._ + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nil_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nil" } + ``` + - `filetypes` : + ```lua + { "nix" } + ``` + - `root_dir` : + ```lua + root_pattern("flake.nix", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nim_langserver + +https://github.com/nim-lang/langserver + + +`nim-langserver` can be installed via the `nimble` package manager: +```sh +nimble install nimlangserver +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nim_langserver.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nimlangserver" } + ``` + - `filetypes` : + ```lua + { "nim" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nimls + +https://github.com/PMunch/nimlsp + +`nimlsp` can be installed via the `nimble` package manager: + +```sh +nimble install nimlsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nimls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nimlsp" } + ``` + - `filetypes` : + ```lua + { "nim" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nixd + +https://github.com/nix-community/nixd + +Nix language server, based on nix libraries. + +If you are using Nix with Flakes support, run `nix profile install github:nix-community/nixd` to install. +Check the repository README for more information. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nixd.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nixd" } + ``` + - `filetypes` : + ```lua + { "nix" } + ``` + - `root_dir` : + ```lua + root_pattern("flake.nix",".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nomad_lsp + +https://github.com/juliosueiras/nomad-lsp + +Written in Go, compilation is needed for `nomad_lsp` to be used. Please see the [original repository](https://github.com/juliosuieras/nomad-lsp). + +Add the executable to your system or vim PATH and it will be set to go. + +No configuration option is needed unless you choose not to add `nomad-lsp` executable to the PATH. You should know what you are doing if you choose so. + +```lua +require('lspconfig').nomad_lsp.setup{ } +``` + +However, a `hcl.nomad` or `nomad` filetype should be defined. + +Description of your jobs should be written in `.nomad` files for the LSP client to configure the server's `root_dir` configuration option. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nomad_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nomad-lsp" } + ``` + - `filetypes` : + ```lua + { "hcl.nomad", "nomad" } + ``` + - `root_dir` : + ```lua + util.root_pattern("hcl.nomad", "nomad") + ``` + + +## ntt + +https://github.com/nokia/ntt +Installation instructions can be found [here](https://github.com/nokia/ntt#Install). +Can be configured by passing a "settings" object to `ntt.setup{}`: +```lua +require('lspconfig').ntt.setup{ + settings = { + ntt = { + } + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ntt.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ntt", "langserver" } + ``` + - `filetypes` : + ```lua + { "ttcn" } + ``` + - `root_dir` : + ```lua + util.root_pattern(".git") + ``` + + +## nushell + +https://github.com/nushell/nushell + +Nushell built-in language server. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nushell.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nu", "--lsp" } + ``` + - `filetypes` : + ```lua + { "nu" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nxls + +https://github.com/nrwl/nx-console/tree/master/apps/nxls + +nxls, a language server for Nx Workspaces + +`nxls` can be installed via `npm`: +```sh +npm i -g nxls +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nxls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nxls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "json", "jsonc" } + ``` + - `root_dir` : + ```lua + util.root_pattern + ``` + + +## ocamlls + +https://github.com/ocaml-lsp/ocaml-language-server + +`ocaml-language-server` can be installed via `npm` +```sh +npm install -g ocaml-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ocamlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ocaml-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "ocaml", "reason" } + ``` + - `root_dir` : + ```lua + root_pattern("*.opam", "esy.json", "package.json") + ``` + + +## ocamllsp + +https://github.com/ocaml/ocaml-lsp + +`ocaml-lsp` can be installed as described in [installation guide](https://github.com/ocaml/ocaml-lsp#installation). + +To install the lsp server in a particular opam switch: +```sh +opam install ocaml-lsp-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ocamllsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ocamllsp" } + ``` + - `filetypes` : + ```lua + { "ocaml", "menhir", "ocamlinterface", "ocamllex", "reason", "dune" } + ``` + - `get_language_id` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("*.opam", "esy.json", "package.json", ".git", "dune-project", "dune-workspace") + ``` + + +## ols + + https://github.com/DanielGavin/ols + + `Odin Language Server`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ols.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ols" } + ``` + - `filetypes` : + ```lua + { "odin" } + ``` + - `root_dir` : + ```lua + util.root_pattern("ols.json", ".git", "*.odin") + ``` + + +## omnisharp + +https://github.com/omnisharp/omnisharp-roslyn +OmniSharp server based on Roslyn workspaces + +`omnisharp-roslyn` can be installed by downloading and extracting a release from [here](https://github.com/OmniSharp/omnisharp-roslyn/releases). +OmniSharp can also be built from source by following the instructions [here](https://github.com/omnisharp/omnisharp-roslyn#downloading-omnisharp). + +OmniSharp requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +**By default, omnisharp-roslyn doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. + +For `go_to_definition` to work fully, extended `textDocument/definition` handler is needed, for example see [omnisharp-extended-lsp.nvim](https://github.com/Hoffs/omnisharp-extended-lsp.nvim) + +```lua +require'lspconfig'.omnisharp.setup { + cmd = { "dotnet", "/path/to/omnisharp/OmniSharp.dll" }, + + settings = { + FormattingOptions = { + -- Enables support for reading code style, naming convention and analyzer + -- settings from .editorconfig. + EnableEditorConfigSupport = true, + -- Specifies whether 'using' directives should be grouped and sorted during + -- document formatting. + OrganizeImports = nil, + }, + MsBuild = { + -- If true, MSBuild project system will only load projects for files that + -- were opened in the editor. This setting is useful for big C# codebases + -- and allows for faster initialization of code navigation features only + -- for projects that are relevant to code that is being edited. With this + -- setting enabled OmniSharp may load fewer projects and may thus display + -- incomplete reference lists for symbols. + LoadProjectsOnDemand = nil, + }, + RoslynExtensionsOptions = { + -- Enables support for roslyn analyzers, code fixes and rulesets. + EnableAnalyzersSupport = nil, + -- Enables support for showing unimported types and unimported extension + -- methods in completion lists. When committed, the appropriate using + -- directive will be added at the top of the current file. This option can + -- have a negative impact on initial completion responsiveness, + -- particularly for the first few completion sessions after opening a + -- solution. + EnableImportCompletion = nil, + -- Only run analyzers against open files when 'enableRoslynAnalyzers' is + -- true + AnalyzeOpenDocumentsOnly = nil, + }, + Sdk = { + -- Specifies whether to include preview versions of the .NET SDK when + -- determining which version to use for project loading. + IncludePrereleases = true, + }, + }, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.omnisharp.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "cs", "vb" } + ``` + - `init_options` : + ```lua + {} + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("*.sln", "*.csproj", "omnisharp.json", "function.json") + ``` + - `settings` : + ```lua + { + FormattingOptions = { + EnableEditorConfigSupport = true + }, + MsBuild = {}, + RoslynExtensionsOptions = {}, + Sdk = { + IncludePrereleases = true + } + } + ``` + + +## opencl_ls + +https://github.com/Galarius/opencl-language-server + +Build instructions can be found [here](https://github.com/Galarius/opencl-language-server/blob/main/_dev/build.md). + +Prebuilt binaries are available for Linux, macOS and Windows [here](https://github.com/Galarius/opencl-language-server/releases). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.opencl_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "opencl-language-server" } + ``` + - `filetypes` : + ```lua + { "opencl" } + ``` + - `root_dir` : + ```lua + util.root_pattern(".git") + ``` + + +## openedge_ls + +[Language server](https://github.com/vscode-abl/vscode-abl) for Progress OpenEdge ABL. + +For manual installation, download abl-lsp.jar from the [VSCode +extension](https://github.com/vscode-abl/vscode-abl/releases/latest). + +Configuration + +```lua +require('lspconfig').['openedge_ls'].setup { + oe_jar_path = '/path/to/abl-lsp.jar', + dlc = '12.2:/path/to/dlc-12.2', -- Version number and OpenEdge root directory (colon separator) + debug = false, -- Set to true for debug logging + trace = false -- Set to true for trace logging (REALLY verbose) +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.openedge_ls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "progress" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern('openedge-project.json') + ``` + + +## openscad_ls + +https://github.com/dzhu/openscad-language-server + +A Language Server Protocol server for OpenSCAD + +You can build and install `openscad-language-server` binary with `cargo`: +```sh +cargo install openscad-language-server +``` + +Vim does not have built-in syntax for the `openscad` filetype currently. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.scad set filetype=openscad ]] +``` + +or by installing a filetype plugin such as https://github.com/sirtaj/vim-openscad + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.openscad_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "openscad-language-server" } + ``` + - `filetypes` : + ```lua + { "openscad" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## openscad_lsp + +https://github.com/Leathong/openscad-LSP + +A Language Server Protocol server for OpenSCAD + +You can build and install `openscad-lsp` binary with `cargo`: +```sh +cargo install openscad-lsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.openscad_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "openscad-lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "openscad" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## pact_ls + +https://github.com/kadena-io/pact-lsp + +The Pact language server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pact_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pact-lsp" } + ``` + - `filetypes` : + ```lua + { "pact" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## pasls + +https://github.com/genericptr/pascal-language-server + +An LSP server implementation for Pascal variants that are supported by Free Pascal, including Object Pascal. It uses CodeTools from Lazarus as backend. + +First set `cmd` to the Pascal lsp binary. + +Customization options are passed to pasls as environment variables for example in your `.bashrc`: +```bash +export FPCDIR='/usr/lib/fpc/src' # FPC source directory (This is the only required option for the server to work). +export PP='/usr/lib/fpc/3.2.2/ppcx64' # Path to the Free Pascal compiler executable. +export LAZARUSDIR='/usr/lib/lazarus' # Path to the Lazarus sources. +export FPCTARGET='' # Target operating system for cross compiling. +export FPCTARGETCPU='x86_64' # Target CPU for cross compiling. +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pasls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pasls" } + ``` + - `filetypes` : + ```lua + { "pascal" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## pbls + +https://git.sr.ht/~rrc/pbls + +Prerequisites: Ensure protoc is on your $PATH. + +`pbls` can be installed via `cargo install`: +```sh +cargo install --git https://git.sr.ht/~rrc/pbls +``` + +pbls is a Language Server for protobuf + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pbls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pbls" } + ``` + - `filetypes` : + ```lua + { "proto" } + ``` + - `root_dir` : + ```lua + root_pattern(".pbls.toml", ".git") + ``` + + +## perlls + +https://github.com/richterger/Perl-LanguageServer/tree/master/clients/vscode/perl + +`Perl-LanguageServer`, a language server for Perl. + +To use the language server, ensure that you have Perl::LanguageServer installed and perl command is on your path. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.perlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "perl", "-MPerl::LanguageServer", "-e", "Perl::LanguageServer::run", "--", "--port 13603", "--nostdio 0" } + ``` + - `filetypes` : + ```lua + { "perl" } + ``` + - `root_dir` : + ```lua + vim's starting directory + ``` + - `settings` : + ```lua + { + perl = { + fileFilter = { ".pm", ".pl" }, + ignoreDirs = ".git", + perlCmd = "perl", + perlInc = " " + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## perlnavigator + +https://github.com/bscan/PerlNavigator + +A Perl language server. It can be installed via npm: + +```sh +npm i -g perlnavigator-server +``` + +At minimum, you will need `perl` in your path. If you want to use a non-standard `perl` you will need to set your configuration like so: +```lua +settings = { + perlnavigator = { + perlPath = '/some/odd/location/my-perl' + } +} +``` + +The `contributes.configuration.properties` section of `perlnavigator`'s `package.json` has all available configuration settings. All +settings have a reasonable default, but, at minimum, you may want to point `perlnavigator` at your `perltidy` and `perlcritic` configurations. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.perlnavigator.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "perlnavigator" } + ``` + - `filetypes` : + ```lua + { "perl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## perlpls + +https://github.com/FractalBoy/perl-language-server +https://metacpan.org/pod/PLS + +`PLS`, another language server for Perl. + +To use the language server, ensure that you have PLS installed and that it is in your path + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.perlpls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pls" } + ``` + - `filetypes` : + ```lua + { "perl" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `settings` : + ```lua + { + perl = { + perlcritic = { + enabled = false + }, + syntax = { + enabled = true + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## pest_ls + +https://github.com/pest-parser/pest-ide-tools + +Language server for pest grammars. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pest_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pest-language-server" } + ``` + - `filetypes` : + ```lua + { "pest" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## phan + +https://github.com/phan/phan + +Installation: https://github.com/phan/phan#getting-started + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.phan.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "phan", "-m", "json", "--no-color", "--no-progress-bar", "-x", "-u", "-S", "--language-server-on-stdin", "--allow-polyfill-parser" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("composer.json", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## phpactor + +https://github.com/phpactor/phpactor + +Installation: https://phpactor.readthedocs.io/en/master/usage/standalone.html#global-installation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.phpactor.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "phpactor", "language-server" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("composer.json", ".git") + ``` + + +## pico8_ls + +https://github.com/japhib/pico8-ls + +Full language support for the PICO-8 dialect of Lua. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pico8_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pico8-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "p8" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## pkgbuild_language_server + +https://github.com/Freed-Wu/pkgbuild-language-server + +Language server for ArchLinux/Windows Msys2's PKGBUILD. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pkgbuild_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pkgbuild-language-server" } + ``` + - `filetypes` : + ```lua + { "PKGBUILD" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## please + +https://github.com/thought-machine/please + +High-performance extensible build system for reproducible multi-language builds. + +The `plz` binary will automatically install the LSP for you on first run + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.please.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "plz", "tool", "lps" } + ``` + - `filetypes` : + ```lua + { "bzl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## postgres_lsp + +https://github.com/supabase/postgres_lsp + +A Language Server for Postgres + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.postgres_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "postgres_lsp" } + ``` + - `filetypes` : + ```lua + { "sql" } + ``` + - `root_dir` : + ```lua + util.root_pattern 'root-file.txt' + ``` + - `single_file_support` : + ```lua + true + ``` + + +## powershell_es + +https://github.com/PowerShell/PowerShellEditorServices + +Language server for PowerShell. + +To install, download and extract PowerShellEditorServices.zip +from the [releases](https://github.com/PowerShell/PowerShellEditorServices/releases). +To configure the language server, set the property `bundle_path` to the root +of the extracted PowerShellEditorServices.zip. + +The default configuration doesn't set `cmd` unless `bundle_path` is specified. + +```lua +require'lspconfig'.powershell_es.setup{ + bundle_path = 'c:/w/PowerShellEditorServices', +} +``` + +By default the languageserver is started in `pwsh` (PowerShell Core). This can be changed by specifying `shell`. + +```lua +require'lspconfig'.powershell_es.setup{ + bundle_path = 'c:/w/PowerShellEditorServices', + shell = 'powershell.exe', +} +``` + +Note that the execution policy needs to be set to `Unrestricted` for the languageserver run under PowerShell + +If necessary, specific `cmd` can be defined instead of `bundle_path`. +See [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices#stdio) +to learn more. + +```lua +require'lspconfig'.powershell_es.setup{ + cmd = {'pwsh', '-NoLogo', '-NoProfile', '-Command', "c:/PSES/Start-EditorServices.ps1 ..."} +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.powershell_es.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "ps1" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + git root or current directory + ``` + - `shell` : + ```lua + "pwsh" + ``` + - `single_file_support` : + ```lua + true + ``` + + +## prismals + +Language Server for the Prisma JavaScript and TypeScript ORM + +`@prisma/language-server` can be installed via npm +```sh +npm install -g @prisma/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.prismals.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "prisma-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "prisma" } + ``` + - `root_dir` : + ```lua + root_pattern(".git", "package.json") + ``` + - `settings` : + ```lua + { + prisma = { + prismaFmtBinPath = "" + } + } + ``` + + +## prolog_ls + + https://github.com/jamesnvc/lsp_server + + Language Server Protocol server for SWI-Prolog + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.prolog_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "swipl", "-g", "use_module(library(lsp_server)).", "-g", "lsp_server:main", "-t", "halt", "--", "stdio" } + ``` + - `filetypes` : + ```lua + { "prolog" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## prosemd_lsp + +https://github.com/kitten/prosemd-lsp + +An experimental LSP for Markdown. + +Please see the manual installation instructions: https://github.com/kitten/prosemd-lsp#manual-installation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.prosemd_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "prosemd-lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + <function 1> + ``` + - `single_file_support` : + ```lua + true + ``` + + +## psalm + +https://github.com/vimeo/psalm + +Can be installed with composer. +```sh +composer global require vimeo/psalm +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.psalm.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "psalm", "--language-server" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("psalm.xml", "psalm.xml.dist") + ``` + + +## puppet + +LSP server for Puppet. + +Installation: + +- Clone the editor-services repository: + https://github.com/puppetlabs/puppet-editor-services + +- Navigate into that directory and run: `bundle install` + +- Install the 'puppet-lint' gem: `gem install puppet-lint` + +- Add that repository to $PATH. + +- Ensure you can run `puppet-languageserver` from outside the editor-services directory. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.puppet.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "puppet-languageserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "puppet" } + ``` + - `root_dir` : + ```lua + root_pattern("manifests", ".puppet-lint.rc", "hiera.yaml", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## purescriptls + +https://github.com/nwolverson/purescript-language-server + +The `purescript-language-server` can be added to your project and `$PATH` via + +* JavaScript package manager such as npm, pnpm, Yarn, et al. +* Nix under the `nodePackages` and `nodePackages_latest` package sets + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.purescriptls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "purescript-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "purescript" } + ``` + - `root_dir` : + ```lua + root_pattern('bower.json', 'flake.nix', 'psc-package.json', 'shell.nix', 'spago.dhall', 'spago.yaml'), + ``` + + +## pylsp + +https://github.com/python-lsp/python-lsp-server + +A Python 3.6+ implementation of the Language Server Protocol. + +See the [project's README](https://github.com/python-lsp/python-lsp-server) for installation instructions. + +Configuration options are documented [here](https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md). +In order to configure an option, it must be translated to a nested Lua table and included in the `settings` argument to the `setup{}` function. +For example, in order to set the `pylsp.plugins.pycodestyle.ignore` option: +```lua +require'lspconfig'.pylsp.setup{ + settings = { + pylsp = { + plugins = { + pycodestyle = { + ignore = {'W391'}, + maxLineLength = 100 + } + } + } + } +} +``` + +Note: This is a community fork of `pyls`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pylsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pylsp" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## pylyzer + + https://github.com/mtshiba/pylyzer + + `pylyzer`, a fast static code analyzer & language server for Python. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pylyzer.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pylyzer", "--server" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + python = { + checkOnType = false, + diagnostics = true, + inlayHints = true, + smartCompletion = true + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## pyre + +https://pyre-check.org/ + +`pyre` a static type checker for Python 3. + +`pyre` offers an extremely limited featureset. It currently only supports diagnostics, +which are triggered on save. + +Do not report issues for missing features in `pyre` to `lspconfig`. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pyre.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pyre", "persistent" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## pyright + +https://github.com/microsoft/pyright + +`pyright`, a static type checker and language server for python + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pyright.setup{} +``` +**Commands:** +- PyrightOrganizeImports: Organize Imports +- PyrightSetPythonPath: Reconfigure pyright with the provided python path + +**Default values:** + - `cmd` : + ```lua + { "pyright-langserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + python = { + analysis = { + autoSearchPaths = true, + diagnosticMode = "openFilesOnly", + useLibraryCodeForTypes = true + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## qml_lsp + +https://invent.kde.org/sdk/qml-lsp + +LSP implementation for QML (autocompletion, live linting, etc. in editors) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.qml_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "qml-lsp" } + ``` + - `filetypes` : + ```lua + { "qmljs" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## qmlls + +https://github.com/qt/qtdeclarative + +LSP implementation for QML (autocompletion, live linting, etc. in editors), + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.qmlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "qmlls" } + ``` + - `filetypes` : + ```lua + { "qml", "qmljs" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## quick_lint_js + +https://quick-lint-js.com/ + +quick-lint-js finds bugs in JavaScript programs. + +See installation [instructions](https://quick-lint-js.com/install/) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.quick_lint_js.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "quick-lint-js", "--lsp-server" } + ``` + - `filetypes` : + ```lua + { "javascript", "typescript" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## r_language_server + +[languageserver](https://github.com/REditorSupport/languageserver) is an +implementation of the Microsoft's Language Server Protocol for the R +language. + +It is released on CRAN and can be easily installed by + +```r +install.packages("languageserver") +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.r_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "R", "--slave", "-e", "languageserver::run()" } + ``` + - `filetypes` : + ```lua + { "r", "rmd" } + ``` + - `log_level` : + ```lua + 2 + ``` + - `root_dir` : + ```lua + root_pattern(".git") or os_homedir + ``` + + +## racket_langserver + +[https://github.com/jeapostrophe/racket-langserver](https://github.com/jeapostrophe/racket-langserver) + +The Racket language server. This project seeks to use +[DrRacket](https://github.com/racket/drracket)'s public API to provide +functionality that mimics DrRacket's code tools as closely as possible. + +Install via `raco`: `raco pkg install racket-langserver` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.racket_langserver.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "racket", "--lib", "racket-langserver" } + ``` + - `filetypes` : + ```lua + { "racket", "scheme" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## raku_navigator + +https://github.com/bscan/RakuNavigator +A Raku language server +**By default, raku_navigator doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. +You have to install the language server manually. +Clone the RakuNavigator repo, install based on the [instructions](https://github.com/bscan/raku_Navigator#installation-for-other-editors), +and point `cmd` to `server.js` inside the `server/out` directory: +```lua +cmd = {'node', '<path_to_repo>/server/out/server.js', '--stdio'} +``` +At minimum, you will need `raku` in your path. If you want to use a non-standard `raku` you will need to set your configuration like so: +```lua +settings = { + raku_navigator = { + rakuPath = '/some/odd/location/my-raku' + } +} +``` +The `contributes.configuration.properties` section of `raku_navigator`'s `package.json` has all available configuration settings. All +settings have a reasonable default, but, at minimum, you may want to point `raku_navigator` at your `raku_tidy` and `raku_critic` configurations. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.raku_navigator.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + {} + ``` + - `filetypes` : + ```lua + { "raku" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## reason_ls + +Reason language server + +You can install reason language server from [reason-language-server](https://github.com/jaredly/reason-language-server) repository. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.reason_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "reason-language-server" } + ``` + - `filetypes` : + ```lua + { "reason" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## regal + +https://github.com/StyraInc/regal + +A linter for Rego, with support for running as an LSP server. + +`regal` can be installed by running: +```sh +go install github.com/StyraInc/regal@latest +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.regal.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "regal", "language-server" } + ``` + - `filetypes` : + ```lua + { "rego" } + ``` + - `root_dir` : + ```lua + root_pattern("*.rego", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## regols + +https://github.com/kitagry/regols + +OPA Rego language server. + +`regols` can be installed by running: +```sh +go install github.com/kitagry/regols@latest +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.regols.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "regols" } + ``` + - `filetypes` : + ```lua + { "rego" } + ``` + - `root_dir` : + ```lua + root_pattern("*.rego", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## relay_lsp + + https://github.com/facebook/relay + `Relay` is a JavaScript framework for building data-driven React applications + + Setup: + + - Make sure you have a Relay config file somewhere in your project. + - We support standard config file formats (`.yml`, `.js`, `.json`), and the the `relay` field in your `package.json` + - Make sure you have the `relay-compiler` installed in your project. The bare minimum is v13. + - Make sure you are able to run the `relay-compiler` command from the command line. If `yarn relay-compiler` works, it's very likely that the LSP will work. + - Remove / disable any conflicting GraphQL LSPs you have installed. + + Relay LSP is a part of the Relay Compiler binary and available when adding `relay-compiler` to your project's devDependencies. + + ```lua + require'lspconfig'.relay_lsp.setup { + -- (default: false) Whether or not we should automatically start + -- the Relay Compiler in watch mode when you open a project + auto_start_compiler = false, + + + -- (default: null) Path to a relay config relative to the + -- `root_dir`. Without this, the compiler will search for your + -- config. This is helpful if your relay project is in a nested + -- directory. + path_to_config = nil, + } + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.relay_lsp.setup{} +``` + + +**Default values:** + - `auto_start_compiler` : + ```lua + false + ``` + - `cmd` : + ```lua + { "relay-compiler", "lsp" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" } + ``` + - `handlers` : + ```lua + { + ["window/showStatus"] = <function 1> + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("relay.config.*", "package.json") + ``` + + +## remark_ls + +https://github.com/remarkjs/remark-language-server + +`remark-language-server` can be installed via `npm`: +```sh +npm install -g remark-language-server +``` + +`remark-language-server` uses the same +[configuration files](https://github.com/remarkjs/remark/tree/main/packages/remark-cli#example-config-files-json-yaml-js) +as `remark-cli`. + +This uses a plugin based system. Each plugin needs to be installed locally using `npm` or `yarn`. + +For example, given the following `.remarkrc.json`: + +```json +{ + "presets": [ + "remark-preset-lint-recommended" + ] +} +``` + +`remark-preset-lint-recommended` needs to be installed in the local project: + +```sh +npm install remark-preset-lint-recommended +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.remark_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "remark-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## rescriptls + +https://github.com/rescript-lang/rescript-vscode/tree/master/server + +ReScript Language Server can be installed via npm: +```sh +npm install -g @rescript/language-server +``` + +See the init_options supported (see https://github.com/rescript-lang/rescript-vscode/tree/master/server/config.md): + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rescriptls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rescript-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "rescript" } + ``` + - `init_options` : + ```lua + { + extensionConfiguration = { + askToStartBuild = false + } + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## rls + +https://github.com/rust-lang/rls + +rls, a language server for Rust + +See https://github.com/rust-lang/rls#setup to setup rls itself. +See https://github.com/rust-lang/rls#configuration for rls-specific settings. +All settings listed on the rls configuration section of the readme +must be set under settings.rust as follows: + +```lua +nvim_lsp.rls.setup { + settings = { + rust = { + unstable_features = true, + build_on_save = false, + all_features = true, + }, + }, +} +``` + +If you want to use rls for a particular build, eg nightly, set cmd as follows: + +```lua +cmd = {"rustup", "run", "nightly", "rls"} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rls" } + ``` + - `filetypes` : + ```lua + { "rust" } + ``` + - `root_dir` : + ```lua + root_pattern("Cargo.toml") + ``` + + +## rnix + +https://github.com/nix-community/rnix-lsp + +A language server for Nix providing basic completion and formatting via nixpkgs-fmt. + +To install manually, run `cargo install rnix-lsp`. If you are using nix, rnix-lsp is in nixpkgs. + +This server accepts configuration via the `settings` key. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rnix.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rnix-lsp" } + ``` + - `filetypes` : + ```lua + { "nix" } + ``` + - `init_options` : + ```lua + {} + ``` + - `root_dir` : + ```lua + vim's starting directory + ``` + - `settings` : + ```lua + {} + ``` + + +## robotframework_ls + +https://github.com/robocorp/robotframework-lsp + +Language Server Protocol implementation for Robot Framework. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.robotframework_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "robotframework_ls" } + ``` + - `filetypes` : + ```lua + { "robot" } + ``` + - `root_dir` : + ```lua + util.root_pattern('robotidy.toml', 'pyproject.toml', 'conda.yaml', 'robot.yaml')(fname) + or util.find_git_ancestor(fname) + ``` + + +## roc_ls + +https://github.com/roc-lang/roc/tree/main/crates/language_server#roc_language_server + +The built-in language server for the Roc programming language. +[Installation](https://github.com/roc-lang/roc/tree/main/crates/language_server#installing) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.roc_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "roc_language_server" } + ``` + - `filetypes` : + ```lua + { "roc" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## rome + +https://rome.tools + +Language server for the Rome Frontend Toolchain. + +(Unmaintained, use [Biome](https://biomejs.dev/blog/annoucing-biome) instead.) + +```sh +npm install [-g] rome +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rome.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rome", "lsp-proxy" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "json", "typescript", "typescript.tsx", "typescriptreact" } + ``` + - `root_dir` : + ```lua + root_pattern('package.json', 'node_modules', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## rubocop + +https://github.com/rubocop/rubocop + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rubocop.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rubocop", "--lsp" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + + +## ruby_lsp + +https://shopify.github.io/ruby-lsp/ + +This gem is an implementation of the language server protocol specification for +Ruby, used to improve editor features. + +Install the gem. There's no need to require it, since the server is used as a +standalone executable. + +```sh +group :development do + gem "ruby-lsp", require: false +end +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ruby_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ruby-lsp" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `init_options` : + ```lua + { + formatter = "auto" + } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ruff + +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. + +```sh +pip install ruff +``` + +_Requires Ruff v0.3.3 or later._ + +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: + +1. Diagnostics +2. Code actions +3. Formatting +4. Range Formatting + +Please note that the `ruff-lsp` server will continue to be maintained until further notice. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ruff.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ruff", "server", "--preview" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ruff_lsp + +https://github.com/astral-sh/ruff-lsp + +A Language Server Protocol implementation for Ruff, an extremely fast Python linter and code transformation tool, written in Rust. It can be installed via pip. + +```sh +pip install ruff-lsp +``` + +Extra CLI arguments for `ruff` can be provided via + +```lua +require'lspconfig'.ruff_lsp.setup{ + init_options = { + settings = { + -- Any extra CLI arguments for `ruff` go here. + args = {}, + } + } +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ruff_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ruff-lsp" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## rune_languageserver + +https://crates.io/crates/rune-languageserver + +A language server for the [Rune](https://rune-rs.github.io/) Language, +an embeddable dynamic programming language for Rust + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rune_languageserver.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rune-languageserver" } + ``` + - `filetypes` : + ```lua + { "rune" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## rust_analyzer + +https://github.com/rust-lang/rust-analyzer + +rust-analyzer (aka rls 2.0), a language server for Rust + + +See [docs](https://github.com/rust-lang/rust-analyzer/blob/master/docs/user/generated_config.adoc) for extra settings. The settings can be used like this: +```lua +require'lspconfig'.rust_analyzer.setup{ + settings = { + ['rust-analyzer'] = { + diagnostics = { + enable = false; + } + } + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rust_analyzer.setup{} +``` +**Commands:** +- CargoReload: Reload current cargo workspace + +**Default values:** + - `capabilities` : + ```lua + { + experimental = { + serverStatusNotification = true + }, + general = { + positionEncodings = { "utf-16" } + }, + textDocument = { + callHierarchy = { + dynamicRegistration = false + }, + codeAction = { + codeActionLiteralSupport = { + codeActionKind = { + valueSet = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" } + } + }, + dataSupport = true, + dynamicRegistration = true, + isPreferredSupport = true, + resolveSupport = { + properties = { "edit" } + } + }, + completion = { + completionItem = { + commitCharactersSupport = false, + deprecatedSupport = false, + documentationFormat = { "markdown", "plaintext" }, + preselectSupport = false, + snippetSupport = false + }, + completionItemKind = { + valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 } + }, + completionList = { + itemDefaults = { "editRange", "insertTextFormat", "insertTextMode", "data" } + }, + contextSupport = false, + dynamicRegistration = false + }, + declaration = { + linkSupport = true + }, + definition = { + dynamicRegistration = true, + linkSupport = true + }, + diagnostic = { + dynamicRegistration = false + }, + documentHighlight = { + dynamicRegistration = false + }, + documentSymbol = { + dynamicRegistration = false, + hierarchicalDocumentSymbolSupport = true, + symbolKind = { + valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } + } + }, + formatting = { + dynamicRegistration = true + }, + hover = { + contentFormat = { "markdown", "plaintext" }, + dynamicRegistration = true + }, + implementation = { + linkSupport = true + }, + inlayHint = { + dynamicRegistration = true, + resolveSupport = { + properties = { "textEdits", "tooltip", "location", "command" } + } + }, + publishDiagnostics = { + dataSupport = true, + relatedInformation = true, + tagSupport = { + valueSet = { 1, 2 } + } + }, + rangeFormatting = { + dynamicRegistration = true + }, + references = { + dynamicRegistration = false + }, + rename = { + dynamicRegistration = true, + prepareSupport = true + }, + semanticTokens = { + augmentsSyntaxTokens = true, + dynamicRegistration = false, + formats = { "relative" }, + multilineTokenSupport = false, + overlappingTokenSupport = true, + requests = { + full = { + delta = true + }, + range = false + }, + serverCancelSupport = false, + tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary" }, + tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator" } + }, + signatureHelp = { + dynamicRegistration = false, + signatureInformation = { + activeParameterSupport = true, + documentationFormat = { "markdown", "plaintext" }, + parameterInformation = { + labelOffsetSupport = true + } + } + }, + synchronization = { + didSave = true, + dynamicRegistration = false, + willSave = true, + willSaveWaitUntil = true + }, + typeDefinition = { + linkSupport = true + } + }, + window = { + showDocument = { + support = true + }, + showMessage = { + messageActionItem = { + additionalPropertiesSupport = false + } + }, + workDoneProgress = true + }, + workspace = { + applyEdit = true, + configuration = true, + didChangeConfiguration = { + dynamicRegistration = false + }, + didChangeWatchedFiles = { + dynamicRegistration = false, + relativePatternSupport = true + }, + inlayHint = { + refreshSupport = true + }, + semanticTokens = { + refreshSupport = true + }, + symbol = { + dynamicRegistration = false, + symbolKind = { + valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } + } + }, + workspaceEdit = { + resourceOperations = { "rename", "create", "delete" } + }, + workspaceFolders = true + } + } + ``` + - `cmd` : + ```lua + { "rust-analyzer" } + ``` + - `filetypes` : + ```lua + { "rust" } + ``` + - `root_dir` : + ```lua + root_pattern("Cargo.toml", "rust-project.json") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## salt_ls + +Language server for Salt configuration files. +https://github.com/dcermak/salt-lsp + +The language server can be installed with `pip`: +```sh +pip install salt-lsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.salt_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "salt_lsp_server" } + ``` + - `filetypes` : + ```lua + { "sls" } + ``` + - `root_dir` : + ```lua + root_pattern('.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## scheme_langserver + +https://github.com/ufo5260987423/scheme-langserver +`scheme-langserver`, a language server protocol implementation for scheme. +And for nvim user, please add .sls to scheme file extension list. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.scheme_langserver.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "scheme-langserver" } + ``` + - `filetypes` : + ```lua + { "scheme" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## scry + +https://github.com/crystal-lang-tools/scry + +Crystal language server. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.scry.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "scry" } + ``` + - `filetypes` : + ```lua + { "crystal" } + ``` + - `root_dir` : + ```lua + root_pattern('shard.yml', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## serve_d + + https://github.com/Pure-D/serve-d + + `Microsoft language server protocol implementation for D using workspace-d.` + Download a binary from https://github.com/Pure-D/serve-d/releases and put it in your $PATH. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.serve_d.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "serve-d" } + ``` + - `filetypes` : + ```lua + { "d" } + ``` + - `root_dir` : + ```lua + util.root_pattern("dub.json", "dub.sdl", ".git") + ``` + + +## shopify_theme_ls + +https://shopify.dev/docs/api/shopify-cli + +[Language Server](https://shopify.dev/docs/themes/tools/cli/language-server) and Theme Check (linter) for Shopify themes. + +`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. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.shopify_theme_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "shopify", "theme", "language-server" } + ``` + - `filetypes` : + ```lua + { "liquid" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## sixtyfps + +https://github.com/sixtyfpsui/sixtyfps +`SixtyFPS`'s language server + +You can build and install `sixtyfps-lsp` binary with `cargo`: +```sh +cargo install sixtyfps-lsp +``` + +Vim does not have built-in syntax for the `sixtyfps` filetype currently. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.60 set filetype=sixtyfps ]] +``` + +or by installing a filetype plugin such as https://github.com/RustemB/sixtyfps-vim + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sixtyfps.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sixtyfps-lsp" } + ``` + - `filetypes` : + ```lua + { "sixtyfps" } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## slangd + +https://github.com/shader-slang/slang + +The `slangd` binary can be downloaded as part of [slang releases](https://github.com/shader-slang/slang/releases) or +by [building `slang` from source](https://github.com/shader-slang/slang/blob/master/docs/building.md). + +The server can be configured by passing a "settings" object to `slangd.setup{}`: + +```lua +require('lspconfig').slangd.setup{ + settings = { + slang = { + predefinedMacros = {"MY_VALUE_MACRO=1"}, + inlayHints = { + deducedTypes = true, + parameterNames = true, + } + } + } +} +``` +Available options are documented [here](https://github.com/shader-slang/slang-vscode-extension/tree/main?tab=readme-ov-file#configurations) +or in more detail [here](https://github.com/shader-slang/slang-vscode-extension/blob/main/package.json#L70). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.slangd.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "slangd" } + ``` + - `filetypes` : + ```lua + { "hlsl", "shaderslang" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## slint_lsp + +https://github.com/slint-ui/slint +`Slint`'s language server + +You can build and install `slint-lsp` binary with `cargo`: +```sh +cargo install slint-lsp +``` + +Vim does not have built-in syntax for the `slint` filetype at this time. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.slint set filetype=slint ]] +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.slint_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "slint-lsp" } + ``` + - `filetypes` : + ```lua + { "slint" } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## smarty_ls + +https://github.com/landeaux/vscode-smarty-langserver-extracted + +Language server for Smarty. + +`smarty-language-server` can be installed via `npm`: + +```sh +npm i -g vscode-smarty-langserver-extracted +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.smarty_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "smarty-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "smarty" } + ``` + - `init_options` : + ```lua + {} + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + css = { + validate = true + }, + smarty = { + pluginDirs = {} + } + } + ``` + + +## smithy_ls + +https://github.com/awslabs/smithy-language-server + +`Smithy Language Server`, A Language Server Protocol implementation for the Smithy IDL + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.smithy_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "smithy-language-server", "0" } + ``` + - `filetypes` : + ```lua + { "smithy" } + ``` + - `root_dir` : + ```lua + root_pattern("smithy-build.json", "build.gradle", "build.gradle.kts", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## snyk_ls + +https://github.com/snyk/snyk-ls + +LSP for Snyk Open Source, Snyk Infrastructure as Code, and Snyk Code. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.snyk_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "snyk-ls" } + ``` + - `filetypes` : + ```lua + { "go", "gomod", "javascript", "typescript", "json", "python", "requirements", "helm", "yaml", "terraform", "terraform-vars" } + ``` + - `init_options` : + ```lua + Configuration from https://github.com/snyk/snyk-ls#configuration-1 + ``` + - `root_dir` : + ```lua + root_pattern(".git", ".snyk") + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## solang + +A language server for Solidity + +See the [documentation](https://solang.readthedocs.io/en/latest/installing.html) for installation instructions. + +The language server only provides the following capabilities: +* Syntax highlighting +* Diagnostics +* Hover + +There is currently no support for completion, goto definition, references, or other functionality. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solang.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solang", "language-server", "--target", "evm" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## solargraph + +https://solargraph.org/ + +solargraph, a language server for Ruby + +You can install solargraph via gem install. + +```sh +gem install --user-install solargraph +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solargraph.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solargraph", "stdio" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `init_options` : + ```lua + { + formatting = true + } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + - `settings` : + ```lua + { + solargraph = { + diagnostics = true + } + } + ``` + + +## solc + +https://docs.soliditylang.org/en/latest/installing-solidity.html + +solc is the native language server for the Solidity language. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solc.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solc", "--lsp" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + root_pattern('hardhat.config.*', '.git') + ``` + + +## solidity + +https://github.com/qiuxiang/solidity-ls + +npm i solidity-ls -g + +Make sure that solc is installed and it's the same version of the file. solc-select is recommended. + +Solidity language server is a LSP with autocomplete, go to definition and diagnostics. + +If you use brownie, use this root_dir: +root_dir = util.root_pattern('brownie-config.yaml', '.git') + +on includePath, you can add an extra path to search for external libs, on remapping you can remap lib <> path, like: + +```lua +{ solidity = { includePath = '/Users/your_user/.brownie/packages/', remapping = { ["@OpenZeppelin/"] = 'OpenZeppelin/openzeppelin-contracts@4.6.0/' } } } +``` + +**For brownie users** +Change the root_dir to: + +```lua +root_pattern("brownie-config.yaml", ".git") +``` + +The best way of using it is to have a package.json in your project folder with the packages that you will use. +After installing with package.json, just create a `remappings.txt` with: + +``` +@OpenZeppelin/=node_modules/OpenZeppelin/openzeppelin-contracts@4.6.0/ +``` + +You can omit the node_modules as well. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solidity.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solidity-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") + ``` + - `settings` : + ```lua + { + solidity = { + includePath = "", + remapping = {} + } + } + ``` + + +## solidity_ls + +https://github.com/juanfranblanco/vscode-solidity + +`vscode-solidity-server` can be installed via `npm`: + +```sh +npm install -g vscode-solidity-server +``` + +`vscode-solidity-server` is a language server for the Solidity language ported from the VSCode "solidity" extension. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solidity_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vscode-solidity-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + root_pattern("hardhat.config.js", "hardhat.config.ts", "foundry.toml", "remappings.txt", "truffle.js", "truffle-config.js", "ape-config.yaml", ".git", "package.json") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## solidity_ls_nomicfoundation + +https://github.com/NomicFoundation/hardhat-vscode/blob/development/server/README.md + +`nomicfoundation-solidity-language-server` can be installed via `npm`: + +```sh +npm install -g @nomicfoundation/solidity-language-server +``` + +A language server for the Solidity programming language, built by the Nomic Foundation for the Ethereum community. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solidity_ls_nomicfoundation.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nomicfoundation-solidity-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + root_pattern("hardhat.config.js", "hardhat.config.ts", "foundry.toml", "remappings.txt", "truffle.js", "truffle-config.js", "ape-config.yaml", ".git", "package.json") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## somesass_ls + + +https://github.com/wkillerud/some-sass/tree/main/packages/language-server + +`some-sass-language-server` can be installed via `npm`: + +```sh +npm i -g some-sass-language-server +``` + +The language server provides: + +- Full support for @use and @forward, including aliases, prefixes and hiding. +- Workspace-wide code navigation and refactoring, such as Rename Symbol. +- Rich documentation through SassDoc. +- Language features for %placeholder-selectors, both when using them and writing them. +- Suggestions and hover info for built-in Sass modules, when used with @use. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.somesass_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "some-sass-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "scss", "sass" } + ``` + - `name` : + ```lua + "somesass_ls" + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") or bufdir + ``` + - `settings` : + ```lua + { + somesass = { + suggestAllFromOpenDocument = true + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## sorbet + +https://sorbet.org + +Sorbet is a fast, powerful type checker designed for Ruby. + +You can install Sorbet via gem install. You might also be interested in how to set +Sorbet up for new projects: https://sorbet.org/docs/adopting. + +```sh +gem install sorbet +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sorbet.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "srb", "tc", "--lsp" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + + +## sourcekit + +https://github.com/apple/sourcekit-lsp + +Language server for Swift and C/C++/Objective-C. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sourcekit.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sourcekit-lsp" } + ``` + - `filetypes` : + ```lua + { "swift", "c", "cpp", "objective-c", "objective-cpp" } + ``` + - `root_dir` : + ```lua + root_pattern("buildServer.json", "*.xcodeproj", "*.xcworkspace", ".git", "compile_commands.json", "Package.swift") + ``` + + +## sourcery + +https://github.com/sourcery-ai/sourcery + +Refactor Python instantly using the power of AI. + +It requires the init_options param to be populated as shown below and will respond with the list of ServerCapabilities that it supports: + +```lua +require'lspconfig'.sourcery.setup { + init_options = { + --- The Sourcery token for authenticating the user. + --- This is retrieved from the Sourcery website and must be + --- provided by each user. The extension must provide a + --- configuration option for the user to provide this value. + token = <YOUR_TOKEN>, + + --- The extension's name and version as defined by the extension. + extension_version = 'vim.lsp', + + --- The editor's name and version as defined by the editor. + editor_version = 'vim', + }, +} +``` + +Alternatively, you can login to sourcery by running `sourcery login` with sourcery-cli. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sourcery.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sourcery", "lsp" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "python", "typescript", "typescriptreact" } + ``` + - `init_options` : + ```lua + { + editor_version = "vim", + extension_version = "vim.lsp" + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## spectral + +https://github.com/luizcorreia/spectral-language-server + `A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v2 & v3.` + +`spectral-language-server` can be installed via `npm`: +```sh +npm i -g spectral-language-server +``` +See [vscode-spectral](https://github.com/stoplightio/vscode-spectral#extension-settings) for configuration options. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.spectral.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "spectral-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml", "json", "yml" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + enable = true, + run = "onType", + validateLanguages = { "yaml", "json", "yml" } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## spyglassmc_language_server + +https://github.com/SpyglassMC/Spyglass/tree/main/packages/language-server + +Language server for Minecraft datapacks. + +`spyglassmc-language-server` can be installed via `npm`: + +```sh +npm i -g @spyglassmc/language-server +``` + +You may also need to configure the filetype: + +`autocmd BufNewFile,BufRead *.mcfunction set filetype=mcfunction` + +This is automatically done by [CrystalAlpha358/vim-mcfunction](https://github.com/CrystalAlpha358/vim-mcfunction), which also provide syntax highlight. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.spyglassmc_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "spyglassmc-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "mcfunction" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## sqlls + +https://github.com/joe-re/sql-language-server + +This LSP can be installed via `npm`. Find further instructions on manual installation of the sql-language-server at [joe-re/sql-language-server](https://github.com/joe-re/sql-language-server). +<br> + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sqlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sql-language-server", "up", "--method", "stdio" } + ``` + - `filetypes` : + ```lua + { "sql", "mysql" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## sqls + +https://github.com/sqls-server/sqls + +```lua +require'lspconfig'.sqls.setup{ + cmd = {"path/to/command", "-config", "path/to/config.yml"}; + ... +} +``` +Sqls can be installed via `go get github.com/sqls-server/sqls`. Instructions for compiling Sqls from the source can be found at [sqls-server/sqls](https://github.com/sqls-server/sqls). + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sqls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sqls" } + ``` + - `filetypes` : + ```lua + { "sql", "mysql" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## standardrb + +https://github.com/testdouble/standard + +Ruby Style Guide, with linter & automatic code fixer. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.standardrb.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "standardrb", "--lsp" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + + +## starlark_rust + +https://github.com/facebookexperimental/starlark-rust/ +The LSP part of `starlark-rust` is not currently documented, + but the implementation works well for linting. +This gives valuable warnings for potential issues in the code, +but does not support refactorings. + +It can be installed with cargo: https://crates.io/crates/starlark + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.starlark_rust.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "starlark", "--lsp" } + ``` + - `filetypes` : + ```lua + { "star", "bzl", "BUILD.bazel" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## starpls + +https://github.com/withered-magic/starpls + +`starpls` is an LSP implementation for Starlark. Installation instructions can be found in the project's README. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.starpls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "starpls" } + ``` + - `filetypes` : + ```lua + { "bzl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## statix + +https://github.com/nerdypepper/statix + +lints and suggestions for the nix programming language + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.statix.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "statix" } + ``` + - `filetypes` : + ```lua + { "nix" } + ``` + - `root_dir` : + ```lua + root_pattern("flake.nix", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## steep + +https://github.com/soutaro/steep + +`steep` is a static type checker for Ruby. + +You need `Steepfile` to make it work. Generate it with `steep init`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.steep.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "steep", "langserver" } + ``` + - `filetypes` : + ```lua + { "ruby", "eruby" } + ``` + - `root_dir` : + ```lua + root_pattern("Steepfile", ".git") + ``` + + +## stimulus_ls + +https://www.npmjs.com/package/stimulus-language-server + +`stimulus-lsp` can be installed via `npm`: + +```sh +npm install -g stimulus-language-server +``` + +or via `yarn`: + +```sh +yarn global add stimulus-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.stimulus_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "stimulus-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "html", "ruby", "eruby", "blade", "php" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## stylelint_lsp + +https://github.com/bmatcuk/stylelint-lsp + +`stylelint-lsp` can be installed via `npm`: + +```sh +npm i -g stylelint-lsp +``` + +Can be configured by passing a `settings.stylelintplus` object to `stylelint_lsp.setup`: + +```lua +require'lspconfig'.stylelint_lsp.setup{ + settings = { + stylelintplus = { + -- see available options in stylelint-lsp documentation + } + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.stylelint_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "stylelint-lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "css", "less", "scss", "sugarss", "vue", "wxss", "javascript", "javascriptreact", "typescript", "typescriptreact" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## svelte + +https://github.com/sveltejs/language-tools/tree/master/packages/language-server + +Note: assuming that [tsserver](#tsserver) is setup, full JavaScript/TypeScript support (find references, rename, etc of symbols in Svelte files when working in JS/TS files) requires per-project installation and configuration of [typescript-svelte-plugin](https://github.com/sveltejs/language-tools/tree/master/packages/typescript-plugin#usage). + +`svelte-language-server` can be installed via `npm`: +```sh +npm install -g svelte-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.svelte.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "svelteserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "svelte" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") + ``` + + +## svlangserver + +https://github.com/imc-trading/svlangserver + +Language server for SystemVerilog. + +`svlangserver` can be installed via `npm`: + +```sh +$ npm install -g @imc-trading/svlangserver +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.svlangserver.setup{} +``` +**Commands:** +- SvlangserverBuildIndex: Instructs language server to rerun indexing +- SvlangserverReportHierarchy: Generates hierarchy for the given module + +**Default values:** + - `cmd` : + ```lua + { "svlangserver" } + ``` + - `filetypes` : + ```lua + { "verilog", "systemverilog" } + ``` + - `root_dir` : + ```lua + root_pattern(".svlangserver", ".git") + ``` + - `settings` : + ```lua + { + systemverilog = { + includeIndexing = { "*.{v,vh,sv,svh}", "**/*.{v,vh,sv,svh}" } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## svls + +https://github.com/dalance/svls + +Language server for verilog and SystemVerilog + +`svls` can be installed via `cargo`: + ```sh + cargo install svls + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.svls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "svls" } + ``` + - `filetypes` : + ```lua + { "verilog", "systemverilog" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## swift_mesonls + +https://github.com/JCWasmx86/Swift-MesonLSP + +Meson language server written in Swift + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.swift_mesonls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "Swift-MesonLSP", "--lsp" } + ``` + - `filetypes` : + ```lua + { "meson" } + ``` + - `root_dir` : + ```lua + util.root_pattern("meson_options.txt", "meson.options", ".git") + ``` + + +## syntax_tree + +https://ruby-syntax-tree.github.io/syntax_tree/ + +A fast Ruby parser and formatter. + +Syntax Tree is a suite of tools built on top of the internal CRuby parser. It +provides the ability to generate a syntax tree from source, as well as the +tools necessary to inspect and manipulate that syntax tree. It can be used to +build formatters, linters, language servers, and more. + +```sh +gem install syntax_tree +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.syntax_tree.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "stree", "lsp" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `root_dir` : + ```lua + root_pattern(".streerc", "Gemfile", ".git") + ``` + + +## tabby_ml + +https://tabby.tabbyml.com/blog/running-tabby-as-a-language-server + +Language server for Tabby, an opensource, self-hosted AI coding assistant. + +`tabby-agent` can be installed via `npm`: + +```sh +npm install --global tabby-agent +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tabby_ml.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tabby-agent", "--lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + {} + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## tailwindcss + +https://github.com/tailwindlabs/tailwindcss-intellisense + +Tailwind CSS Language Server can be installed via npm: +```sh +npm install -g @tailwindcss/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tailwindcss.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tailwindcss-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "aspnetcorerazor", "astro", "astro-markdown", "blade", "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" + } + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern('tailwind.config.js', 'tailwind.config.cjs', 'tailwind.config.mjs', 'tailwind.config.ts', 'postcss.config.js', 'postcss.config.cjs', 'postcss.config.mjs', 'postcss.config.ts', 'package.json', 'node_modules', '.git') + ``` + - `settings` : + ```lua + { + tailwindCSS = { + classAttributes = { "class", "className", "class:list", "classList", "ngClass" }, + lint = { + cssConflict = "warning", + invalidApply = "error", + invalidConfigPath = "error", + invalidScreen = "error", + invalidTailwindDirective = "error", + invalidVariant = "error", + recommendedVariantOrder = "warning" + }, + validate = true + } + } + ``` + + +## taplo + +https://taplo.tamasfe.dev/cli/usage/language-server.html + +Language server for Taplo, a TOML toolkit. + +`taplo-cli` can be installed via `cargo`: +```sh +cargo install --features lsp --locked taplo-cli +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.taplo.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "taplo", "lsp", "stdio" } + ``` + - `filetypes` : + ```lua + { "toml" } + ``` + - `root_dir` : + ```lua + root_pattern("*.toml", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## tblgen_lsp_server + +https://mlir.llvm.org/docs/Tools/MLIRLSP/#tablegen-lsp-language-server--tblgen-lsp-server + +The Language Server for the LLVM TableGen language + +`tblgen-lsp-server` can be installed at the llvm-project repository (https://github.com/llvm/llvm-project) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tblgen_lsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tblgen-lsp-server" } + ``` + - `filetypes` : + ```lua + { "tablegen" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## teal_ls + +https://github.com/teal-language/teal-language-server + +Install with: +``` +luarocks install --dev teal-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.teal_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "teal-language-server" } + ``` + - `filetypes` : + ```lua + { "teal" } + ``` + - `root_dir` : + ```lua + root_pattern("tlconfig.lua", ".git") + ``` + + +## templ + +https://templ.guide + +The official language server for the templ HTML templating language. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.templ.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "templ", "lsp" } + ``` + - `filetypes` : + ```lua + { "templ" } + ``` + - `root_dir` : + ```lua + root_pattern('go.work', 'go.mod', '.git') + ``` + + +## terraform_lsp + +https://github.com/juliosueiras/terraform-lsp + +Terraform language server +Download a released binary from +https://github.com/juliosueiras/terraform-lsp/releases. + +From https://github.com/hashicorp/terraform-ls#terraform-ls-vs-terraform-lsp: + +Both HashiCorp and the maintainer of terraform-lsp expressed interest in +collaborating on a language server and are working towards a _long-term_ +goal of a single stable and feature-complete implementation. + +For the time being both projects continue to exist, giving users the +choice: + +- `terraform-ls` providing + - overall stability (by relying only on public APIs) + - compatibility with any provider and any Terraform >=0.12.0 currently + less features + - due to project being younger and relying on public APIs which may + not offer the same functionality yet + +- `terraform-lsp` providing + - currently more features + - compatibility with a single particular Terraform (0.12.20 at time of writing) + - configs designed for other 0.12 versions may work, but interpretation may be inaccurate + - less stability (due to reliance on Terraform's own internal packages) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.terraform_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "terraform-lsp" } + ``` + - `filetypes` : + ```lua + { "terraform", "hcl" } + ``` + - `root_dir` : + ```lua + root_pattern(".terraform", ".git") + ``` + + +## terraformls + +https://github.com/hashicorp/terraform-ls + +Terraform language server +Download a released binary from https://github.com/hashicorp/terraform-ls/releases. + +From https://github.com/hashicorp/terraform-ls#terraform-ls-vs-terraform-lsp: + +Both HashiCorp and the maintainer of terraform-lsp expressed interest in +collaborating on a language server and are working towards a _long-term_ +goal of a single stable and feature-complete implementation. + +For the time being both projects continue to exist, giving users the +choice: + +- `terraform-ls` providing + - overall stability (by relying only on public APIs) + - compatibility with any provider and any Terraform >=0.12.0 currently + less features + - due to project being younger and relying on public APIs which may + not offer the same functionality yet + +- `terraform-lsp` providing + - currently more features + - compatibility with a single particular Terraform (0.12.20 at time of writing) + - configs designed for other 0.12 versions may work, but interpretation may be inaccurate + - less stability (due to reliance on Terraform's own internal packages) + +Note, that the `settings` configuration option uses the `workspace/didChangeConfiguration` event, +[which is not supported by terraform-ls](https://github.com/hashicorp/terraform-ls/blob/main/docs/features.md). +Instead you should use `init_options` which passes the settings as part of the LSP initialize call +[as is required by terraform-ls](https://github.com/hashicorp/terraform-ls/blob/main/docs/SETTINGS.md#how-to-pass-settings). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.terraformls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "terraform-ls", "serve" } + ``` + - `filetypes` : + ```lua + { "terraform", "terraform-vars" } + ``` + - `root_dir` : + ```lua + root_pattern(".terraform", ".git") + ``` + + +## texlab + +https://github.com/latex-lsp/texlab + +A completion engine built from scratch for (La)TeX. + +See https://github.com/latex-lsp/texlab/wiki/Configuration for configuration options. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.texlab.setup{} +``` +**Commands:** +- TexlabBuild: Build the current buffer +- TexlabForward: Forward search from current position + +**Default values:** + - `cmd` : + ```lua + { "texlab" } + ``` + - `filetypes` : + ```lua + { "tex", "plaintex", "bib" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + texlab = { + auxDirectory = ".", + bibtexFormatter = "texlab", + build = { + args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" }, + executable = "latexmk", + forwardSearchAfter = false, + onSave = false + }, + chktex = { + onEdit = false, + onOpenAndSave = false + }, + diagnosticsDelay = 300, + formatterLineLength = 80, + forwardSearch = { + args = {} + }, + latexFormatter = "latexindent", + latexindent = { + modifyLineBreaks = false + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## textlsp + +https://github.com/hangyav/textLSP + +`textLSP` is an LSP server for text spell and grammar checking with various AI tools. +It supports multiple text file formats, such as LaTeX, Org or txt. + +For the available text analyzer tools and their configuration, see the [GitHub](https://github.com/hangyav/textLSP) page. +By default, all analyzers are disabled in textLSP, since most of them need special settings. +For quick testing, LanguageTool is enabled in the default `nvim-lspconfig` configuration. + +To install run: `pip install textLSP` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.textlsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "textlsp" } + ``` + - `filetypes` : + ```lua + { "text", "tex", "org" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + textLSP = { + analysers = { + languagetool = { + check_text = { + on_change = false, + on_open = true, + on_save = true + }, + enabled = true + } + }, + documents = { + org = { + org_todo_keywords = { "TODO", "IN_PROGRESS", "DONE" } + } + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## tflint + +https://github.com/terraform-linters/tflint + +A pluggable Terraform linter that can act as lsp server. +Installation instructions can be found in https://github.com/terraform-linters/tflint#installation. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tflint.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tflint", "--langserver" } + ``` + - `filetypes` : + ```lua + { "terraform" } + ``` + - `root_dir` : + ```lua + root_pattern(".terraform", ".git", ".tflint.hcl") + ``` + + +## theme_check + +https://github.com/Shopify/shopify-cli + +`theme-check-language-server` is bundled with `shopify-cli` or it can also be installed via + +https://github.com/Shopify/theme-check#installation + +**NOTE:** +If installed via Homebrew, `cmd` must be set to 'theme-check-liquid-server' + +```lua +require lspconfig.theme_check.setup { + cmd = { 'theme-check-liquid-server' } +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.theme_check.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "theme-check-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "liquid" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## thriftls + +https://github.com/joyme123/thrift-ls + +you can install thriftls by mason or download binary here: https://github.com/joyme123/thrift-ls/releases + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.thriftls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "thriftls" } + ``` + - `filetypes` : + ```lua + { "thrift" } + ``` + - `root_dir` : + ```lua + root_pattern(".thrift") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## tilt_ls + +https://github.com/tilt-dev/tilt + +Tilt language server. + +You might need to add filetype detection manually: + +```vim +autocmd BufRead Tiltfile setf=tiltfile +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tilt_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tilt", "lsp", "start" } + ``` + - `filetypes` : + ```lua + { "tiltfile" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## tinymist + +https://github.com/Myriad-Dreamin/tinymist +An integrated language service for Typst [taɪpst]. You can also call it "微霭" [wēi ǎi] in Chinese. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tinymist.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tinymist" } + ``` + - `filetypes` : + ```lua + { "typst" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + false + ``` + + +## tsp_server + +https://github.com/microsoft/typespec + +The language server for TypeSpec, a language for defining cloud service APIs and shapes. + +`tsp-server` can be installed together with the typespec compiler via `npm`: +```sh +npm install -g @typespec/compiler +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tsp-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "typespec" } + ``` + - `root_dir` : + ```lua + util.root_pattern("tspconfig.yaml", ".git") + ``` + + +## tsserver + +https://github.com/typescript-language-server/typescript-language-server + +`typescript-language-server` depends on `typescript`. Both packages can be installed via `npm`: +```sh +npm install -g typescript typescript-language-server +``` + +To configure typescript language server, add a +[`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or +[`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to the root of your +project. + +Here's an example that disables type checking in JavaScript files. + +```json +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "checkJs": false + }, + "exclude": [ + "node_modules" + ] +} +``` + +### Vue support + +As of 2.0.0, Volar no longer supports TypeScript itself. Instead, a plugin +adds Vue support to this language server. + +*IMPORTANT*: It is crucial to ensure that `@vue/typescript-plugin` and `volar `are of identical versions. + +```lua +require'lspconfig'.tsserver.setup{ + init_options = { + plugins = { + { + name = "@vue/typescript-plugin", + location = "/usr/local/lib/node_modules/@vue/typescript-plugin", + languages = {"javascript", "typescript", "vue"}, + }, + }, + }, + filetypes = { + "javascript", + "typescript", + "vue", + }, +} + +-- You must make sure volar is setup +-- e.g. require'lspconfig'.volar.setup{} +-- See volar's section for more information +``` + +`location` MUST be defined. If the plugin is installed in `node_modules`, +`location` can have any value. + +`languages` must include `vue` even if it is listed in `filetypes`. + +`filetypes` is extended here to include Vue SFC. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tsserver.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "typescript-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" } + ``` + - `init_options` : + ```lua + { + hostInfo = "neovim" + } + ``` + - `root_dir` : + ```lua + root_pattern("tsconfig.json", "package.json", "jsconfig.json", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ttags + +https://github.com/npezza93/ttags + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ttags.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ttags", "lsp" } + ``` + - `filetypes` : + ```lua + { "ruby", "rust", "javascript", "haskell" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## turtle_ls + +https://github.com/stardog-union/stardog-language-servers/tree/master/packages/turtle-language-server +`turtle-language-server`, An editor-agnostic server providing language intelligence (diagnostics, hover tooltips, etc.) for the W3C standard Turtle RDF syntax via the Language Server Protocol. +installable via npm install -g turtle-language-server or yarn global add turtle-language-server. +requires node. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.turtle_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "node", + [3] = "--stdio" + } + ``` + - `filetypes` : + ```lua + { "turtle", "ttl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## twiggy_language_server + +https://github.com/moetelo/twiggy + +`twiggy-language-server` can be installed via `npm`: +```sh +npm install -g twiggy-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.twiggy_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "twiggy-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "twig" } + ``` + - `root_dir` : + ```lua + root_pattern("composer.json", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## typeprof + +https://github.com/ruby/typeprof + +`typeprof` is the built-in analysis and LSP tool for Ruby 3.1+. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.typeprof.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "typeprof", "--lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "ruby", "eruby" } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + + +## typos_lsp + +https://github.com/crate-ci/typos +https://github.com/tekumara/typos-lsp + +A Language Server Protocol implementation for Typos, a low false-positive +source code spell checker, written in Rust. Download it from the releases page +on GitHub: https://github.com/tekumara/typos-lsp/releases + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.typos_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "typos-lsp" } + ``` + - `filetypes` : + ```lua + { "*" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## typst_lsp + +https://github.com/nvarner/typst-lsp + +Language server for Typst. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.typst_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "typst-lsp" } + ``` + - `filetypes` : + ```lua + { "typst" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## uiua + +https://github.com/uiua-lang/uiua/ + +The builtin language server of the Uiua interpreter. + +The Uiua interpreter can be installed with `cargo install uiua` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.uiua.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "uiua", "lsp" } + ``` + - `filetypes` : + ```lua + { "uiua" } + ``` + - `root_dir` : + ```lua + root_pattern( + 'main.ua', + 'fmt.ua', + '.git' + ) + + ``` + + +## unison + +https://github.com/unisonweb/unison/blob/trunk/docs/language-server.markdown + + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.unison.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nc", "localhost", "5757" } + ``` + - `filetypes` : + ```lua + { "unison" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## unocss + +https://github.com/xna00/unocss-language-server + +UnoCSS Language Server can be installed via npm: +```sh +npm i unocss-language-server -g +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.unocss.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "unocss-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "html", "javascriptreact", "rescript", "typescriptreact", "vue", "svelte" } + ``` + - `root_dir` : + ```lua + root_pattern('unocss.config.js', 'unocss.config.ts', 'uno.config.js', 'uno.config.ts') + ``` + + +## uvls + +https://codeberg.org/caradhras/uvls +Language server for UVL, written using tree sitter and rust. +You can install the server easily using cargo: +```sh +git clone https://codeberg.org/caradhras/uvls +cd uvls +cargo install --path . +``` +Note: To activate properly nvim needs to know the uvl filetype. +You can add it via: +```lua +vim.cmd(\[\[au BufRead,BufNewFile *.uvl setfiletype uvl\]\]) +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.uvls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "uvls" } + ``` + - `filetypes` : + ```lua + { "uvl" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## v_analyzer + +https://github.com/v-analyzer/v-analyzer + +V language server. + +`v-analyzer` can be installed by following the instructions [here](https://github.com/v-analyzer/v-analyzer#installation). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.v_analyzer.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "v-analyzer" } + ``` + - `filetypes` : + ```lua + { "v", "vsh", "vv" } + ``` + - `root_dir` : + ```lua + root_pattern("v.mod", ".git") + ``` + + +## vacuum + +Vacuum is the worlds fastest OpenAPI 3, OpenAPI 2 / Swagger linter and quality analysis tool. + +You can install vacuum using mason or follow the instructions here: https://github.com/daveshanley/vacuum + +The file types are not detected automatically, you can register them manually (see below) or override the filetypes: + +```lua +vim.filetype.add { + pattern = { + ['openapi.*%.ya?ml'] = 'yaml.openapi', + ['openapi.*%.json'] = 'json.openapi', + }, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vacuum.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vacuum", "language-server" } + ``` + - `filetypes` : + ```lua + { "yaml.openapi", "json.openapi" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## vala_ls + +https://github.com/Prince781/vala-language-server + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vala_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vala-language-server" } + ``` + - `filetypes` : + ```lua + { "vala", "genie" } + ``` + - `root_dir` : + ```lua + root_pattern("meson.build", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## vale_ls + +https://github.com/errata-ai/vale-ls + +An implementation of the Language Server Protocol (LSP) for the Vale command-line tool. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vale_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vale-ls" } + ``` + - `filetypes` : + ```lua + { "markdown", "text", "tex" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## vdmj + +https://github.com/nickbattle/vdmj + +The VDMJ language server can be installed by cloning the VDMJ repository and +running `mvn clean install`. + +Various options are provided to configure the language server (see below). In +particular: +- `annotation_paths` is a list of folders and/or jar file paths for annotations +that should be used with the language server; +- any value of `debugger_port` less than zero will disable the debugger; note +that if a non-zero value is used, only one instance of the server can be active +at a time. + +More settings for VDMJ can be changed in a file called `vdmj.properties` under +`root_dir/.vscode`. For a description of the available settings, see +[Section 7 of the VDMJ User Guide](https://raw.githubusercontent.com/nickbattle/vdmj/master/vdmj/documentation/UserGuide.pdf). + +Note: proof obligations and combinatorial testing are not currently supported +by neovim. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vdmj.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + Generated from the options given + ``` + - `filetypes` : + ```lua + { "vdmsl", "vdmpp", "vdmrt" } + ``` + - `options` : + ```lua + { + annotation_paths = {}, + debugger_port = -1, + high_precision = false, + java = "$JAVA_HOME/bin/java", + java_opts = { "-Xmx3000m", "-Xss1m" }, + logfile = "path.join(vim.fn.stdpath 'cache', 'vdm-lsp.log')", + mavenrepo = "$HOME/.m2/repository/dk/au/ece/vdmj", + version = "The latest version installed in `mavenrepo`" + } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor(fname) or find_vscode_ancestor(fname) + ``` + + +## verible + +https://github.com/chipsalliance/verible + +A linter and formatter for verilog and SystemVerilog files. + +Release binaries can be downloaded from [here](https://github.com/chipsalliance/verible/releases) +and placed in a directory on PATH. + +See https://github.com/chipsalliance/verible/tree/master/verilog/tools/ls/README.md for options. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.verible.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "verible-verilog-ls" } + ``` + - `filetypes` : + ```lua + { "systemverilog", "verilog" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## veridian + +https://github.com/vivekmalneedi/veridian + +A SystemVerilog LanguageServer. + +Download the latest release for your OS from the releases page + +# install with slang feature, if C++17 compiler is available +cargo install --git https://github.com/vivekmalneedi/veridian.git --all-features +# install if C++17 compiler is not available +cargo install --git https://github.com/vivekmalneedi/veridian.git + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.veridian.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "veridian" } + ``` + - `filetypes` : + ```lua + { "systemverilog", "verilog" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## veryl_ls + +https://github.com/veryl-lang/veryl + +Language server for Veryl + +`veryl-ls` can be installed via `cargo`: + ```sh + cargo install veryl-ls + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.veryl_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "veryl-ls" } + ``` + - `filetypes` : + ```lua + { "veryl" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## vhdl_ls + +Install vhdl_ls from https://github.com/VHDL-LS/rust_hdl and add it to path + +Configuration + +The language server needs to know your library mapping to perform full analysis of the code. For this it uses a configuration file in the TOML format named vhdl_ls.toml. + +vhdl_ls will load configuration files in the following order of priority (first to last): + + A file named .vhdl_ls.toml in the user home folder. + A file name from the VHDL_LS_CONFIG environment variable. + A file named vhdl_ls.toml in the workspace root. + +Settings in a later files overwrites those from previously loaded files. + +Example vhdl_ls.toml +``` +# File names are either absolute or relative to the parent folder of the vhdl_ls.toml file +[libraries] +lib2.files = [ + 'pkg2.vhd', +] +lib1.files = [ + 'pkg1.vhd', + 'tb_ent.vhd' +] +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vhdl_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vhdl_ls" } + ``` + - `filetypes` : + ```lua + { "vhd", "vhdl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## vimls + +https://github.com/iamcco/vim-language-server + +You can install vim-language-server via npm: +```sh +npm install -g vim-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vimls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vim-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "vim" } + ``` + - `init_options` : + ```lua + { + diagnostic = { + enable = true + }, + indexes = { + count = 3, + gap = 100, + projectRootPatterns = { "runtime", "nvim", ".git", "autoload", "plugin" }, + runtimepath = true + }, + isNeovim = true, + iskeyword = "@,48-57,_,192-255,-#", + runtimepath = "", + suggest = { + fromRuntimepath = true, + fromVimruntime = true + }, + vimruntime = "" + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## visualforce_ls + +https://github.com/forcedotcom/salesforcedx-vscode + +Language server for Visualforce. + +For manual installation, download the .vsix archive file from the +[forcedotcom/salesforcedx-vscode](https://github.com/forcedotcom/salesforcedx-vscode) +GitHub releases. Then, configure `cmd` to run the Node script at the unpacked location: + +```lua +require'lspconfig'.visualforce_ls.setup { + cmd = { + 'node', + '/path/to/unpacked/archive/extension/node_modules/@salesforce/salesforcedx-visualforce-language-server/out/src/visualforceServer.js', + '--stdio' + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.visualforce_ls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "visualforce" } + ``` + - `init_options` : + ```lua + { + embeddedLanguages = { + css = true, + javascript = true + } + } + ``` + - `root_dir` : + ```lua + root_pattern('sfdx-project.json') + ``` + + +## vls + +https://github.com/vlang/vls + +V language server. + +`v-language-server` can be installed by following the instructions [here](https://github.com/vlang/vls#installation). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "v", "ls" } + ``` + - `filetypes` : + ```lua + { "v", "vlang" } + ``` + - `root_dir` : + ```lua + root_pattern("v.mod", ".git") + ``` + + +## volar + +https://github.com/johnsoncodehk/volar/tree/20d713b/packages/vue-language-server + +Volar language server for Vue + +Volar can be installed via npm: + +```sh +npm install -g @vue/language-server +``` + +Volar by default supports Vue 3 projects. Vue 2 projects need +[additional configuration](https://github.com/vuejs/language-tools/tree/master/packages/vscode-vue#usage). + +**TypeScript support** +As of release 2.0.0, Volar no longer wraps around tsserver. For typescript +support, `tsserver` needs to be configured with the `@vue/typescript-plugin` +plugin. + +**Take Over Mode** + +Volar (prior to 2.0.0), can serve as a language server for both Vue and TypeScript via [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471). + +To enable Take Over Mode, override the default filetypes in `setup{}` as follows: + +```lua +require'lspconfig'.volar.setup{ + filetypes = {'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue', 'json'} +} +``` + +**Overriding the default TypeScript Server used by Volar** + +The default config looks for TS in the local `node_modules`. This can lead to issues +e.g. when working on a [monorepo](https://monorepo.tools/). The alternatives are: + +- use a global TypeScript Server installation + +```lua +require'lspconfig'.volar.setup{ + init_options = { + typescript = { + tsdk = '/path/to/.npm/lib/node_modules/typescript/lib' + -- Alternative location if installed as root: + -- tsdk = '/usr/local/lib/node_modules/typescript/lib' + } + } +} +``` + +- use a local server and fall back to a global TypeScript Server installation + +```lua +local util = require 'lspconfig.util' +local function get_typescript_server_path(root_dir) + + local global_ts = '/home/[yourusernamehere]/.npm/lib/node_modules/typescript/lib' + -- Alternative location if installed as root: + -- local global_ts = '/usr/local/lib/node_modules/typescript/lib' + local found_ts = '' + local function check_dir(path) + found_ts = util.path.join(path, 'node_modules', 'typescript', 'lib') + if util.path.exists(found_ts) then + return path + end + end + if util.search_ancestors(root_dir, check_dir) then + return found_ts + else + return global_ts + end +end + +require'lspconfig'.volar.setup{ + on_new_config = function(new_config, new_root_dir) + new_config.init_options.typescript.tsdk = get_typescript_server_path(new_root_dir) + end, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.volar.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vue-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "vue" } + ``` + - `init_options` : + ```lua + { + typescript = { + tsdk = "" + } + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## vtsls + +https://github.com/yioneko/vtsls + +`vtsls` can be installed with npm: +```sh +npm install -g @vtsls/language-server +``` + +To configure a TypeScript project, add a +[`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) +or [`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to +the root of your project. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vtsls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vtsls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" } + ``` + - `root_dir` : + ```lua + root_pattern("tsconfig.json", "package.json", "jsconfig.json", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## vuels + +https://github.com/vuejs/vetur/tree/master/server + +Vue language server(vls) +`vue-language-server` can be installed via `npm`: +```sh +npm install -g vls +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vuels.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vls" } + ``` + - `filetypes` : + ```lua + { "vue" } + ``` + - `init_options` : + ```lua + { + config = { + css = {}, + emmet = {}, + html = { + suggest = {} + }, + javascript = { + format = {} + }, + stylusSupremacy = {}, + typescript = { + format = {} + }, + vetur = { + completion = { + autoImport = false, + tagCasing = "kebab", + useScaffoldSnippets = false + }, + format = { + defaultFormatter = { + js = "none", + ts = "none" + }, + defaultFormatterOptions = {}, + scriptInitialIndent = false, + styleInitialIndent = false + }, + useWorkspaceDependencies = false, + validation = { + script = true, + style = true, + template = true + } + } + } + } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", "vue.config.js") + ``` + + +## wgsl_analyzer + +https://github.com/wgsl-analyzer/wgsl-analyzer + +`wgsl_analyzer` can be installed via `cargo`: +```sh +cargo install --git https://github.com/wgsl-analyzer/wgsl-analyzer wgsl_analyzer +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.wgsl_analyzer.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "wgsl_analyzer" } + ``` + - `filetypes` : + ```lua + { "wgsl" } + ``` + - `root_dir` : + ```lua + root_pattern(".git" + ``` + - `settings` : + ```lua + {} + ``` + + +## yamlls + +https://github.com/redhat-developer/yaml-language-server + +`yaml-language-server` can be installed via `yarn`: +```sh +yarn global add yaml-language-server +``` + +To use a schema for validation, there are two options: + +1. Add a modeline to the file. A modeline is a comment of the form: + +``` +# yaml-language-server: $schema=<urlToTheSchema|relativeFilePath|absoluteFilePath}> +``` + +where the relative filepath is the path relative to the open yaml file, and the absolute filepath +is the filepath relative to the filesystem root ('/' on unix systems) + +2. Associated a schema url, relative , or absolute (to root of project, not to filesystem root) path to +the a glob pattern relative to the detected project root. Check `:LspInfo` to determine the resolved project +root. + +```lua +require('lspconfig').yamlls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + ... -- other settings. note this overrides the lspconfig defaults. + schemas = { + ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*", + ["../path/relative/to/file.yml"] = "/.github/workflows/*", + ["/path/from/root/of/project"] = "/.github/workflows/*", + }, + }, + } +} +``` + +Currently, kubernetes is special-cased in yammls, see the following upstream issues: +* [#211](https://github.com/redhat-developer/yaml-language-server/issues/211). +* [#307](https://github.com/redhat-developer/yaml-language-server/issues/307). + +To override a schema to use a specific k8s schema version (for example, to use 1.18): + +```lua +require('lspconfig').yamlls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + ... -- other settings. note this overrides the lspconfig defaults. + schemas = { + ["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.18.0-standalone-strict/all.json"] = "/*.k8s.yaml", + ... -- other schemas + }, + }, + } +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.yamlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "yaml-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml", "yaml.docker-compose", "yaml.gitlab" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `settings` : + ```lua + { + redhat = { + telemetry = { + enabled = false + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## yang_lsp + +https://github.com/TypeFox/yang-lsp + +A Language Server for the YANG data modeling language. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.yang_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "yang-language-server" } + ``` + - `filetypes` : + ```lua + { "yang" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## yls + +https://pypi.org/project/yls-yara/ + +An YLS plugin adding YARA linting capabilities. + +This plugin runs yara.compile on every save, parses the errors, and returns list of diagnostic messages. + +Language Server: https://github.com/avast/yls + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.yls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "yls", "-vv" } + ``` + - `filetypes` : + ```lua + { "yar", "yara" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## zk + +https://github.com/mickael-menu/zk + +A plain text note-taking assistant + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.zk.setup{} +``` +**Commands:** +- ZkIndex: ZkIndex +- ZkNew: ZkNew + +**Default values:** + - `cmd` : + ```lua + { "zk", "lsp" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + root_pattern(".zk") + ``` + + +## zls + +https://github.com/zigtools/zls + +Zig LSP implementation + Zig Language Server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.zls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "zls" } + ``` + - `filetypes` : + ```lua + { "zig", "zir" } + ``` + - `root_dir` : + ```lua + util.root_pattern("zls.json", "build.zig", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + + +vim:ft=markdown diff --git a/start/lspconfig-0.1.8/doc/server_configurations.txt b/start/lspconfig-0.1.8/doc/server_configurations.txt new file mode 100644 index 0000000..45946af --- /dev/null +++ b/start/lspconfig-0.1.8/doc/server_configurations.txt @@ -0,0 +1,13815 @@ +# Configurations +<!-- *lspconfig-all* *lspconfig-server-configurations* --> + +LSP configs provided by nvim-lspconfig are listed below. This documentation is +autogenerated from the Lua files. You can view this file in Nvim by running +`:help lspconfig-all`. + +- [agda_ls](#agda_ls) +- [aiken](#aiken) +- [als](#als) +- [anakin_language_server](#anakin_language_server) +- [angularls](#angularls) +- [ansiblels](#ansiblels) +- [antlersls](#antlersls) +- [apex_ls](#apex_ls) +- [arduino_language_server](#arduino_language_server) +- [asm_lsp](#asm_lsp) +- [ast_grep](#ast_grep) +- [astro](#astro) +- [autotools_ls](#autotools_ls) +- [awk_ls](#awk_ls) +- [azure_pipelines_ls](#azure_pipelines_ls) +- [basedpyright](#basedpyright) +- [bashls](#bashls) +- [beancount](#beancount) +- [bicep](#bicep) +- [biome](#biome) +- [bitbake_language_server](#bitbake_language_server) +- [blueprint_ls](#blueprint_ls) +- [bqnlsp](#bqnlsp) +- [bright_script](#bright_script) +- [bsl_ls](#bsl_ls) +- [buck2](#buck2) +- [buddy_ls](#buddy_ls) +- [bufls](#bufls) +- [bzl](#bzl) +- [cadence](#cadence) +- [cairo_ls](#cairo_ls) +- [ccls](#ccls) +- [cds_lsp](#cds_lsp) +- [circom-lsp](#circom-lsp) +- [clangd](#clangd) +- [clarity_lsp](#clarity_lsp) +- [clojure_lsp](#clojure_lsp) +- [cmake](#cmake) +- [cobol_ls](#cobol_ls) +- [codeqlls](#codeqlls) +- [coffeesense](#coffeesense) +- [contextive](#contextive) +- [coq_lsp](#coq_lsp) +- [crystalline](#crystalline) +- [csharp_ls](#csharp_ls) +- [css_variables](#css_variables) +- [cssls](#cssls) +- [cssmodules_ls](#cssmodules_ls) +- [cucumber_language_server](#cucumber_language_server) +- [custom_elements_ls](#custom_elements_ls) +- [cypher_ls](#cypher_ls) +- [dafny](#dafny) +- [dagger](#dagger) +- [dartls](#dartls) +- [dcmls](#dcmls) +- [debputy](#debputy) +- [delphi_ls](#delphi_ls) +- [denols](#denols) +- [dhall_lsp_server](#dhall_lsp_server) +- [diagnosticls](#diagnosticls) +- [digestif](#digestif) +- [docker_compose_language_service](#docker_compose_language_service) +- [dockerls](#dockerls) +- [dolmenls](#dolmenls) +- [dotls](#dotls) +- [dprint](#dprint) +- [drools_lsp](#drools_lsp) +- [ds_pinyin_lsp](#ds_pinyin_lsp) +- [earthlyls](#earthlyls) +- [ecsact](#ecsact) +- [efm](#efm) +- [elixirls](#elixirls) +- [elmls](#elmls) +- [elp](#elp) +- [ember](#ember) +- [emmet_language_server](#emmet_language_server) +- [emmet_ls](#emmet_ls) +- [erg_language_server](#erg_language_server) +- [erlangls](#erlangls) +- [esbonio](#esbonio) +- [eslint](#eslint) +- [facility_language_server](#facility_language_server) +- [fennel_language_server](#fennel_language_server) +- [fennel_ls](#fennel_ls) +- [flow](#flow) +- [flux_lsp](#flux_lsp) +- [foam_ls](#foam_ls) +- [fortls](#fortls) +- [fsautocomplete](#fsautocomplete) +- [fsharp_language_server](#fsharp_language_server) +- [fstar](#fstar) +- [futhark_lsp](#futhark_lsp) +- [gdscript](#gdscript) +- [gdshader_lsp](#gdshader_lsp) +- [ghcide](#ghcide) +- [ghdl_ls](#ghdl_ls) +- [ginko_ls](#ginko_ls) +- [gitlab_ci_ls](#gitlab_ci_ls) +- [gleam](#gleam) +- [glint](#glint) +- [glsl_analyzer](#glsl_analyzer) +- [glslls](#glslls) +- [golangci_lint_ls](#golangci_lint_ls) +- [gopls](#gopls) +- [gradle_ls](#gradle_ls) +- [grammarly](#grammarly) +- [graphql](#graphql) +- [groovyls](#groovyls) +- [guile_ls](#guile_ls) +- [harper_ls](#harper_ls) +- [haxe_language_server](#haxe_language_server) +- [hdl_checker](#hdl_checker) +- [helm_ls](#helm_ls) +- [hhvm](#hhvm) +- [hie](#hie) +- [hlasm](#hlasm) +- [hls](#hls) +- [hoon_ls](#hoon_ls) +- [html](#html) +- [htmx](#htmx) +- [hydra_lsp](#hydra_lsp) +- [hyprls](#hyprls) +- [idris2_lsp](#idris2_lsp) +- [intelephense](#intelephense) +- [java_language_server](#java_language_server) +- [jdtls](#jdtls) +- [jedi_language_server](#jedi_language_server) +- [jinja_lsp](#jinja_lsp) +- [jqls](#jqls) +- [jsonls](#jsonls) +- [jsonnet_ls](#jsonnet_ls) +- [julials](#julials) +- [koka](#koka) +- [kotlin_language_server](#kotlin_language_server) +- [lean3ls](#lean3ls) +- [leanls](#leanls) +- [lelwel_ls](#lelwel_ls) +- [lemminx](#lemminx) +- [lexical](#lexical) +- [ltex](#ltex) +- [lua_ls](#lua_ls) +- [luau_lsp](#luau_lsp) +- [lwc_ls](#lwc_ls) +- [m68k](#m68k) +- [markdown_oxide](#markdown_oxide) +- [marksman](#marksman) +- [matlab_ls](#matlab_ls) +- [mdx_analyzer](#mdx_analyzer) +- [mesonlsp](#mesonlsp) +- [metals](#metals) +- [millet](#millet) +- [mint](#mint) +- [mlir_lsp_server](#mlir_lsp_server) +- [mlir_pdll_lsp_server](#mlir_pdll_lsp_server) +- [mm0_ls](#mm0_ls) +- [mojo](#mojo) +- [motoko_lsp](#motoko_lsp) +- [move_analyzer](#move_analyzer) +- [mutt_ls](#mutt_ls) +- [nelua_lsp](#nelua_lsp) +- [neocmake](#neocmake) +- [nextls](#nextls) +- [nginx_language_server](#nginx_language_server) +- [nickel_ls](#nickel_ls) +- [nil_ls](#nil_ls) +- [nim_langserver](#nim_langserver) +- [nimls](#nimls) +- [nixd](#nixd) +- [nomad_lsp](#nomad_lsp) +- [ntt](#ntt) +- [nushell](#nushell) +- [nxls](#nxls) +- [ocamlls](#ocamlls) +- [ocamllsp](#ocamllsp) +- [ols](#ols) +- [omnisharp](#omnisharp) +- [opencl_ls](#opencl_ls) +- [openedge_ls](#openedge_ls) +- [openscad_ls](#openscad_ls) +- [openscad_lsp](#openscad_lsp) +- [pact_ls](#pact_ls) +- [pasls](#pasls) +- [pbls](#pbls) +- [perlls](#perlls) +- [perlnavigator](#perlnavigator) +- [perlpls](#perlpls) +- [pest_ls](#pest_ls) +- [phan](#phan) +- [phpactor](#phpactor) +- [pico8_ls](#pico8_ls) +- [pkgbuild_language_server](#pkgbuild_language_server) +- [please](#please) +- [postgres_lsp](#postgres_lsp) +- [powershell_es](#powershell_es) +- [prismals](#prismals) +- [prolog_ls](#prolog_ls) +- [prosemd_lsp](#prosemd_lsp) +- [psalm](#psalm) +- [puppet](#puppet) +- [purescriptls](#purescriptls) +- [pylsp](#pylsp) +- [pylyzer](#pylyzer) +- [pyre](#pyre) +- [pyright](#pyright) +- [qml_lsp](#qml_lsp) +- [qmlls](#qmlls) +- [quick_lint_js](#quick_lint_js) +- [r_language_server](#r_language_server) +- [racket_langserver](#racket_langserver) +- [raku_navigator](#raku_navigator) +- [reason_ls](#reason_ls) +- [regal](#regal) +- [regols](#regols) +- [relay_lsp](#relay_lsp) +- [remark_ls](#remark_ls) +- [rescriptls](#rescriptls) +- [rls](#rls) +- [rnix](#rnix) +- [robotframework_ls](#robotframework_ls) +- [roc_ls](#roc_ls) +- [rome](#rome) +- [rubocop](#rubocop) +- [ruby_lsp](#ruby_lsp) +- [ruff](#ruff) +- [ruff_lsp](#ruff_lsp) +- [rune_languageserver](#rune_languageserver) +- [rust_analyzer](#rust_analyzer) +- [salt_ls](#salt_ls) +- [scheme_langserver](#scheme_langserver) +- [scry](#scry) +- [serve_d](#serve_d) +- [shopify_theme_ls](#shopify_theme_ls) +- [sixtyfps](#sixtyfps) +- [slangd](#slangd) +- [slint_lsp](#slint_lsp) +- [smarty_ls](#smarty_ls) +- [smithy_ls](#smithy_ls) +- [snyk_ls](#snyk_ls) +- [solang](#solang) +- [solargraph](#solargraph) +- [solc](#solc) +- [solidity](#solidity) +- [solidity_ls](#solidity_ls) +- [solidity_ls_nomicfoundation](#solidity_ls_nomicfoundation) +- [somesass_ls](#somesass_ls) +- [sorbet](#sorbet) +- [sourcekit](#sourcekit) +- [sourcery](#sourcery) +- [spectral](#spectral) +- [spyglassmc_language_server](#spyglassmc_language_server) +- [sqlls](#sqlls) +- [sqls](#sqls) +- [standardrb](#standardrb) +- [starlark_rust](#starlark_rust) +- [starpls](#starpls) +- [statix](#statix) +- [steep](#steep) +- [stimulus_ls](#stimulus_ls) +- [stylelint_lsp](#stylelint_lsp) +- [svelte](#svelte) +- [svlangserver](#svlangserver) +- [svls](#svls) +- [swift_mesonls](#swift_mesonls) +- [syntax_tree](#syntax_tree) +- [tabby_ml](#tabby_ml) +- [tailwindcss](#tailwindcss) +- [taplo](#taplo) +- [tblgen_lsp_server](#tblgen_lsp_server) +- [teal_ls](#teal_ls) +- [templ](#templ) +- [terraform_lsp](#terraform_lsp) +- [terraformls](#terraformls) +- [texlab](#texlab) +- [textlsp](#textlsp) +- [tflint](#tflint) +- [theme_check](#theme_check) +- [thriftls](#thriftls) +- [tilt_ls](#tilt_ls) +- [tinymist](#tinymist) +- [tsp_server](#tsp_server) +- [tsserver](#tsserver) +- [ttags](#ttags) +- [turtle_ls](#turtle_ls) +- [twiggy_language_server](#twiggy_language_server) +- [typeprof](#typeprof) +- [typos_lsp](#typos_lsp) +- [typst_lsp](#typst_lsp) +- [uiua](#uiua) +- [unison](#unison) +- [unocss](#unocss) +- [uvls](#uvls) +- [v_analyzer](#v_analyzer) +- [vacuum](#vacuum) +- [vala_ls](#vala_ls) +- [vale_ls](#vale_ls) +- [vdmj](#vdmj) +- [verible](#verible) +- [veridian](#veridian) +- [veryl_ls](#veryl_ls) +- [vhdl_ls](#vhdl_ls) +- [vimls](#vimls) +- [visualforce_ls](#visualforce_ls) +- [vls](#vls) +- [volar](#volar) +- [vtsls](#vtsls) +- [vuels](#vuels) +- [wgsl_analyzer](#wgsl_analyzer) +- [yamlls](#yamlls) +- [yang_lsp](#yang_lsp) +- [yls](#yls) +- [zk](#zk) +- [zls](#zls) + +## agda_ls + +https://github.com/agda/agda-language-server + +Language Server for Agda. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.agda_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "als" } + ``` + - `filetypes` : + ```lua + { "agda" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## aiken + +https://github.com/aiken-lang/aiken + +A language server for Aiken Programming Language. +[Installation](https://aiken-lang.org/installation-instructions) + +It can be i + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.aiken.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "aiken", "lsp" } + ``` + - `filetypes` : + ```lua + { "aiken" } + ``` + - `root_dir` : + ```lua + root_pattern("aiken.toml", ".git") + ``` + + +## als + +https://github.com/AdaCore/ada_language_server + +Installation instructions can be found [here](https://github.com/AdaCore/ada_language_server#Install). + +Can be configured by passing a "settings" object to `als.setup{}`: + +```lua +require('lspconfig').als.setup{ + settings = { + ada = { + projectFile = "project.gpr"; + scenarioVariables = { ... }; + } + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.als.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ada_language_server" } + ``` + - `filetypes` : + ```lua + { "ada" } + ``` + - `root_dir` : + ```lua + util.root_pattern("Makefile", ".git", "*.gpr", "*.adc") + ``` + + +## anakin_language_server + +https://pypi.org/project/anakin-language-server/ + +`anakin-language-server` is yet another Jedi Python language server. + +Available options: + +* Initialization: https://github.com/muffinmad/anakin-language-server#initialization-option +* Configuration: https://github.com/muffinmad/anakin-language-server#configuration-options + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.anakin_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "anakinls" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + anakinls = { + pyflakes_errors = { "ImportStarNotPermitted", "UndefinedExport", "UndefinedLocal", "UndefinedName", "DuplicateArgument", "MultiValueRepeatedKeyLiteral", "MultiValueRepeatedKeyVariable", "FutureFeatureNotDefined", "LateFutureImport", "ReturnOutsideFunction", "YieldOutsideFunction", "ContinueOutsideLoop", "BreakOutsideLoop", "TwoStarredExpressions", "TooManyExpressionsInStarredAssignment", "ForwardAnnotationSyntaxError", "RaiseNotImplemented", "StringDotFormatExtraPositionalArguments", "StringDotFormatExtraNamedArguments", "StringDotFormatMissingArgument", "StringDotFormatMixingAutomatic", "StringDotFormatInvalidFormat", "PercentFormatInvalidFormat", "PercentFormatMixedPositionalAndNamed", "PercentFormatUnsupportedFormat", "PercentFormatPositionalCountMismatch", "PercentFormatExtraNamedArguments", "PercentFormatMissingArgument", "PercentFormatExpectedMapping", "PercentFormatExpectedSequence", "PercentFormatStarRequiresSequence" } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## angularls + +https://github.com/angular/vscode-ng-language-service + +`angular-language-server` can be installed via npm `npm install -g @angular/language-server`. + +Note, that if you override the default `cmd`, you must also update `on_new_config` to set `new_config.cmd` during startup. + +```lua +local project_library_path = "/path/to/project/lib" +local cmd = {"ngserver", "--stdio", "--tsProbeLocations", project_library_path , "--ngProbeLocations", project_library_path} + +require'lspconfig'.angularls.setup{ + cmd = cmd, + on_new_config = function(new_config,new_root_dir) + new_config.cmd = cmd + end, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.angularls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ngserver", "--stdio", "--tsProbeLocations", "", "--ngProbeLocations", "" } + ``` + - `filetypes` : + ```lua + { "typescript", "html", "typescriptreact", "typescript.tsx" } + ``` + - `root_dir` : + ```lua + root_pattern("angular.json") + ``` + + +## ansiblels + +https://github.com/ansible/vscode-ansible + +Language server for the ansible configuration management tool. + +`ansible-language-server` can be installed via `npm`: + +```sh +npm install -g @ansible/ansible-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ansiblels.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ansible-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml.ansible" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + ansible = { + ansible = { + path = "ansible" + }, + executionEnvironment = { + enabled = false + }, + python = { + interpreterPath = "python" + }, + validation = { + enabled = true, + lint = { + enabled = true, + path = "ansible-lint" + } + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## antlersls + +https://www.npmjs.com/package/antlers-language-server + +`antlersls` can be installed via `npm`: +```sh +npm install -g antlers-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.antlersls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "antlersls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "html", "antlers" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## apex_ls + +https://github.com/forcedotcom/salesforcedx-vscode + +Language server for Apex. + +For manual installation, download the JAR file from the [VSCode +extension](https://github.com/forcedotcom/salesforcedx-vscode/tree/develop/packages/salesforcedx-vscode-apex). + +```lua +require'lspconfig'.apex_ls.setup { + apex_jar_path = '/path/to/apex-jorje-lsp.jar', + apex_enable_semantic_errors = false, -- Whether to allow Apex Language Server to surface semantic errors + apex_enable_completion_statistics = false, -- Whether to allow Apex Language Server to collect telemetry on code completion usage +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.apex_ls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "apexcode" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern('sfdx-project.json') + ``` + + +## arduino_language_server + +https://github.com/arduino/arduino-language-server + +Language server for Arduino + +The `arduino-language-server` can be installed by running: + +``` +go install github.com/arduino/arduino-language-server@latest +``` + +The `arduino-cli` tool must also be installed. Follow [these +installation instructions](https://arduino.github.io/arduino-cli/latest/installation/) for +your platform. + +After installing `arduino-cli`, follow [these +instructions](https://arduino.github.io/arduino-cli/latest/getting-started/#create-a-configuration-file) +for generating a configuration file if you haven't done so already, and make +sure you [install any relevant platforms +libraries](https://arduino.github.io/arduino-cli/latest/getting-started/#install-the-core-for-your-board). + +The language server also requires `clangd` to be installed. Follow [these +installation instructions](https://clangd.llvm.org/installation) for your +platform. + +If you don't have a sketch yet create one. + +```sh +$ arduino-cli sketch new test +$ cd test +``` + +You will need a `sketch.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. + + +First gather some information about your board. Make sure your board is connected and run the following: + +```sh +$ arduino-cli board list +Port Protocol Type Board Name FQBN Core +/dev/ttyACM0 serial Serial Port (USB) Arduino Uno arduino:avr:uno arduino:avr +``` + +Then generate the file: + +```sh +arduino-cli board attach -p /dev/ttyACM0 -b arduino:avr:uno test.ino +``` + +The resulting file should like like this: + +```yaml +default_fqbn: arduino:avr:uno +default_port: /dev/ttyACM0 +``` + +Your folder structure should look like this: + +``` +. +├── test.ino +└── sketch.yaml +``` + +For further instruction about configuration options, run `arduino-language-server --help`. + +Note that an upstream bug makes keywords in some cases become undefined by the language server. +Ref: https://github.com/arduino/arduino-ide/issues/159 + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.arduino_language_server.setup{} +``` + + +**Default values:** + - `capabilities` : + ```lua + { + general = { + positionEncodings = { "utf-16" } + }, + textDocument = { + callHierarchy = { + dynamicRegistration = false + }, + codeAction = { + codeActionLiteralSupport = { + codeActionKind = { + valueSet = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" } + } + }, + dataSupport = true, + dynamicRegistration = true, + isPreferredSupport = true, + resolveSupport = { + properties = { "edit" } + } + }, + completion = { + completionItem = { + commitCharactersSupport = false, + deprecatedSupport = false, + documentationFormat = { "markdown", "plaintext" }, + preselectSupport = false, + snippetSupport = false + }, + completionItemKind = { + valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 } + }, + completionList = { + itemDefaults = { "editRange", "insertTextFormat", "insertTextMode", "data" } + }, + contextSupport = false, + dynamicRegistration = false + }, + declaration = { + linkSupport = true + }, + definition = { + dynamicRegistration = true, + linkSupport = true + }, + diagnostic = { + dynamicRegistration = false + }, + documentHighlight = { + dynamicRegistration = false + }, + documentSymbol = { + dynamicRegistration = false, + hierarchicalDocumentSymbolSupport = true, + symbolKind = { + valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } + } + }, + formatting = { + dynamicRegistration = true + }, + hover = { + contentFormat = { "markdown", "plaintext" }, + dynamicRegistration = true + }, + implementation = { + linkSupport = true + }, + inlayHint = { + dynamicRegistration = true, + resolveSupport = { + properties = { "textEdits", "tooltip", "location", "command" } + } + }, + publishDiagnostics = { + dataSupport = true, + relatedInformation = true, + tagSupport = { + valueSet = { 1, 2 } + } + }, + rangeFormatting = { + dynamicRegistration = true + }, + references = { + dynamicRegistration = false + }, + rename = { + dynamicRegistration = true, + prepareSupport = true + }, + semanticTokens = vim.NIL, + signatureHelp = { + dynamicRegistration = false, + signatureInformation = { + activeParameterSupport = true, + documentationFormat = { "markdown", "plaintext" }, + parameterInformation = { + labelOffsetSupport = true + } + } + }, + synchronization = { + didSave = true, + dynamicRegistration = false, + willSave = true, + willSaveWaitUntil = true + }, + typeDefinition = { + linkSupport = true + } + }, + window = { + showDocument = { + support = true + }, + showMessage = { + messageActionItem = { + additionalPropertiesSupport = false + } + }, + workDoneProgress = true + }, + workspace = { + applyEdit = true, + configuration = true, + didChangeConfiguration = { + dynamicRegistration = false + }, + didChangeWatchedFiles = { + dynamicRegistration = false, + relativePatternSupport = true + }, + inlayHint = { + refreshSupport = true + }, + semanticTokens = vim.NIL, + symbol = { + dynamicRegistration = false, + symbolKind = { + valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } + } + }, + workspaceEdit = { + resourceOperations = { "rename", "create", "delete" } + }, + workspaceFolders = true + } + } + ``` + - `cmd` : + ```lua + { "arduino-language-server" } + ``` + - `filetypes` : + ```lua + { "arduino" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## asm_lsp + +https://github.com/bergercookie/asm-lsp + +Language Server for GAS/GO Assembly + +`asm-lsp` can be installed via cargo: +cargo install asm-lsp + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.asm_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "asm-lsp" } + ``` + - `filetypes` : + ```lua + { "asm", "vmasm" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## ast_grep + +https://ast-grep.github.io/ + +ast-grep(sg) is a fast and polyglot tool for code structural search, lint, rewriting at large scale. +ast-grep LSP only works in projects that have `sgconfig.y[a]ml` in their root directories. +```sh +npm install [-g] @ast-grep/cli +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ast_grep.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ast-grep", "lsp" } + ``` + - `filetypes` : + ```lua + { "c", "cpp", "rust", "go", "java", "python", "javascript", "typescript", "html", "css", "kotlin", "dart", "lua" } + ``` + - `root_dir` : + ```lua + root_pattern('sgconfig.yaml', 'sgconfig.yml') + ``` + + +## astro + +https://github.com/withastro/language-tools/tree/main/packages/language-server + +`astro-ls` can be installed via `npm`: +```sh +npm install -g @astrojs/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.astro.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "astro-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "astro" } + ``` + - `init_options` : + ```lua + { + typescript = {} + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git") + ``` + + +## autotools_ls + +https://github.com/Freed-Wu/autotools-language-server + +`autotools-language-server` can be installed via `pip`: +```sh +pip install autotools-language-server +``` + +Language server for autoconf, automake and make using tree sitter in python. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.autotools_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "autotools-language-server" } + ``` + - `filetypes` : + ```lua + { "config", "automake", "make" } + ``` + - `root_dir` : + ```lua + { "configure.ac", "Makefile", "Makefile.am", "*.mk" } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## awk_ls + +https://github.com/Beaglefoot/awk-language-server/ + +`awk-language-server` can be installed via `npm`: +```sh +npm install -g awk-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.awk_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "awk-language-server" } + ``` + - `filetypes` : + ```lua + { "awk" } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## azure_pipelines_ls + +https://github.com/microsoft/azure-pipelines-language-server + +An Azure Pipelines language server + +`azure-pipelines-ls` can be installed via `npm`: + +```sh +npm install -g azure-pipelines-language-server +``` + +By default `azure-pipelines-ls` will only work in files named `azure-pipelines.yml`, this can be changed by providing additional settings like so: +```lua +require("lspconfig").azure_pipelines_ls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + schemas = { + ["https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/master/service-schema.json"] = { + "/azure-pipeline*.y*l", + "/*.azure*", + "Azure-Pipelines/**/*.y*l", + "Pipelines/*.y*l", + }, + }, + }, + }, +} +``` +The Azure Pipelines LSP is a fork of `yaml-language-server` and as such the same settings can be passed to it as `yaml-language-server`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.azure_pipelines_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "azure-pipelines-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## basedpyright + +https://detachhead.github.io/basedpyright + +`basedpyright`, a static type checker and language server for python + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.basedpyright.setup{} +``` +**Commands:** +- PyrightOrganizeImports: Organize Imports +- PyrightSetPythonPath: Reconfigure basedpyright with the provided python path + +**Default values:** + - `cmd` : + ```lua + { "basedpyright-langserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + basedpyright = { + analysis = { + autoSearchPaths = true, + diagnosticMode = "openFilesOnly", + useLibraryCodeForTypes = true + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bashls + +https://github.com/bash-lsp/bash-language-server + +`bash-language-server` can be installed via `npm`: +```sh +npm i -g bash-language-server +``` + +Language server for bash, written using tree sitter in typescript. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bashls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "bash-language-server", "start" } + ``` + - `filetypes` : + ```lua + { "sh" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `settings` : + ```lua + { + bashIde = { + globPattern = "*@(.sh|.inc|.bash|.command)" + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## beancount + +https://github.com/polarmutex/beancount-language-server#installation + +See https://github.com/polarmutex/beancount-language-server#configuration for configuration options + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.beancount.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "beancount-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "beancount", "bean" } + ``` + - `init_options` : + ```lua + {} + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bicep + +https://github.com/azure/bicep +Bicep language server + +Bicep language server can be installed by downloading and extracting a release of bicep-langserver.zip from [Bicep GitHub releases](https://github.com/Azure/bicep/releases). + +Bicep language server requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +Neovim does not have built-in support for the bicep filetype which is required for lspconfig to automatically launch the language server. + +Filetype detection can be added via an autocmd: +```lua +vim.cmd [[ autocmd BufNewFile,BufRead *.bicep set filetype=bicep ]] +``` + +**By default, bicep language server does not have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. + +```lua +local bicep_lsp_bin = "/path/to/bicep-langserver/Bicep.LangServer.dll" +require'lspconfig'.bicep.setup{ + cmd = { "dotnet", bicep_lsp_bin }; + ... +} +``` + +To download the latest release and place in /usr/local/bin/bicep-langserver: +```bash +(cd $(mktemp -d) \ + && curl -fLO https://github.com/Azure/bicep/releases/latest/download/bicep-langserver.zip \ + && rm -rf /usr/local/bin/bicep-langserver \ + && unzip -d /usr/local/bin/bicep-langserver bicep-langserver.zip) +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bicep.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "bicep" } + ``` + - `init_options` : + ```lua + {} + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## biome + +https://biomejs.dev + +Toolchain of the web. [Successor of Rome](https://biomejs.dev/blog/annoucing-biome). + +```sh +npm install [-g] @biomejs/biome +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.biome.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "biome", "lsp-proxy" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "json", "jsonc", "typescript", "typescript.tsx", "typescriptreact", "astro", "svelte", "vue" } + ``` + - `root_dir` : + ```lua + root_pattern('biome.json', 'biome.jsonc') + ``` + - `single_file_support` : + ```lua + false + ``` + + +## bitbake_language_server + +🛠️ bitbake language server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bitbake_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "bitbake-language-server" } + ``` + - `filetypes` : + ```lua + { "bitbake" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## blueprint_ls + +https://gitlab.gnome.org/jwestman/blueprint-compiler + +`blueprint-compiler` can be installed via your system package manager. + +Language server for the blueprint markup language, written in python and part +of the blueprint-compiler. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.blueprint_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "blueprint-compiler", "lsp" } + ``` + - `cmd_env` : + ```lua + { + GLOB_PATTERN = "*@(.blp)" + } + ``` + - `filetypes` : + ```lua + { "blueprint" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bqnlsp + +https://git.sr.ht/~detegr/bqnlsp + + +`bqnlsp`, a language server for BQN. + +The binary depends on the shared library of [CBQN](https://github.com/dzaima/CBQN) `libcbqn.so`. +If CBQN is installed system-wide (using `sudo make install` in its source directory) and `bqnlsp` errors that it can't find the shared library, update the linker cache by executing `sudo ldconfig`. +If CBQN has been installed in a non-standard directory or can't be installed globally pass `libcbqnPath = '/path/to/CBQN'` to the setup function. +This will set the environment variables `LD_LIBRARY_PATH` (Linux) or `DYLD_LIBRARY_PATH` (macOS) to the provided path. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bqnlsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "bqnlsp" } + ``` + - `filetypes` : + ```lua + { "bqn" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bright_script + +https://github.com/RokuCommunity/brighterscript + +`brightscript` can be installed via `npm`: +```sh +npm install -g brighterscript +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bright_script.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "bsc", "--lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "brs" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bsl_ls + + https://github.com/1c-syntax/bsl-language-server + + Language Server Protocol implementation for 1C (BSL) - 1C:Enterprise 8 and OneScript languages. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bsl_ls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "bsl", "os" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## buck2 + +https://github.com/facebook/buck2 + +Build system, successor to Buck + +To better detect Buck2 project files, the following can be added: + +``` +vim.cmd [[ autocmd BufRead,BufNewFile *.bxl,BUCK,TARGETS set filetype=bzl ]] +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.buck2.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "buck2", "lsp" } + ``` + - `filetypes` : + ```lua + { "bzl" } + ``` + - `root_dir` : + ```lua + root_pattern(".buckconfig") + ``` + + +## buddy_ls + +https://github.com/buddy-compiler/buddy-mlir#buddy-lsp-server +The Language Server for the buddy-mlir, a drop-in replacement for mlir-lsp-server, +supporting new dialects defined in buddy-mlir. +`buddy-lsp-server` can be installed at the buddy-mlir repository (buddy-compiler/buddy-mlir) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.buddy_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "buddy-lsp-server" } + ``` + - `filetypes` : + ```lua + { "mlir" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## bufls + +https://github.com/bufbuild/buf-language-server + +`buf-language-server` can be installed via `go install`: +```sh +go install github.com/bufbuild/buf-language-server/cmd/bufls@latest +``` + +bufls is a Protobuf language server compatible with Buf modules and workspaces + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bufls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "bufls", "serve" } + ``` + - `filetypes` : + ```lua + { "proto" } + ``` + - `root_dir` : + ```lua + root_pattern("buf.work.yaml", ".git") + ``` + + +## bzl + +https://bzl.io/ + +https://docs.stack.build/docs/cli/installation + +https://docs.stack.build/docs/vscode/starlark-language-server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.bzl.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "bzl", "lsp", "serve" } + ``` + - `filetypes` : + ```lua + { "bzl" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## cadence + +[Cadence Language Server](https://github.com/onflow/cadence-tools/tree/master/languageserver) +using the [flow-cli](https://developers.flow.com/tools/flow-cli). + +The `flow` command from flow-cli must be available. For install instructions see +[the docs](https://developers.flow.com/tools/flow-cli/install#install-the-flow-cli) or the +[Github page](https://github.com/onflow/flow-cli). + +By default the configuration is taken from the closest `flow.json` or the `flow.json` in the users home directory. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cadence.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "flow", "cadence", "language-server" } + ``` + - `filetypes` : + ```lua + { "cdc" } + ``` + - `init_options` : + ```lua + { + numberOfAccounts = "1" + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + util.root_pattern('flow.json') or vim.env.HOME + ``` + + +## cairo_ls + +[Cairo Language Server](https://github.com/starkware-libs/cairo/tree/main/crates/cairo-lang-language-server) + +First, install cairo following [this tutorial](https://medium.com/@elias.tazartes/ahead-of-the-curve-install-cairo-1-0-alpha-and-prepare-for-regenesis-85f4e3940e20) + +Then enable cairo language server in your lua configuration. +```lua +require'lspconfig'.cairo_ls.setup{} +``` + +*cairo-language-server is still under active development, some features might not work yet !* + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cairo_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cairo-language-server", "/C", "--node-ipc" } + ``` + - `filetypes` : + ```lua + { "cairo" } + ``` + - `init_options` : + ```lua + { + hostInfo = "neovim" + } + ``` + - `root_dir` : + ```lua + root_pattern("Scarb.toml", "cairo_project.toml", ".git") + ``` + + +## ccls + +https://github.com/MaskRay/ccls/wiki + +ccls relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) specified +as compile_commands.json or, for simpler projects, a .ccls. +For details on how to automatically generate one using CMake look [here](https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html). Alternatively, you can use [Bear](https://github.com/rizsotto/Bear). + +Customization options are passed to ccls at initialization time via init_options, a list of available options can be found [here](https://github.com/MaskRay/ccls/wiki/Customization#initialization-options). For example: + +```lua +local lspconfig = require'lspconfig' +lspconfig.ccls.setup { + init_options = { + compilationDatabaseDirectory = "build"; + index = { + threads = 0; + }; + clang = { + excludeArgs = { "-frounding-math"} ; + }; + } +} + +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ccls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ccls" } + ``` + - `filetypes` : + ```lua + { "c", "cpp", "objc", "objcpp", "cuda" } + ``` + - `offset_encoding` : + ```lua + "utf-32" + ``` + - `root_dir` : + ```lua + root_pattern('compile_commands.json', '.ccls', '.git') + ``` + - `single_file_support` : + ```lua + false + ``` + + +## cds_lsp + + +https://cap.cloud.sap/docs/ + +`cds-lsp` can be installed via `npm`: + +```sh +npm i -g @sap/cds-lsp +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cds_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cds-lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "cds" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + cds = { + validate = true + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## circom-lsp + +[Circom Language Server](https://github.com/rubydusa/circom-lsp) + +`circom-lsp`, the language server for the Circom language. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.circom-lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "circom-lsp" } + ``` + - `filetypes` : + ```lua + { "circom" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## clangd + +https://clangd.llvm.org/installation.html + +- **NOTE:** Clang >= 11 is recommended! See [#23](https://github.com/neovim/nvim-lsp/issues/23). +- If `compile_commands.json` lives in a build directory, you should + symlink it to the root of your source tree. + ``` + ln -s /path/to/myproject/build/compile_commands.json /path/to/myproject/ + ``` +- clangd relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) + specified as compile_commands.json, see https://clangd.llvm.org/installation#compile_commandsjson + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.clangd.setup{} +``` +**Commands:** +- ClangdSwitchSourceHeader: Switch between source/header + +**Default values:** + - `capabilities` : + ```lua + default capabilities, with offsetEncoding utf-8 + ``` + - `cmd` : + ```lua + { "clangd" } + ``` + - `filetypes` : + ```lua + { "c", "cpp", "objc", "objcpp", "cuda", "proto" } + ``` + - `root_dir` : + ```lua + root_pattern( + '.clangd', + '.clang-tidy', + '.clang-format', + 'compile_commands.json', + 'compile_flags.txt', + 'configure.ac', + '.git' + ) + + ``` + - `single_file_support` : + ```lua + true + ``` + + +## clarity_lsp + +`clarity-lsp` is a language server for the Clarity language. Clarity is a decidable smart contract language that optimizes for predictability and security. Smart contracts allow developers to encode essential business logic on a blockchain. + +To learn how to configure the clarity language server, see the [clarity-lsp documentation](https://github.com/hirosystems/clarity-lsp). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.clarity_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "clarity-lsp" } + ``` + - `filetypes` : + ```lua + { "clar", "clarity" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## clojure_lsp + +https://github.com/clojure-lsp/clojure-lsp + +Clojure Language Server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.clojure_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "clojure-lsp" } + ``` + - `filetypes` : + ```lua + { "clojure", "edn" } + ``` + - `root_dir` : + ```lua + root_pattern("project.clj", "deps.edn", "build.boot", "shadow-cljs.edn", ".git", "bb.edn") + ``` + + +## cmake + +https://github.com/regen100/cmake-language-server + +CMake LSP Implementation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cmake.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cmake-language-server" } + ``` + - `filetypes` : + ```lua + { "cmake" } + ``` + - `init_options` : + ```lua + { + buildDirectory = "build" + } + ``` + - `root_dir` : + ```lua + root_pattern('CMakePresets.json', 'CTestConfig.cmake', '.git', 'build', 'cmake') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## cobol_ls + +Cobol language support + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cobol_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cobol-language-support" } + ``` + - `filetypes` : + ```lua + { "cobol" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## codeqlls + +Reference: +https://codeql.github.com/docs/codeql-cli/ + +Binaries: +https://github.com/github/codeql-cli-binaries + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.codeqlls.setup{} +``` + + +**Default values:** + - `before_init` : + ```lua + see source file + ``` + - `cmd` : + ```lua + { "codeql", "execute", "language-server", "--check-errors", "ON_CHANGE", "-q" } + ``` + - `filetypes` : + ```lua + { "ql" } + ``` + - `log_level` : + ```lua + 2 + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + search_path = "list containing all search paths, eg: '~/codeql-home/codeql-repo'" + } + ``` + + +## coffeesense + +https://github.com/phil294/coffeesense + +CoffeeSense Language Server +`coffeesense-language-server` can be installed via `npm`: +```sh +npm install -g coffeesense-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.coffeesense.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "coffeesense-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "coffee" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## contextive + +https://github.com/dev-cycles/contextive + +Language Server for Contextive. + +Contextive allows you to define terms in a central file and provides auto-completion suggestions and hover panels for these terms wherever they're used. + +To install the language server, you need to download the appropriate [GitHub release asset](https://github.com/dev-cycles/contextive/releases/) for your operating system and architecture. + +After the download unzip the Contextive.LanguageServer binary and copy the file into a folder that is included in your system's PATH. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.contextive.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "Contextive.LanguageServer" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## coq_lsp + +https://github.com/ejgallego/coq-lsp/ + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.coq_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "coq-lsp" } + ``` + - `filetypes` : + ```lua + { "coq" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## crystalline + +https://github.com/elbywan/crystalline + +Crystal language server. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.crystalline.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "crystalline" } + ``` + - `filetypes` : + ```lua + { "crystal" } + ``` + - `root_dir` : + ```lua + root_pattern('shard.yml', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## csharp_ls + +https://github.com/razzmatazz/csharp-language-server + +Language Server for C#. + +csharp-ls requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +The preferred way to install csharp-ls is with `dotnet tool install --global csharp-ls`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.csharp_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "csharp-ls" } + ``` + - `filetypes` : + ```lua + { "cs" } + ``` + - `init_options` : + ```lua + { + AutomaticWorkspaceInit = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## css_variables + +https://github.com/vunguyentuan/vscode-css-variables/tree/master/packages/css-variables-language-server + +CSS variables autocompletion and go-to-definition + +`css-variables-language-server` can be installed via `npm`: + +```sh +npm i -g css-variables-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.css_variables.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "css-variables-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "css", "scss", "less" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") or bufdir + ``` + - `settings` : + ```lua + cssVariables = { + lookupFiles = { '**/*.less', '**/*.scss', '**/*.sass', '**/*.css' }, + blacklistFolders = { + '**/.cache', + '**/.DS_Store', + '**/.git', + '**/.hg', + '**/.next', + '**/.svn', + '**/bower_components', + '**/CVS', + '**/dist', + '**/node_modules', + '**/tests', + '**/tmp', + }, + }, + + ``` + + +## cssls + + +https://github.com/hrsh7th/vscode-langservers-extracted + +`css-languageserver` can be installed via `npm`: + +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-css-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.cssls.setup { + capabilities = capabilities, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cssls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vscode-css-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "css", "scss", "less" } + ``` + - `init_options` : + ```lua + { + provideFormatter = true + } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") or bufdir + ``` + - `settings` : + ```lua + { + css = { + validate = true + }, + less = { + validate = true + }, + scss = { + validate = true + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## cssmodules_ls + +https://github.com/antonk52/cssmodules-language-server + +Language server for autocompletion and go-to-definition functionality for CSS modules. + +You can install cssmodules-language-server via npm: +```sh +npm install -g cssmodules-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cssmodules_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cssmodules-language-server" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "typescript", "typescriptreact" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json") + ``` + + +## cucumber_language_server + +https://cucumber.io +https://github.com/cucumber/common +https://www.npmjs.com/package/@cucumber/language-server + +Language server for Cucumber. + +`cucumber-language-server` can be installed via `npm`: +```sh +npm install -g @cucumber/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cucumber_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cucumber-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "cucumber" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## custom_elements_ls + +https://github.com/Matsuuu/custom-elements-language-server + +`custom-elements-languageserver` depends on `typescript`. Both packages can be installed via `npm`: +```sh +npm install -g typescript custom-elements-languageserver +``` +To configure typescript language server, add a +[`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or +[`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to the root of your +project. +Here's an example that disables type checking in JavaScript files. +```json +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "checkJs": false + }, + "exclude": [ + "node_modules" + ] +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.custom_elements_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "custom-elements-languageserver", "--stdio" } + ``` + - `init_options` : + ```lua + { + hostInfo = "neovim" + } + ``` + - `root_dir` : + ```lua + root_pattern("tsconfig.json", "package.json", "jsconfig.json", ".git") + ``` + + +## cypher_ls + +https://github.com/neo4j/cypher-language-support/tree/main/packages/language-server + +`cypher-language-server`, language server for Cypher query language. +Part of the umbrella project cypher-language-support: https://github.com/neo4j/cypher-language-support + +`cypher-language-server` can be installed via `npm`: +```sh +npm i -g @neo4j-cypher/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.cypher_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cypher-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "cypher" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dafny + + Support for the Dafny language server. + + The default `cmd` uses "dafny server", which works on Dafny 4.0.0+. For + older versions of Dafny, you can compile the language server from source at + [dafny-lang/language-server-csharp](https://github.com/dafny-lang/language-server-csharp) + and set `cmd = {"dotnet", "<Path to your language server>"}`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dafny.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dafny", "server" } + ``` + - `filetypes` : + ```lua + { "dfy", "dafny" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dagger + +https://github.com/dagger/cuelsp + +Dagger's lsp server for cuelang. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dagger.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "cuelsp" } + ``` + - `filetypes` : + ```lua + { "cue" } + ``` + - `root_dir` : + ```lua + root_pattern("cue.mod", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dartls + +https://github.com/dart-lang/sdk/tree/master/pkg/analysis_server/tool/lsp_spec + +Language server for dart. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dartls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dart", "language-server", "--protocol=lsp" } + ``` + - `filetypes` : + ```lua + { "dart" } + ``` + - `init_options` : + ```lua + { + closingLabels = true, + flutterOutline = true, + onlyAnalyzeProjectsWithOpenFiles = true, + outline = true, + suggestFromUnimportedLibraries = true + } + ``` + - `root_dir` : + ```lua + root_pattern("pubspec.yaml") + ``` + - `settings` : + ```lua + { + dart = { + completeFunctionCalls = true, + showTodos = true + } + } + ``` + + +## dcmls + +https://dcm.dev/ + +Language server for DCM analyzer. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dcmls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dcm", "start-server", "--client=neovim" } + ``` + - `filetypes` : + ```lua + { "dart" } + ``` + - `root_dir` : + ```lua + root_pattern("pubspec.yaml") + ``` + + +## debputy + +https://salsa.debian.org/debian/debputy + +Language Server for Debian packages. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.debputy.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "debputy", "lsp", "server" } + ``` + - `filetypes` : + ```lua + { "debcontrol", "debcopyright", "debchangelog", "make", "yaml" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## delphi_ls + +Language server for Delphi from Embarcadero. +https://marketplace.visualstudio.com/items?itemName=EmbarcaderoTechnologies.delphilsp + +Note, the '*.delphilsp.json' file is required, more details at: +https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Using_DelphiLSP_Code_Insight_with_Other_Editors + +Below, you'll find a sample configuration for the lazy manager. +When on_attach is triggered, it signals DelphiLSP to load settings from a configuration file. +Without this step, DelphiLSP initializes but remains non-functional: + +```lua +"neovim/nvim-lspconfig", +lazy = false, +config = function() + local capabilities = require("cmp_nvim_lsp").default_capabilities() + local lspconfig = require("lspconfig") + + lspconfig.delphi_ls.setup({ + capabilities = capabilities, + + on_attach = function(client) + local lsp_config = vim.fs.find(function(name) + return name:match(".*%.delphilsp.json$") + end, { type = "file", path = client.config.root_dir, upward = false })[1] + + if lsp_config then + client.config.settings = { settingsFile = lsp_config } + client.notify("workspace/didChangeConfiguration", { settings = client.config.settings }) + else + vim.notify_once("delphi_ls: '*.delphilsp.json' config file not found") + end + end, + }) +end, +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.delphi_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "DelphiLSP.exe" } + ``` + - `filetypes` : + ```lua + { "pascal" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + false + ``` + + +## denols + +https://github.com/denoland/deno + +Deno's built-in language server + +To appropriately highlight codefences returned from denols, you will need to augment vim.g.markdown_fenced languages + in your init.lua. Example: + +```lua +vim.g.markdown_fenced_languages = { + "ts=typescript" +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.denols.setup{} +``` +**Commands:** +- DenolsCache: Cache a module and all of its dependencies. + +**Default values:** + - `cmd` : + ```lua + { "deno", "lsp" } + ``` + - `cmd_env` : + ```lua + { + NO_COLOR = true + } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" } + ``` + - `handlers` : + ```lua + { + ["textDocument/definition"] = <function 1>, + ["textDocument/references"] = <function 1>, + ["textDocument/typeDefinition"] = <function 1> + } + ``` + - `root_dir` : + ```lua + root_pattern("deno.json", "deno.jsonc", ".git") + ``` + - `settings` : + ```lua + { + deno = { + enable = true, + suggest = { + imports = { + hosts = { + ["https://deno.land"] = true + } + } + } + } + } + ``` + + +## dhall_lsp_server + +https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-lsp-server + +language server for dhall + +`dhall-lsp-server` can be installed via cabal: +```sh +cabal install dhall-lsp-server +``` +prebuilt binaries can be found [here](https://github.com/dhall-lang/dhall-haskell/releases). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dhall_lsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dhall-lsp-server" } + ``` + - `filetypes` : + ```lua + { "dhall" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## diagnosticls + +https://github.com/iamcco/diagnostic-languageserver + +Diagnostic language server integrate with linters. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.diagnosticls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "diagnostic-languageserver", "--stdio" } + ``` + - `filetypes` : + ```lua + Empty by default, override to add filetypes + ``` + - `root_dir` : + ```lua + Vim's starting directory + ``` + - `single_file_support` : + ```lua + true + ``` + + +## digestif + +https://github.com/astoff/digestif + +Digestif is a code analyzer, and a language server, for LaTeX, ConTeXt et caterva. It provides + +context-sensitive completion, documentation, code navigation, and related functionality to any + +text editor that speaks the LSP protocol. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.digestif.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "digestif" } + ``` + - `filetypes` : + ```lua + { "tex", "plaintex", "context" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## docker_compose_language_service + +https://github.com/microsoft/compose-language-service +This project contains a language service for Docker Compose. + +`compose-language-service` can be installed via `npm`: + +```sh +npm install @microsoft/compose-language-service +``` + +Note: If the docker-compose-langserver doesn't startup when entering a `docker-compose.yaml` file, make sure that the filetype is `yaml.docker-compose`. You can set with: `:set filetype=yaml.docker-compose`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.docker_compose_language_service.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "docker-compose-langserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml.docker-compose" } + ``` + - `root_dir` : + ```lua + root_pattern("docker-compose.yaml", "docker-compose.yml", "compose.yaml", "compose.yml") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dockerls + +https://github.com/rcjsuen/dockerfile-language-server-nodejs + +`docker-langserver` can be installed via `npm`: +```sh +npm install -g dockerfile-language-server-nodejs +``` + +Additional configuration can be applied in the following way: +```lua +require("lspconfig").dockerls.setup { + settings = { + docker = { + languageserver = { + formatter = { + ignoreMultilineInstructions = true, + }, + }, + } + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dockerls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "docker-langserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "dockerfile" } + ``` + - `root_dir` : + ```lua + root_pattern("Dockerfile") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dolmenls + +https://github.com/Gbury/dolmen/blob/master/doc/lsp.md + +`dolmenls` can be installed via `opam` +```sh +opam install dolmen_lsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dolmenls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dolmenls" } + ``` + - `filetypes` : + ```lua + { "smt2", "tptp", "p", "cnf", "icnf", "zf" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dotls + +https://github.com/nikeee/dot-language-server + +`dot-language-server` can be installed via `npm`: +```sh +npm install -g dot-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dotls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dot-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "dot" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## dprint + +https://github.com/dprint/dprint + +Pluggable and configurable code formatting platform written in Rust. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.dprint.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dprint", "lsp" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "typescript", "typescriptreact", "json", "jsonc", "markdown", "python", "toml", "rust", "roslyn" } + ``` + - `root_dir` : + ```lua + <function 1> + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## drools_lsp + +https://github.com/kiegroup/drools-lsp + +Language server for the [Drools Rule Language (DRL)](https://docs.drools.org/latest/drools-docs/docs-website/drools/language-reference/#con-drl_drl-rules). + +The `drools-lsp` server is a self-contained java jar file (`drools-lsp-server-jar-with-dependencies.jar`), and can be downloaded from [https://github.com/kiegroup/drools-lsp/releases/](https://github.com/kiegroup/drools-lsp/releases/). + +Configuration information: +```lua +-- Option 1) Specify the entire command: +require('lspconfig').drools_lsp.setup { + cmd = { '/path/to/java', '-jar', '/path/to/drools-lsp-server-jar-with-dependencies.jar' }, +} + +-- Option 2) Specify just the jar path (the JAVA_HOME environment variable will be respected if present): +require('lspconfig').drools_lsp.setup { + drools = { jar = '/path/to/drools-lsp-server-jar-with-dependencies.jar' }, +} + +-- Option 3) Specify the java bin and/or java opts in addition to the jar path: +require('lspconfig').drools_lsp.setup { + drools = { + java = { bin = '/path/to/java', opts = { '-Xmx100m' } }, + jar = '/path/to/drools-lsp-server-jar-with-dependencies.jar', + }, +} +``` + +Neovim does not yet have automatic detection for the `drools` filetype, but it can be added with: +```lua +vim.cmd [[ autocmd BufNewFile,BufRead *.drl set filetype=drools ]] +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.drools_lsp.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "drools" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ds_pinyin_lsp + +https://github.com/iamcco/ds-pinyin-lsp +Dead simple Pinyin language server for input Chinese without IME(input method). +To install, download the latest [release](https://github.com/iamcco/ds-pinyin-lsp/releases) and ensure `ds-pinyin-lsp` is on your path. +And make ensure the database file `dict.db3` is also downloaded. And put the path to `dict.dbs` in the following code. + +```lua + +require('lspconfig').ds_pinyin_lsp.setup { + init_options = { + db_path = "your_path_to_database" + } +} + +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ds_pinyin_lsp.setup{} +``` +**Commands:** +- DsPinyinCompletionOff: Turn off the ds-pinyin-lsp completion +- DsPinyinCompletionOn: Turn on the ds-pinyin-lsp completion + +**Default values:** + - `cmd` : + ```lua + { "ds-pinyin-lsp" } + ``` + - `filetypes` : + ```lua + { "markdown", "org" } + ``` + - `init_options` : + ```lua + { + completion_on = true, + match_as_same_as_input = true, + match_long_input = true, + max_suggest = 15, + show_symbols = true, + show_symbols_by_n_times = 0, + show_symbols_only_follow_by_hanzi = false + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## earthlyls + +https://github.com/glehmann/earthlyls + +A fast language server for earthly. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.earthlyls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "earthlyls" } + ``` + - `filetypes` : + ```lua + { "earthfile" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## ecsact + +https://github.com/ecsact-dev/ecsact_lsp_server + +Language server for Ecsact. + +The default cmd assumes `ecsact_lsp_server` is in your PATH. Typically from the +Ecsact SDK: https://ecsact.dev/start + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ecsact.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ecsact_lsp_server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "ecsact" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## efm + +https://github.com/mattn/efm-langserver + +General purpose Language Server that can use specified error message format generated from specified command. + +Requires at minimum EFM version [v0.0.38](https://github.com/mattn/efm-langserver/releases/tag/v0.0.38) to support +launching the language server on single files. If on an older version of EFM, disable single file support: + +```lua +require('lspconfig')['efm'].setup{ + settings = ..., -- You must populate this according to the EFM readme + filetypes = ..., -- Populate this according to the note below + single_file_support = false, -- This is the important line for supporting older version of EFM +} +``` + +Note: In order for neovim's built-in language server client to send the appropriate `languageId` to EFM, **you must +specify `filetypes` in your call to `setup{}`**. Otherwise `lspconfig` will launch EFM on the `BufEnter` instead +of the `FileType` autocommand, and the `filetype` variable used to populate the `languageId` will not yet be set. + +```lua +require('lspconfig')['efm'].setup{ + settings = ..., -- You must populate this according to the EFM readme + filetypes = { 'python','cpp','lua' } +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.efm.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "efm-langserver" } + ``` + - `root_dir` : + ```lua + util.root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## elixirls + +https://github.com/elixir-lsp/elixir-ls + +`elixir-ls` can be installed by following the instructions [here](https://github.com/elixir-lsp/elixir-ls#building-and-running). + +```bash +curl -fLO https://github.com/elixir-lsp/elixir-ls/releases/latest/download/elixir-ls.zip +unzip elixir-ls.zip -d /path/to/elixir-ls +# Unix +chmod +x /path/to/elixir-ls/language_server.sh +``` + +**By default, elixir-ls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of your unzipped elixir-ls. + +```lua +require'lspconfig'.elixirls.setup{ + -- Unix + cmd = { "/path/to/elixir-ls/language_server.sh" }; + -- Windows + cmd = { "/path/to/elixir-ls/language_server.bat" }; + ... +} +``` + +'root_dir' is chosen like this: if two or more directories containing `mix.exs` were found when searching directories upward, the second one (higher up) is chosen, with the assumption that it is the root of an umbrella app. Otherwise the directory containing the single mix.exs that was found is chosen. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.elixirls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "elixir", "eelixir", "heex", "surface" } + ``` + - `root_dir` : + ```lua + {{see description above}} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## elmls + +https://github.com/elm-tooling/elm-language-server#installation + +If you don't want to use Nvim to install it, then you can use: +```sh +npm install -g elm elm-test elm-format @elm-tooling/elm-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.elmls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "elm-language-server" } + ``` + - `filetypes` : + ```lua + { "elm" } + ``` + - `init_options` : + ```lua + { + disableElmLSDiagnostics = false, + elmReviewDiagnostics = "off", + onlyUpdateDiagnosticsOnSave = false, + skipInstallPackageConfirmation = false + } + ``` + - `root_dir` : + ```lua + root_pattern("elm.json") + ``` + + +## elp + +https://whatsapp.github.io/erlang-language-platform + +ELP integrates Erlang into modern IDEs via the language server protocol and was +inspired by rust-analyzer. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.elp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "elp", "server" } + ``` + - `filetypes` : + ```lua + { "erlang" } + ``` + - `root_dir` : + ```lua + root_pattern('rebar.config', 'erlang.mk', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ember + +https://github.com/ember-tooling/ember-language-server + +`ember-language-server` can be installed via `npm`: + +```sh +npm install -g @ember-tooling/ember-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ember.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ember-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "handlebars", "typescript", "javascript", "typescript.glimmer", "javascript.glimmer" } + ``` + - `root_dir` : + ```lua + root_pattern("ember-cli-build.js", ".git") + ``` + + +## emmet_language_server + +https://github.com/olrtg/emmet-language-server + +Package can be installed via `npm`: +```sh +npm install -g @olrtg/emmet-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.emmet_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "emmet-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "css", "eruby", "html", "htmldjango", "javascriptreact", "less", "pug", "sass", "scss", "typescriptreact" } + ``` + - `root_dir` : + ```lua + git root + ``` + - `single_file_support` : + ```lua + true + ``` + + +## emmet_ls + +https://github.com/aca/emmet-ls + +Package can be installed via `npm`: +```sh +npm install -g emmet-ls +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.emmet_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "emmet-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "astro", "css", "eruby", "html", "htmldjango", "javascriptreact", "less", "pug", "sass", "scss", "svelte", "typescriptreact", "vue" } + ``` + - `root_dir` : + ```lua + git root + ``` + - `single_file_support` : + ```lua + true + ``` + + +## erg_language_server + +https://github.com/erg-lang/erg#flags ELS + +ELS (erg-language-server) is a language server for the Erg programming language. + +erg-language-server can be installed via `cargo` and used as follows: + ```sh + cargo install erg --features els + erg --language-server + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.erg_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "erg", "--language-server" } + ``` + - `filetypes` : + ```lua + { "erg" } + ``` + - `root_dir` : + ```lua + root_pattern("package.er") or find_git_ancestor + ``` + + +## erlangls + +https://erlang-ls.github.io + +Language Server for Erlang. + +Clone [erlang_ls](https://github.com/erlang-ls/erlang_ls) +Compile the project with `make` and copy resulting binaries somewhere in your $PATH eg. `cp _build/*/bin/* ~/local/bin` + +Installation instruction can be found [here](https://github.com/erlang-ls/erlang_ls). + +Installation requirements: + - [Erlang OTP 21+](https://github.com/erlang/otp) + - [rebar3 3.9.1+](https://github.com/erlang/rebar3) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.erlangls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "erlang_ls" } + ``` + - `filetypes` : + ```lua + { "erlang" } + ``` + - `root_dir` : + ```lua + root_pattern('rebar.config', 'erlang.mk', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## esbonio + +https://github.com/swyddfa/esbonio + +Esbonio is a language server for [Sphinx](https://www.sphinx-doc.org/en/master/) documentation projects. +The language server can be installed via pip + +``` +pip install esbonio +``` + +Since Sphinx is highly extensible you will get best results if you install the language server in the same +Python environment as the one used to build your documentation. To ensure that the correct Python environment +is picked up, you can either launch `nvim` with the correct environment activated. + +``` +source env/bin/activate +nvim +``` + +Or you can modify the default `cmd` to include the full path to the Python interpreter. + +```lua +require'lspconfig'.esbonio.setup { + cmd = { '/path/to/virtualenv/bin/python', '-m', 'esbonio' } +} +``` + +Esbonio supports a number of config values passed as `init_options` on startup, for example. + +```lua +require'lspconfig'.esbonio.setup { + init_options = { + server = { + logLevel = "debug" + }, + sphinx = { + confDir = "/path/to/docs", + srcDir = "${confDir}/../docs-src" + } +} +``` + +A full list and explanation of the available options can be found [here](https://docs.esbon.io/en/esbonio-language-server-v0.16.4/lsp/getting-started.html?editor=neovim-lspconfig#configuration) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.esbonio.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "python3", "-m", "esbonio" } + ``` + - `filetypes` : + ```lua + { "rst" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## eslint + +https://github.com/hrsh7th/vscode-langservers-extracted + +`vscode-eslint-language-server` is a linting engine for JavaScript / Typescript. +It can be installed via `npm`: + +```sh +npm i -g vscode-langservers-extracted +``` + +`vscode-eslint-language-server` provides an `EslintFixAll` command that can be used to format a document on save: +```lua +lspconfig.eslint.setup({ + --- ... + on_attach = function(client, bufnr) + vim.api.nvim_create_autocmd("BufWritePre", { + buffer = bufnr, + command = "EslintFixAll", + }) + end, +}) +``` + +See [vscode-eslint](https://github.com/microsoft/vscode-eslint/blob/55871979d7af184bf09af491b6ea35ebd56822cf/server/src/eslintServer.ts#L216-L229) for configuration options. + +Messages handled in lspconfig: `eslint/openDoc`, `eslint/confirmESLintExecution`, `eslint/probeFailed`, `eslint/noLibrary` + +Additional messages you can handle: `eslint/noConfig` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.eslint.setup{} +``` +**Commands:** +- EslintFixAll: Fix all eslint problems for this buffer + +**Default values:** + - `cmd` : + ```lua + { "vscode-eslint-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx", "vue", "svelte", "astro" } + ``` + - `handlers` : + ```lua + { + ["eslint/confirmESLintExecution"] = <function 1>, + ["eslint/noLibrary"] = <function 2>, + ["eslint/openDoc"] = <function 3>, + ["eslint/probeFailed"] = <function 4> + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + codeAction = { + disableRuleComment = { + enable = true, + location = "separateLine" + }, + showDocumentation = { + enable = true + } + }, + codeActionOnSave = { + enable = false, + mode = "all" + }, + experimental = { + useFlatConfig = false + }, + format = true, + nodePath = "", + onIgnoredFiles = "off", + problems = { + shortenToSingleLine = false + }, + quiet = false, + rulesCustomizations = {}, + run = "onType", + useESLintClass = false, + validate = "on", + workingDirectory = { + mode = "location" + } + } + ``` + + +## facility_language_server + +https://github.com/FacilityApi/FacilityLanguageServer + +Facility language server protocol (LSP) support. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.facility_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "facility-language-server" } + ``` + - `filetypes` : + ```lua + { "fsd" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## fennel_language_server + +https://github.com/rydesun/fennel-language-server + +Fennel language server protocol (LSP) support. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fennel_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fennel-language-server" } + ``` + - `filetypes` : + ```lua + { "fennel" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## fennel_ls + +https://sr.ht/~xerool/fennel-ls/ + +A language server for fennel. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fennel_ls.setup{} +``` + + +**Default values:** + - `capabilities` : + ```lua + { + general = { + positionEncodings = { "utf-16" } + }, + offsetEncoding = { "utf-8", "utf-16" }, + textDocument = { + callHierarchy = { + dynamicRegistration = false + }, + codeAction = { + codeActionLiteralSupport = { + codeActionKind = { + valueSet = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" } + } + }, + dataSupport = true, + dynamicRegistration = true, + isPreferredSupport = true, + resolveSupport = { + properties = { "edit" } + } + }, + completion = { + completionItem = { + commitCharactersSupport = false, + deprecatedSupport = false, + documentationFormat = { "markdown", "plaintext" }, + preselectSupport = false, + snippetSupport = false + }, + completionItemKind = { + valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 } + }, + completionList = { + itemDefaults = { "editRange", "insertTextFormat", "insertTextMode", "data" } + }, + contextSupport = false, + dynamicRegistration = false + }, + declaration = { + linkSupport = true + }, + definition = { + dynamicRegistration = true, + linkSupport = true + }, + diagnostic = { + dynamicRegistration = false + }, + documentHighlight = { + dynamicRegistration = false + }, + documentSymbol = { + dynamicRegistration = false, + hierarchicalDocumentSymbolSupport = true, + symbolKind = { + valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } + } + }, + formatting = { + dynamicRegistration = true + }, + hover = { + contentFormat = { "markdown", "plaintext" }, + dynamicRegistration = true + }, + implementation = { + linkSupport = true + }, + inlayHint = { + dynamicRegistration = true, + resolveSupport = { + properties = { "textEdits", "tooltip", "location", "command" } + } + }, + publishDiagnostics = { + dataSupport = true, + relatedInformation = true, + tagSupport = { + valueSet = { 1, 2 } + } + }, + rangeFormatting = { + dynamicRegistration = true + }, + references = { + dynamicRegistration = false + }, + rename = { + dynamicRegistration = true, + prepareSupport = true + }, + semanticTokens = { + augmentsSyntaxTokens = true, + dynamicRegistration = false, + formats = { "relative" }, + multilineTokenSupport = false, + overlappingTokenSupport = true, + requests = { + full = { + delta = true + }, + range = false + }, + serverCancelSupport = false, + tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary" }, + tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator" } + }, + signatureHelp = { + dynamicRegistration = false, + signatureInformation = { + activeParameterSupport = true, + documentationFormat = { "markdown", "plaintext" }, + parameterInformation = { + labelOffsetSupport = true + } + } + }, + synchronization = { + didSave = true, + dynamicRegistration = false, + willSave = true, + willSaveWaitUntil = true + }, + typeDefinition = { + linkSupport = true + } + }, + window = { + showDocument = { + support = true + }, + showMessage = { + messageActionItem = { + additionalPropertiesSupport = false + } + }, + workDoneProgress = true + }, + workspace = { + applyEdit = true, + configuration = true, + didChangeConfiguration = { + dynamicRegistration = false + }, + didChangeWatchedFiles = { + dynamicRegistration = false, + relativePatternSupport = true + }, + inlayHint = { + refreshSupport = true + }, + semanticTokens = { + refreshSupport = true + }, + symbol = { + dynamicRegistration = false, + symbolKind = { + valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } + } + }, + workspaceEdit = { + resourceOperations = { "rename", "create", "delete" } + }, + workspaceFolders = true + } + } + ``` + - `cmd` : + ```lua + { "fennel-ls" } + ``` + - `filetypes` : + ```lua + { "fennel" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## flow + +https://flow.org/ +https://github.com/facebook/flow + +See below for how to setup Flow itself. +https://flow.org/en/docs/install/ + +See below for lsp command options. + +```sh +npx flow lsp --help +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.flow.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "npx", "--no-install", "flow", "lsp" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx" } + ``` + - `root_dir` : + ```lua + root_pattern(".flowconfig") + ``` + + +## flux_lsp + +https://github.com/influxdata/flux-lsp +`flux-lsp` can be installed via `cargo`: +```sh +cargo install --git https://github.com/influxdata/flux-lsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.flux_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "flux-lsp" } + ``` + - `filetypes` : + ```lua + { "flux" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## foam_ls + +https://github.com/FoamScience/foam-language-server + +`foam-language-server` can be installed via `npm` +```sh +npm install -g foam-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.foam_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "foam-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "foam", "OpenFOAM" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## fortls + +https://github.com/gnikit/fortls + +fortls is a Fortran Language Server, the server can be installed via pip + +```sh +pip install fortls +``` + +Settings to the server can be passed either through the `cmd` option or through +a local configuration file e.g. `.fortls`. For more information +see the `fortls` [documentation](https://gnikit.github.io/fortls/options.html). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fortls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fortls", "--notify_init", "--hover_signature", "--hover_language=fortran", "--use_signature_help" } + ``` + - `filetypes` : + ```lua + { "fortran" } + ``` + - `root_dir` : + ```lua + root_pattern(".fortls") + ``` + - `settings` : + ```lua + {} + ``` + + +## fsautocomplete + +https://github.com/fsharp/FsAutoComplete + +Language Server for F# provided by FsAutoComplete (FSAC). + +FsAutoComplete requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +The preferred way to install FsAutoComplete is with `dotnet tool install --global fsautocomplete`. + +Instructions to compile from source are found on the main [repository](https://github.com/fsharp/FsAutoComplete). + +You may also need to configure the filetype as Vim defaults to Forth for `*.fs` files: + +`autocmd BufNewFile,BufRead *.fs,*.fsx,*.fsi set filetype=fsharp` + +This is automatically done by plugins such as [PhilT/vim-fsharp](https://github.com/PhilT/vim-fsharp), [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp), and [adelarsq/neofsharp.vim](https://github.com/adelarsq/neofsharp.vim). + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fsautocomplete.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fsautocomplete", "--adaptive-lsp-server-enabled" } + ``` + - `filetypes` : + ```lua + { "fsharp" } + ``` + - `init_options` : + ```lua + { + AutomaticWorkspaceInit = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## fsharp_language_server + +F# Language Server +https://github.com/faldor20/fsharp-language-server + +An implementation of the language server protocol using the F# Compiler Service. + +Build the project from source and override the command path to location of DLL. + +If filetype determination is not already performed by an available plugin ([PhilT/vim-fsharp](https://github.com/PhilT/vim-fsharp), [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp), and [adelarsq/neofsharp.vim](https://github.com/adelarsq/neofsharp.vim). +), then the following must be added to initialization configuration: + + +`autocmd BufNewFile,BufRead *.fs,*.fsx,*.fsi set filetype=fsharp` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fsharp_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "dotnet", "FSharpLanguageServer.dll" } + ``` + - `filetypes` : + ```lua + { "fsharp" } + ``` + - `init_options` : + ```lua + { + AutomaticWorkspaceInit = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## fstar + +https://github.com/FStarLang/FStar + +LSP support is included in FStar. Make sure `fstar.exe` is in your PATH. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.fstar.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "fstar.exe", "--lsp" } + ``` + - `filetypes` : + ```lua + { "fstar" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## futhark_lsp + +https://github.com/diku-dk/futhark + +Futhark Language Server + +This language server comes with the futhark compiler and is run with the command +``` +futhark lsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.futhark_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "futhark", "lsp" } + ``` + - `filetypes` : + ```lua + { "futhark", "fut" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## gdscript + +https://github.com/godotengine/godot + +Language server for GDScript, used by Godot Engine. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gdscript.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + see source file + ``` + - `filetypes` : + ```lua + { "gd", "gdscript", "gdscript3" } + ``` + - `root_dir` : + ```lua + util.root_pattern("project.godot", ".git") + ``` + + +## gdshader_lsp + +https://github.com/godofavacyn/gdshader-lsp + +A language server for the Godot Shading language. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gdshader_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "gdshader-lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "gdshader", "gdshaderinc" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## ghcide + +https://github.com/digital-asset/ghcide + +A library for building Haskell IDE tooling. +"ghcide" isn't for end users now. Use "haskell-language-server" instead of "ghcide". + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ghcide.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ghcide", "--lsp" } + ``` + - `filetypes` : + ```lua + { "haskell", "lhaskell" } + ``` + - `root_dir` : + ```lua + root_pattern("stack.yaml", "hie-bios", "BUILD.bazel", "cabal.config", "package.yaml") + ``` + + +## ghdl_ls + +https://github.com/ghdl/ghdl-language-server + +A language server for VHDL, using ghdl as its backend. + +`ghdl-ls` is part of pyghdl, for installation instructions see +[the upstream README](https://github.com/ghdl/ghdl/tree/master/pyGHDL/lsp). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ghdl_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ghdl-ls" } + ``` + - `filetypes` : + ```lua + { "vhdl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ginko_ls + +`ginko_ls` is meant to be a feature-complete language server for device-trees. +Language servers can be used in many editors, such as Visual Studio Code, Emacs +or Vim + +Install `ginko_ls` from https://github.com/Schottkyc137/ginko and add it to path + +`ginko_ls` doesn't require any configuration. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ginko_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ginko_ls" } + ``` + - `filetypes` : + ```lua + { "dts" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## gitlab_ci_ls + +https://github.com/alesbrelih/gitlab-ci-ls + +Language Server for Gitlab CI + +`gitlab-ci-ls` can be installed via cargo: +cargo install gitlab-ci-ls + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gitlab_ci_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "gitlab-ci-ls" } + ``` + - `filetypes` : + ```lua + { "yaml.gitlab" } + ``` + - `init_options` : + ```lua + { + cache_path = "util.path.join(vim.loop.os_homedir(), '.cache/gitlab-ci-ls/')", + log_path = "util.path.join(util.path.join(vim.loop.os_homedir(), '.cache/gitlab-ci-ls/'), 'log/gitlab-ci-ls.log')" + } + ``` + - `root_dir` : + ```lua + util.root_pattern('.gitlab*', '.git') + ``` + + +## gleam + +https://github.com/gleam-lang/gleam + +A language server for Gleam Programming Language. +[Installation](https://gleam.run/getting-started/installing/) + +It can be i + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gleam.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "gleam", "lsp" } + ``` + - `filetypes` : + ```lua + { "gleam" } + ``` + - `root_dir` : + ```lua + root_pattern("gleam.toml", ".git") + ``` + + +## glint + + https://github.com/typed-ember/glint + + https://typed-ember.gitbook.io/glint/ + + `glint-language-server` is installed when adding `@glint/core` to your project's devDependencies: + + ```sh + npm install @glint/core --save-dev + ``` + + or + + ```sh + yarn add -D @glint/core + ``` + + or + + ```sh + pnpm add -D @glint/core + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.glint.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "glint-language-server" } + ``` + - `filetypes` : + ```lua + { "html.handlebars", "handlebars", "typescript", "typescript.glimmer", "javascript", "javascript.glimmer" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## glsl_analyzer + +https://github.com/nolanderc/glsl_analyzer + +Language server for GLSL + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.glsl_analyzer.setup{} +``` + + +**Default values:** + - `capabilities` : + ```lua + {} + ``` + - `cmd` : + ```lua + { "glsl_analyzer" } + ``` + - `filetypes` : + ```lua + { "glsl", "vert", "tesc", "tese", "frag", "geom", "comp" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## glslls + +https://github.com/svenstaro/glsl-language-server + +Language server implementation for GLSL + +`glslls` can be compiled and installed manually, or, if your distribution has access to the AUR, +via the `glsl-language-server` AUR package + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.glslls.setup{} +``` + + +**Default values:** + - `capabilities` : + ```lua + { + offsetEncoding = { "utf-8", "utf-16" }, + textDocument = { + completion = { + editsNearCursor = true + } + } + } + ``` + - `cmd` : + ```lua + { "glslls", "--stdin" } + ``` + - `filetypes` : + ```lua + { "glsl", "vert", "tesc", "tese", "frag", "geom", "comp" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## golangci_lint_ls + +Combination of both lint server and client + +https://github.com/nametake/golangci-lint-langserver +https://github.com/golangci/golangci-lint + + +Installation of binaries needed is done via + +``` +go install github.com/nametake/golangci-lint-langserver@latest +go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.golangci_lint_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "golangci-lint-langserver" } + ``` + - `filetypes` : + ```lua + { "go", "gomod" } + ``` + - `init_options` : + ```lua + { + command = { "golangci-lint", "run", "--out-format", "json" } + } + ``` + - `root_dir` : + ```lua + root_pattern('.golangci.yml', '.golangci.yaml', '.golangci.toml', '.golangci.json', 'go.work', 'go.mod', '.git') + ``` + + +## gopls + +https://github.com/golang/tools/tree/master/gopls + +Google's lsp server for golang. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gopls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "gopls" } + ``` + - `filetypes` : + ```lua + { "go", "gomod", "gowork", "gotmpl" } + ``` + - `root_dir` : + ```lua + root_pattern("go.work", "go.mod", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## gradle_ls + +https://github.com/microsoft/vscode-gradle + +Microsoft's lsp server for gradle files + +If you're setting this up manually, build vscode-gradle using `./gradlew installDist` and point `cmd` to the `gradle-language-server` generated in the build directory + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.gradle_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "gradle-language-server" } + ``` + - `filetypes` : + ```lua + { "groovy" } + ``` + - `init_options` : + ```lua + { + settings = { + gradleWrapperEnabled = true + } + } + ``` + - `root_dir` : + ```lua + root_pattern("settings.gradle", "build.gradle") + ``` + + +## grammarly + +https://github.com/znck/grammarly + +`grammarly-languageserver` can be installed via `npm`: + +```sh +npm i -g grammarly-languageserver +``` + +WARNING: Since this language server uses Grammarly's API, any document you open with it running is shared with them. Please evaluate their [privacy policy](https://www.grammarly.com/privacy-policy) before using this. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.grammarly.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "grammarly-languageserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `handlers` : + ```lua + { + ["$/updateDocumentState"] = <function 1> + } + ``` + - `init_options` : + ```lua + { + clientId = "client_BaDkMgx4X19X9UxxYRCXZo" + } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## graphql + +https://github.com/graphql/graphiql/tree/main/packages/graphql-language-service-cli + +`graphql-lsp` can be installed via `npm`: + +```sh +npm install -g graphql-language-service-cli +``` + +Note that you must also have [the graphql package](https://github.com/graphql/graphql-js) installed within your project and create a [GraphQL config file](https://the-guild.dev/graphql/config/docs). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.graphql.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "graphql-lsp", "server", "-m", "stream" } + ``` + - `filetypes` : + ```lua + { "graphql", "typescriptreact", "javascriptreact" } + ``` + - `root_dir` : + ```lua + util.root_pattern('.git', '.graphqlrc*', '.graphql.config.*', 'graphql.config.*') + ``` + + +## groovyls + +https://github.com/prominic/groovy-language-server.git + +Requirements: + - Linux/macOS (for now) + - Java 11+ + +`groovyls` can be installed by following the instructions [here](https://github.com/prominic/groovy-language-server.git#build). + +If you have installed groovy language server, you can set the `cmd` custom path as follow: + +```lua +require'lspconfig'.groovyls.setup{ + -- Unix + cmd = { "java", "-jar", "path/to/groovyls/groovy-language-server-all.jar" }, + ... +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.groovyls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "java", "-jar", "groovy-language-server-all.jar" } + ``` + - `filetypes` : + ```lua + { "groovy" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## guile_ls + +https://codeberg.org/rgherdt/scheme-lsp-server + +The recommended way is to install guile-lsp-server is using Guix. Unfortunately it is still not available at the official Guix channels, but you can use the provided channel guix.scm in the repo: +```sh +guix package -f guix.scm +``` + +Checkout the repo for more info. + +Note: This LSP will start on `scheme.guile` filetype. You can set this file type using `:help modeline` or adding https://gitlab.com/HiPhish/guile.vim to your plugins to automatically set it. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.guile_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "guile-lsp-server" } + ``` + - `filetypes` : + ```lua + { "scheme.guile" } + ``` + - `root_dir` : + ```lua + root_pattern("guix.scm", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## harper_ls + +https://github.com/chilipepperhott/harper + +The language server for Harper, the slim, clean language checker for developers. + +See [docs](https://github.com/chilipepperhott/harper/tree/master/harper-ls#configuration) for more information on settings. + +In short, however, they should look something like this: +```lua +lspconfig.harper_ls.setup { + settings = { + ["harper-ls"] = { + userDictPath = "~/dict.txt" + } + }, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.harper_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "harper-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown", "rust", "typescript", "typescriptreact", "javascript", "python", "go", "c", "cpp", "ruby", "swift", "csharp", "toml", "lua" } + ``` + - `root_dir` : + ```lua + bufdir + ``` + - `single_file_support` : + ```lua + true + ``` + + +## haxe_language_server + +https://github.com/vshaxe/haxe-language-server + +The Haxe language server can be built by running the following commands from +the project's root directory: + + npm install + npx lix run vshaxe-build -t language-server + +This will create `bin/server.js`. Note that the server requires Haxe 3.4.0 or +higher. + +After building the language server, set the `cmd` setting in your setup +function: + +```lua +lspconfig.haxe_language_server.setup({ + cmd = {"node", "path/to/bin/server.js"}, +}) +``` + +By default, an HXML compiler arguments file named `build.hxml` is expected in +your project's root directory. If your file is named something different, +specify it using the `init_options.displayArguments` setting. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.haxe_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "haxe-language-server" } + ``` + - `filetypes` : + ```lua + { "haxe" } + ``` + - `init_options` : + ```lua + { + displayArguments = { "build.hxml" } + } + ``` + - `root_dir` : + ```lua + root_pattern("*.hxml") + ``` + - `settings` : + ```lua + { + haxe = { + executable = "haxe" + } + } + ``` + + +## hdl_checker + +https://github.com/suoto/hdl_checker +Language server for hdl-checker. +Install using: `pip install hdl-checker --upgrade` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hdl_checker.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hdl_checker", "--lsp" } + ``` + - `filetypes` : + ```lua + { "vhdl", "verilog", "systemverilog" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## helm_ls + +https://github.com/mrjosh/helm-ls + +Helm Language server. (This LSP is in early development) + +`helm Language server` can be installed by following the instructions [here](https://github.com/mrjosh/helm-ls). + +The default `cmd` assumes that the `helm_ls` binary can be found in `$PATH`. + +If need Helm file highlight use [vim-helm](https://github.com/towolf/vim-helm) plugin. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.helm_ls.setup{} +``` + + +**Default values:** + - `capabilities` : + ```lua + default capabilities, with dynamicRegistration for didChangeWatchedFiles true + ``` + - `cmd` : + ```lua + { "helm_ls", "serve" } + ``` + - `filetypes` : + ```lua + { "helm" } + ``` + - `root_dir` : + ```lua + root_pattern("Chart.yaml") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## hhvm + +Language server for programs written in Hack +https://hhvm.com/ +https://github.com/facebook/hhvm +See below for how to setup HHVM & typechecker: +https://docs.hhvm.com/hhvm/getting-started/getting-started + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hhvm.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hh_client", "lsp" } + ``` + - `filetypes` : + ```lua + { "php", "hack" } + ``` + - `root_dir` : + ```lua + root_pattern(".hhconfig") + ``` + + +## hie + +https://github.com/haskell/haskell-ide-engine + +the following init_options are supported (see https://github.com/haskell/haskell-ide-engine#configuration): +```lua +init_options = { + languageServerHaskell = { + hlintOn = bool; + maxNumberOfProblems = number; + diagnosticsDebounceDuration = number; + liquidOn = bool (default false); + completionSnippetsOn = bool (default true); + formatOnImportOn = bool (default true); + formattingProvider = string (default "brittany", alternate "floskell"); + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hie.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hie-wrapper", "--lsp" } + ``` + - `filetypes` : + ```lua + { "haskell" } + ``` + - `root_dir` : + ```lua + root_pattern("stack.yaml", "package.yaml", ".git") + ``` + + +## hlasm + + `hlasm_language_server` is a language server for the High Level Assembler language used on IBM SystemZ mainframes. + + To learn how to configure the HLASM language server, see the [HLASM Language Support documentation](https://github.com/eclipse-che4z/che-che4z-lsp-for-hlasm). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hlasm.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hlasm_language_server" } + ``` + - `filetypes` : + ```lua + { "hlasm" } + ``` + - `root_dir` : + ```lua + root_pattern(".hlasmplugin") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## hls + +https://github.com/haskell/haskell-language-server + +Haskell Language Server + +If you are using HLS 1.9.0.0, enable the language server to launch on Cabal files as well: + +```lua +require('lspconfig')['hls'].setup{ + filetypes = { 'haskell', 'lhaskell', 'cabal' }, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "haskell-language-server-wrapper", "--lsp" } + ``` + - `filetypes` : + ```lua + { "haskell", "lhaskell" } + ``` + - `lspinfo` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("hie.yaml", "stack.yaml", "cabal.project", "*.cabal", "package.yaml") + ``` + - `settings` : + ```lua + { + haskell = { + cabalFormattingProvider = "cabalfmt", + formattingProvider = "ormolu" + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## hoon_ls + +https://github.com/urbit/hoon-language-server + +A language server for Hoon. + +The language server can be installed via `npm install -g @hoon-language-server` + +Start a fake ~zod with `urbit -F zod`. +Start the language server at the Urbit Dojo prompt with: `|start %language-server` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hoon_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hoon-language-server" } + ``` + - `filetypes` : + ```lua + { "hoon" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## html + +https://github.com/hrsh7th/vscode-langservers-extracted + +`vscode-html-language-server` can be installed via `npm`: +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-html-language-server` only provides completions when snippet support is enabled. +To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +The code-formatting feature of the lsp can be controlled with the `provideFormatter` option. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.html.setup { + capabilities = capabilities, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.html.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vscode-html-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "html", "templ" } + ``` + - `init_options` : + ```lua + { + configurationSection = { "html", "css", "javascript" }, + embeddedLanguages = { + css = true, + javascript = true + }, + provideFormatter = true + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## htmx + +https://github.com/ThePrimeagen/htmx-lsp + +`htmx-lsp` can be installed via `cargo`: +```sh +cargo install htmx-lsp +``` + +Lsp is still very much work in progress and experimental. Use at your own risk. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.htmx.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "htmx-lsp" } + ``` + - `filetypes` : + ```lua + { "html", "templ" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## hydra_lsp + +https://github.com/Retsediv/hydra-lsp + +LSP for Hydra Python package config files. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hydra_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hydra-lsp" } + ``` + - `filetypes` : + ```lua + { "yaml" } + ``` + - `root_dir` : + ```lua + util.root_pattern '.git' + ``` + - `single_file_support` : + ```lua + true + ``` + + +## hyprls + +https://github.com/hyprland-community/hyprls + +`hyprls` can be installed via `go`: +```sh +go install github.com/ewen-lbh/hyprls/cmd/hyprls@latest +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.hyprls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "hyprls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "*.hl", "hypr*.conf", ".config/hypr/*.conf" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## idris2_lsp + +https://github.com/idris-community/idris2-lsp + +The Idris 2 language server. + +Plugins for the Idris 2 filetype include +[Idris2-Vim](https://github.com/edwinb/idris2-vim) (fewer features, stable) and +[Nvim-Idris2](https://github.com/ShinKage/nvim-idris2) (cutting-edge, +experimental). + +Idris2-Lsp requires a build of Idris 2 that includes the "Idris 2 API" package. +Package managers with known support for this build include the +[AUR](https://aur.archlinux.org/packages/idris2/) and +[Homebrew](https://formulae.brew.sh/formula/idris2#default). + +If your package manager does not support the Idris 2 API, you will need to build +Idris 2 from source. Refer to the +[the Idris 2 installation instructions](https://github.com/idris-lang/Idris2/blob/main/INSTALL.md) +for details. Steps 5 and 8 are listed as "optional" in that guide, but they are +necessary in order to make the Idris 2 API available. + +You need to install a version of Idris2-Lsp that is compatible with your +version of Idris 2. There should be a branch corresponding to every released +Idris 2 version after v0.4.0. Use the latest commit on that branch. For example, +if you have Idris v0.5.1, you should use the v0.5.1 branch of Idris2-Lsp. + +If your Idris 2 version is newer than the newest Idris2-Lsp branch, use the +latest commit on the `master` branch, and set a reminder to check the Idris2-Lsp +repo for the release of a compatible versioned branch. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.idris2_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "idris2-lsp" } + ``` + - `filetypes` : + ```lua + { "idris2" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## intelephense + +https://intelephense.com/ + +`intelephense` can be installed via `npm`: +```sh +npm install -g intelephense +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.intelephense.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "intelephense", "--stdio" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("composer.json", ".git") + ``` + + +## java_language_server + +https://github.com/georgewfraser/java-language-server + +Java language server + +Point `cmd` to `lang_server_linux.sh` or the equivalent script for macOS/Windows provided by java-language-server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.java_language_server.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "java" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## jdtls + +https://projects.eclipse.org/projects/eclipse.jdt.ls + +Language server for Java. + +IMPORTANT: If you want all the features jdtls has to offer, [nvim-jdtls](https://github.com/mfussenegger/nvim-jdtls) +is highly recommended. If all you need is diagnostics, completion, imports, gotos and formatting and some code actions +you can keep reading here. + +For manual installation you can download precompiled binaries from the +[official downloads site](http://download.eclipse.org/jdtls/snapshots/?d) +and ensure that the `PATH` variable contains the `bin` directory of the extracted archive. + +```lua + -- init.lua + require'lspconfig'.jdtls.setup{} +``` + +You can also pass extra custom jvm arguments with the JDTLS_JVM_ARGS environment variable as a space separated list of arguments, +that will be converted to multiple --jvm-arg=<param> args when passed to the jdtls script. This will allow for example tweaking +the jvm arguments or integration with external tools like lombok: + +```sh +export JDTLS_JVM_ARGS="-javaagent:$HOME/.local/share/java/lombok.jar" +``` + +For automatic installation you can use the following unofficial installers/launchers under your own risk: + - [jdtls-launcher](https://github.com/eruizc-dev/jdtls-launcher) (Includes lombok support by default) + ```lua + -- init.lua + require'lspconfig'.jdtls.setup{ cmd = { 'jdtls' } } + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jdtls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "jdtls", "-configuration", "/home/user/.cache/jdtls/config", "-data", "/home/user/.cache/jdtls/workspace" } + ``` + - `filetypes` : + ```lua + { "java" } + ``` + - `handlers` : + ```lua + { + ["language/status"] = <function 1>, + ["textDocument/codeAction"] = <function 2>, + ["textDocument/rename"] = <function 3>, + ["workspace/applyEdit"] = <function 4> + } + ``` + - `init_options` : + ```lua + { + jvm_args = {}, + workspace = "/home/user/.cache/jdtls/workspace" + } + ``` + - `root_dir` : + ```lua + { + -- Single-module projects + { + 'build.xml', -- Ant + 'pom.xml', -- Maven + 'settings.gradle', -- Gradle + 'settings.gradle.kts', -- Gradle + }, + -- Multi-module projects + { 'build.gradle', 'build.gradle.kts' }, + } or vim.fn.getcwd() + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jedi_language_server + +https://github.com/pappasam/jedi-language-server + +`jedi-language-server`, a language server for Python, built on top of jedi + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jedi_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "jedi-language-server" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + vim's starting directory + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jinja_lsp + +jinja-lsp enhances minijinja development experience by providing Helix/Nvim users with advanced features such as autocomplete, syntax highlighting, hover, goto definition, code actions and linting. + +The file types are not detected automatically, you can register them manually (see below) or override the filetypes: + +```lua +vim.filetype.add { + extension = { + jinja = 'jinja', + jinja2 = 'jinja', + j2 = 'jinja', + }, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jinja_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "jinja-lsp" } + ``` + - `filetypes` : + ```lua + { "jinja" } + ``` + - `name` : + ```lua + "jinja_lsp" + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jqls + +https://github.com/wader/jq-lsp +Language server for jq, written using Go. +You can install the server easily using go install: +```sh +# install directly +go install github.com/wader/jq-lsp@master +# copy binary to $PATH +cp $(go env GOPATH)/bin/jq-lsp /usr/local/bin +``` +Note: To activate properly nvim needs to know the jq filetype. +You can add it via: +```lua +vim.cmd(\[\[au BufRead,BufNewFile *.jq setfiletype jq\]\]) +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jqls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "jq-lsp" } + ``` + - `filetypes` : + ```lua + { "jq" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jsonls + +https://github.com/hrsh7th/vscode-langservers-extracted + +vscode-json-language-server, a language server for JSON and JSON schema + +`vscode-json-language-server` can be installed via `npm`: +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-json-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.jsonls.setup { + capabilities = capabilities, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jsonls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vscode-json-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "json", "jsonc" } + ``` + - `init_options` : + ```lua + { + provideFormatter = true + } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## jsonnet_ls + +https://github.com/grafana/jsonnet-language-server + +A Language Server Protocol (LSP) server for Jsonnet. + +The language server can be installed with `go`: +```sh +go install github.com/grafana/jsonnet-language-server@latest +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.jsonnet_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "jsonnet-language-server" } + ``` + - `filetypes` : + ```lua + { "jsonnet", "libsonnet" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("jsonnetfile.json") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## julials + +https://github.com/julia-vscode/julia-vscode + +LanguageServer.jl can be installed with `julia` and `Pkg`: +```sh +julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.add("LanguageServer")' +``` +where `~/.julia/environments/nvim-lspconfig` is the location where +the default configuration expects LanguageServer.jl to be installed. + +To update an existing install, use the following command: +```sh +julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.update()' +``` + +Note: In order to have LanguageServer.jl pick up installed packages or dependencies in a +Julia project, you must make sure that the project is instantiated: +```sh +julia --project=/path/to/my/project -e 'using Pkg; Pkg.instantiate()' +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.julials.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "julia", "--startup-file=no", "--history-file=no", "-e", ' # Load LanguageServer.jl: attempt to load from ~/.julia/environments/nvim-lspconfig\n # with the regular load path as a fallback\n ls_install_path = joinpath(\n get(DEPOT_PATH, 1, joinpath(homedir(), ".julia")),\n "environments", "nvim-lspconfig"\n )\n pushfirst!(LOAD_PATH, ls_install_path)\n using LanguageServer\n popfirst!(LOAD_PATH)\n depot_path = get(ENV, "JULIA_DEPOT_PATH", "")\n project_path = let\n dirname(something(\n ## 1. Finds an explicitly set project (JULIA_PROJECT)\n Base.load_path_expand((\n p = get(ENV, "JULIA_PROJECT", nothing);\n p === nothing ? nothing : isempty(p) ? nothing : p\n )),\n ## 2. Look for a Project.toml file in the current working directory,\n ## or parent directories, with $HOME as an upper boundary\n Base.current_project(),\n ## 3. First entry in the load path\n get(Base.load_path(), 1, nothing),\n ## 4. Fallback to default global environment,\n ## this is more or less unreachable\n Base.load_path_expand("@v#.#"),\n ))\n end\n @info "Running language server" VERSION pwd() project_path depot_path\n server = LanguageServer.LanguageServerInstance(stdin, stdout, project_path, depot_path)\n server.runlinter = true\n run(server)\n ' } + ``` + - `filetypes` : + ```lua + { "julia" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## koka + + https://koka-lang.github.io/koka/doc/index.html +Koka is a functional programming language with effect types and handlers. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.koka.setup{} +``` + + +**Default values:** + - `capabilities` : + ```lua + default capabilities, with offsetEncoding utf-8 + ``` + - `cmd` : + ```lua + { "koka", "--language-server" } + ``` + - `filetypes` : + ```lua + { "kk" } + ``` + - `root_dir` : + ```lua + + ``` + - `single_file_support` : + ```lua + true + ``` + + +## kotlin_language_server + + A kotlin language server which was developed for internal usage and + released afterwards. Maintaining is not done by the original author, + but by fwcd. + + It is built via gradle and developed on github. + Source and additional description: + https://github.com/fwcd/kotlin-language-server + + This server requires vim to be aware of the kotlin-filetype. + You could refer for this capability to: + https://github.com/udalov/kotlin-vim (recommended) + Note that there is no LICENSE specified yet. + + For faster startup, you can setup caching by specifying a storagePath + in the init_options. The default is your home directory. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.kotlin_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "kotlin-language-server" } + ``` + - `filetypes` : + ```lua + { "kotlin" } + ``` + - `init_options` : + ```lua + { + storagePath = "Enables caching and use project root to store cache data. See source" + } + ``` + - `root_dir` : + ```lua + See source + ``` + + +## lean3ls + +https://github.com/leanprover/lean-client-js/tree/master/lean-language-server + +Lean installation instructions can be found +[here](https://leanprover-community.github.io/get_started.html#regular-install). + +Once Lean is installed, you can install the Lean 3 language server by running +```sh +npm install -g lean-language-server +``` + +Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim), +that plugin fully handles the setup of the Lean language server, +and you shouldn't set up `lean3ls` both with it and `lspconfig`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lean3ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lean-language-server", "--stdio", "--", "-M", "4096", "-T", "100000" } + ``` + - `filetypes` : + ```lua + { "lean3" } + ``` + - `offset_encoding` : + ```lua + "utf-32" + ``` + - `root_dir` : + ```lua + root_pattern("leanpkg.toml") or root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## leanls + +https://github.com/leanprover/lean4 + +Lean installation instructions can be found +[here](https://leanprover-community.github.io/get_started.html#regular-install). + +The Lean 4 language server is built-in with a Lean 4 install +(and can be manually run with, e.g., `lean --server`). + +Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim), +that plugin fully handles the setup of the Lean language server, +and you shouldn't set up `leanls` both with it and `lspconfig`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.leanls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lake", "serve", "--" } + ``` + - `filetypes` : + ```lua + { "lean" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `options` : + ```lua + { + no_lake_lsp_cmd = { "lean", "--server" } + } + ``` + - `root_dir` : + ```lua + root_pattern("lakefile.lean", "lean-toolchain", "leanpkg.toml", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## lelwel_ls + +https://github.com/0x2a-42/lelwel + +Language server for lelwel grammars. + +You can install `lelwel-ls` via cargo: +```sh +cargo install --features="lsp" lelwel +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lelwel_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lelwel-ls" } + ``` + - `filetypes` : + ```lua + { "llw" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## lemminx + +https://github.com/eclipse/lemminx + +The easiest way to install the server is to get a binary from https://github.com/redhat-developer/vscode-xml/releases and place it on your PATH. + +NOTE to macOS users: Binaries from unidentified developers are blocked by default. If you trust the downloaded binary, run it once, cancel the prompt, then remove the binary from Gatekeeper quarantine with `xattr -d com.apple.quarantine lemminx`. It should now run without being blocked. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lemminx.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lemminx" } + ``` + - `filetypes` : + ```lua + { "xml", "xsd", "xsl", "xslt", "svg" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## lexical + + https://github.com/lexical-lsp/lexical + + Lexical is a next-generation language server for the Elixir programming language. + + Follow the [Detailed Installation Instructions](https://github.com/lexical-lsp/lexical/blob/main/pages/installation.md) + + **By default, `lexical` doesn't have a `cmd` set.** + This is because nvim-lspconfig does not make assumptions about your path. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lexical.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "elixir", "eelixir", "heex", "surface" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ltex + +https://github.com/valentjn/ltex-ls + +LTeX Language Server: LSP language server for LanguageTool 🔍✔️ with support for LaTeX 🎓, Markdown 📝, and others + +To install, download the latest [release](https://github.com/valentjn/ltex-ls/releases) and ensure `ltex-ls` is on your path. + +This server accepts configuration via the `settings` key. + +```lua + settings = { + ltex = { + language = "en-GB", + }, + }, +``` + +To support org files or R sweave, users can define a custom filetype autocommand (or use a plugin which defines these filetypes): + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.org set filetype=org ]] +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ltex.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ltex-ls" } + ``` + - `filetypes` : + ```lua + { "bib", "gitcommit", "markdown", "org", "plaintex", "rst", "rnoweb", "tex", "pandoc", "quarto", "rmd", "context", "html", "xhtml", "mail", "text" } + ``` + - `get_language_id` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + ltex = { + enabled = { "bibtex", "gitcommit", "markdown", "org", "tex", "restructuredtext", "rsweave", "latex", "quarto", "rmd", "context", "html", "xhtml", "mail", "plaintext" } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## lua_ls + +https://github.com/luals/lua-language-server + +Lua language server. + +`lua-language-server` can be installed by following the instructions [here](https://luals.github.io/#neovim-install). + +The default `cmd` assumes that the `lua-language-server` binary can be found in `$PATH`. + +If you primarily use `lua-language-server` for Neovim, and want to provide completions, +analysis, and location handling for plugins on runtime path, you can use the following +settings. + +```lua +require'lspconfig'.lua_ls.setup { + on_init = function(client) + local path = client.workspace_folders[1].name + if vim.loop.fs_stat(path..'/.luarc.json') or vim.loop.fs_stat(path..'/.luarc.jsonc') then + return + end + + client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { + runtime = { + -- Tell the language server which version of Lua you're using + -- (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT' + }, + -- Make the server aware of Neovim runtime files + workspace = { + checkThirdParty = false, + library = { + vim.env.VIMRUNTIME + -- Depending on the usage, you might want to add additional paths here. + -- "${3rd}/luv/library" + -- "${3rd}/busted/library", + } + -- or pull in all of 'runtimepath'. NOTE: this is a lot slower + -- library = vim.api.nvim_get_runtime_file("", true) + } + }) + end, + settings = { + Lua = {} + } +} +``` + +See `lua-language-server`'s [documentation](https://luals.github.io/wiki/settings/) for an explanation of the above fields: +* [Lua.runtime.path](https://luals.github.io/wiki/settings/#runtimepath) +* [Lua.workspace.library](https://luals.github.io/wiki/settings/#workspacelibrary) + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lua_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lua-language-server" } + ``` + - `filetypes` : + ```lua + { "lua" } + ``` + - `log_level` : + ```lua + 2 + ``` + - `root_dir` : + ```lua + root_pattern(".luarc.json", ".luarc.jsonc", ".luacheckrc", ".stylua.toml", "stylua.toml", "selene.toml", "selene.yml", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## luau_lsp + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.luau_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "luau-lsp", "lsp" } + ``` + - `filetypes` : + ```lua + { "luau" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## lwc_ls + +https://github.com/forcedotcom/lightning-language-server/ + +Language server for Lightning Web Components. + +For manual installation, utilize the official [NPM package](https://www.npmjs.com/package/@salesforce/lwc-language-server). +Then, configure `cmd` to run the Node script at the unpacked location: + +```lua +require'lspconfig'.lwc_ls.setup { + cmd = { + 'node', + '/path/to/node_modules/@salesforce/lwc-language-server/bin/lwc-language-server.js', + '--stdio' + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.lwc_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "lwc-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "javascript", "html" } + ``` + - `init_options` : + ```lua + { + embeddedLanguages = { + javascript = true + } + } + ``` + - `root_dir` : + ```lua + root_pattern('sfdx-project.json') + ``` + + +## m68k + +https://github.com/grahambates/m68k-lsp + +Language server for Motorola 68000 family assembly + +`m68k-lsp-server` can be installed via `npm`: + +```sh +npm install -g m68k-lsp-server +``` + +Ensure you are using the 68k asm syntax variant in Neovim. + +```lua +vim.g.asmsyntax = 'asm68k' +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.m68k.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "m68k-lsp-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "asm68k" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## markdown_oxide + +https://github.com/Feel-ix-343/markdown-oxide + +Let's record your consciousness! Bring your own text editor! +Implemented as a language server compatible with any text +editor, Markdown-Oxide is attempting to be the best PKM +system for software enthusiasts. + +Check the readme to see how to properly setup nvim-cmp. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.markdown_oxide.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "markdown-oxide" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## marksman + +https://github.com/artempyanykh/marksman + +Marksman is a Markdown LSP server providing completion, cross-references, diagnostics, and more. + +Marksman works on MacOS, Linux, and Windows and is distributed as a self-contained binary for each OS. + +Pre-built binaries can be downloaded from https://github.com/artempyanykh/marksman/releases + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.marksman.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "marksman", "server" } + ``` + - `filetypes` : + ```lua + { "markdown", "markdown.mdx" } + ``` + - `root_dir` : + ```lua + root_pattern(".git", ".marksman.toml") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## matlab_ls + +https://github.com/mathworks/MATLAB-language-server + +MATLAB® language server implements the Microsoft® Language Server Protocol for the MATLAB language. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.matlab_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "matlab-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "matlab" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + MATLAB = { + indexWorkspace = false, + installPath = "", + matlabConnectionTiming = "onStart", + telemetry = true + } + } + ``` + - `single_file_support` : + ```lua + false + ``` + + +## mdx_analyzer + +https://github.com/mdx-js/mdx-analyzer + +`mdx-analyzer`, a language server for MDX + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mdx_analyzer.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mdx-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown.mdx" } + ``` + - `init_options` : + ```lua + { + typescript = {} + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## mesonlsp + +https://github.com/JCWasmx86/mesonlsp + +An unofficial, unendorsed language server for meson written in C++ + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mesonlsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mesonlsp", "--lsp" } + ``` + - `filetypes` : + ```lua + { "meson" } + ``` + - `root_dir` : + ```lua + util.root_pattern("meson_options.txt", "meson.options", ".git") + ``` + + +## metals + +https://scalameta.org/metals/ + +Scala language server with rich IDE features. + +See full instructions in the Metals documentation: + +https://scalameta.org/metals/docs/editors/vim#using-an-alternative-lsp-client + +Note: that if you're using [nvim-metals](https://github.com/scalameta/nvim-metals), that plugin fully handles the setup and installation of Metals, and you shouldn't set up Metals both with it and `lspconfig`. + +To install Metals, make sure to have [coursier](https://get-coursier.io/docs/cli-installation) installed, and once you do you can install the latest Metals with `cs install metals`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.metals.setup{} +``` + + +**Default values:** + - `capabilities` : + ```lua + { + workspace = { + configuration = false + } + } + ``` + - `cmd` : + ```lua + { "metals" } + ``` + - `filetypes` : + ```lua + { "scala" } + ``` + - `init_options` : + ```lua + { + compilerOptions = { + snippetAutoIndent = false + }, + isHttpEnabled = true, + statusBarProvider = "show-message" + } + ``` + - `message_level` : + ```lua + 4 + ``` + - `root_dir` : + ```lua + util.root_pattern("build.sbt", "build.sc", "build.gradle", "pom.xml") + ``` + + +## millet + +https://github.com/azdavis/millet + +Millet, a language server for Standard ML + +To use with nvim: + +1. Install a Rust toolchain: https://rustup.rs +2. Clone the repo +3. Run `cargo build --release --bin lang-srv` +4. Move `target/release/lang-srv` to somewhere on your $PATH as `millet` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.millet.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "millet" } + ``` + - `filetypes` : + ```lua + { "sml" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## mint + +https://www.mint-lang.com + +Install Mint using the [instructions](https://www.mint-lang.com/install). +The language server is included since version 0.12.0. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mint.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mint", "ls" } + ``` + - `filetypes` : + ```lua + { "mint" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## mlir_lsp_server + +https://mlir.llvm.org/docs/Tools/MLIRLSP/#mlir-lsp-language-server--mlir-lsp-server= + +The Language Server for the LLVM MLIR language + +`mlir-lsp-server` can be installed at the llvm-project repository (https://github.com/llvm/llvm-project) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mlir_lsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mlir-lsp-server" } + ``` + - `filetypes` : + ```lua + { "mlir" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## mlir_pdll_lsp_server + +https://mlir.llvm.org/docs/Tools/MLIRLSP/#pdll-lsp-language-server--mlir-pdll-lsp-server + +The Language Server for the LLVM PDLL language + +`mlir-pdll-lsp-server` can be installed at the llvm-project repository (https://github.com/llvm/llvm-project) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mlir_pdll_lsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mlir-pdll-lsp-server" } + ``` + - `filetypes` : + ```lua + { "pdll" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## mm0_ls + +https://github.com/digama0/mm0 + +Language Server for the metamath-zero theorem prover. + +Requires [mm0-rs](https://github.com/digama0/mm0/tree/master/mm0-rs) to be installed +and available on the `PATH`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mm0_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mm0-rs", "server" } + ``` + - `filetypes` : + ```lua + { "metamath-zero" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## mojo + +https://github.com/modularml/mojo + +`mojo-lsp-server` can be installed [via Modular](https://developer.modular.com/download) + +Mojo is a new programming language that bridges the gap between research and production by combining Python syntax and ecosystem with systems programming and metaprogramming features. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mojo.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mojo-lsp-server" } + ``` + - `filetypes` : + ```lua + { "mojo" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## motoko_lsp + +https://github.com/dfinity/vscode-motoko + +Language server for the Motoko programming language. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.motoko_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "motoko-lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "motoko" } + ``` + - `init_options` : + ```lua + { + formatter = "auto" + } + ``` + - `root_dir` : + ```lua + root_pattern("dfx.json", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## move_analyzer + +https://github.com/move-language/move/tree/main/language/move-analyzer + +Language server for Move + +The `move-analyzer` can be installed by running: + +``` +cargo install --git https://github.com/move-language/move move-analyzer +``` + +See [`move-analyzer`'s doc](https://github.com/move-language/move/blob/1b258a06e3c7d2bc9174578aac92cca3ac19de71/language/move-analyzer/editors/code/README.md#how-to-install) for details. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.move_analyzer.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "move-analyzer" } + ``` + - `filetypes` : + ```lua + { "move" } + ``` + - `root_dir` : + ```lua + root_pattern("Move.toml") + ``` + + +## mutt_ls + +https://github.com/neomutt/mutt-language-server + +A language server for (neo)mutt's muttrc. It can be installed via pip. + +```sh +pip install mutt-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.mutt_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "mutt-language-server" } + ``` + - `filetypes` : + ```lua + { "muttrc", "neomuttrc" } + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nelua_lsp + +https://github.com/codehz/nelua-lsp + +nelua-lsp is an experimental nelua language server. + +You need [nelua.vim](https://github.com/stefanos82/nelua.vim/blob/main/ftdetect/nelua.vim) for nelua files to be recognized or add this to your config: + +in vimscript: +```vimscript +au BufNewFile,BufRead *.nelua setf nelua +``` + +in lua: +```lua +vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, { pattern = { "*.nelua" }, command = "setf nelua"}) +``` + +**By default, nelua-lsp doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. + +```lua +require'lspconfig'.nelua_lsp.setup { + cmd = { "nelua", "-L", "/path/to/nelua-lsp/", "--script", "/path/to/nelua-lsp/nelua-lsp.lua" }, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nelua_lsp.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "nelua" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## neocmake + +https://github.com/Decodetalkers/neocmakelsp + +CMake LSP Implementation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.neocmake.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "neocmakelsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "cmake" } + ``` + - `root_dir` : + ```lua + root_pattern('.git', 'cmake') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nextls + +https://github.com/elixir-tools/next-ls + +**By default, next-ls does not set its `cmd`. Please see the following [detailed instructions](https://www.elixir-tools.dev/docs/next-ls/installation/) for possible installation methods.** + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nextls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "elixir", "eelixir", "heex", "surface" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nginx_language_server + +https://pypi.org/project/nginx-language-server/ + +`nginx-language-server` can be installed via pip: + +```sh +pip install -U nginx-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nginx_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nginx-language-server" } + ``` + - `filetypes` : + ```lua + { "nginx" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nickel_ls + +Nickel Language Server + +https://github.com/tweag/nickel + +`nls` can be installed with nix, or cargo, from the Nickel repository. +```sh +git clone https://github.com/tweag/nickel.git +``` + +Nix: +```sh +cd nickel +nix-env -f . -i +``` + +cargo: +```sh +cd nickel/lsp/nls +cargo install --path . +``` + +In order to have lspconfig detect Nickel filetypes (a prerequisite for autostarting a server), +install the [Nickel vim plugin](https://github.com/nickel-lang/vim-nickel). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nickel_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nls" } + ``` + - `filetypes` : + ```lua + { "ncl", "nickel" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## nil_ls + +https://github.com/oxalica/nil + +A new language server for Nix Expression Language. + +If you are using Nix with Flakes support, run `nix profile install github:oxalica/nil` to install. +Check the repository README for more information. + +_See an example config at https://github.com/oxalica/nil/blob/main/dev/nvim-lsp.nix._ + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nil_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nil" } + ``` + - `filetypes` : + ```lua + { "nix" } + ``` + - `root_dir` : + ```lua + root_pattern("flake.nix", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nim_langserver + +https://github.com/nim-lang/langserver + + +`nim-langserver` can be installed via the `nimble` package manager: +```sh +nimble install nimlangserver +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nim_langserver.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nimlangserver" } + ``` + - `filetypes` : + ```lua + { "nim" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nimls + +https://github.com/PMunch/nimlsp + +`nimlsp` can be installed via the `nimble` package manager: + +```sh +nimble install nimlsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nimls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nimlsp" } + ``` + - `filetypes` : + ```lua + { "nim" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nixd + +https://github.com/nix-community/nixd + +Nix language server, based on nix libraries. + +If you are using Nix with Flakes support, run `nix profile install github:nix-community/nixd` to install. +Check the repository README for more information. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nixd.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nixd" } + ``` + - `filetypes` : + ```lua + { "nix" } + ``` + - `root_dir` : + ```lua + root_pattern("flake.nix",".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nomad_lsp + +https://github.com/juliosueiras/nomad-lsp + +Written in Go, compilation is needed for `nomad_lsp` to be used. Please see the [original repository](https://github.com/juliosuieras/nomad-lsp). + +Add the executable to your system or vim PATH and it will be set to go. + +No configuration option is needed unless you choose not to add `nomad-lsp` executable to the PATH. You should know what you are doing if you choose so. + +```lua +require('lspconfig').nomad_lsp.setup{ } +``` + +However, a `hcl.nomad` or `nomad` filetype should be defined. + +Description of your jobs should be written in `.nomad` files for the LSP client to configure the server's `root_dir` configuration option. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nomad_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nomad-lsp" } + ``` + - `filetypes` : + ```lua + { "hcl.nomad", "nomad" } + ``` + - `root_dir` : + ```lua + util.root_pattern("hcl.nomad", "nomad") + ``` + + +## ntt + +https://github.com/nokia/ntt +Installation instructions can be found [here](https://github.com/nokia/ntt#Install). +Can be configured by passing a "settings" object to `ntt.setup{}`: +```lua +require('lspconfig').ntt.setup{ + settings = { + ntt = { + } + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ntt.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ntt", "langserver" } + ``` + - `filetypes` : + ```lua + { "ttcn" } + ``` + - `root_dir` : + ```lua + util.root_pattern(".git") + ``` + + +## nushell + +https://github.com/nushell/nushell + +Nushell built-in language server. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nushell.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nu", "--lsp" } + ``` + - `filetypes` : + ```lua + { "nu" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## nxls + +https://github.com/nrwl/nx-console/tree/master/apps/nxls + +nxls, a language server for Nx Workspaces + +`nxls` can be installed via `npm`: +```sh +npm i -g nxls +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.nxls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nxls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "json", "jsonc" } + ``` + - `root_dir` : + ```lua + util.root_pattern + ``` + + +## ocamlls + +https://github.com/ocaml-lsp/ocaml-language-server + +`ocaml-language-server` can be installed via `npm` +```sh +npm install -g ocaml-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ocamlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ocaml-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "ocaml", "reason" } + ``` + - `root_dir` : + ```lua + root_pattern("*.opam", "esy.json", "package.json") + ``` + + +## ocamllsp + +https://github.com/ocaml/ocaml-lsp + +`ocaml-lsp` can be installed as described in [installation guide](https://github.com/ocaml/ocaml-lsp#installation). + +To install the lsp server in a particular opam switch: +```sh +opam install ocaml-lsp-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ocamllsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ocamllsp" } + ``` + - `filetypes` : + ```lua + { "ocaml", "menhir", "ocamlinterface", "ocamllex", "reason", "dune" } + ``` + - `get_language_id` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("*.opam", "esy.json", "package.json", ".git", "dune-project", "dune-workspace") + ``` + + +## ols + + https://github.com/DanielGavin/ols + + `Odin Language Server`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ols.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ols" } + ``` + - `filetypes` : + ```lua + { "odin" } + ``` + - `root_dir` : + ```lua + util.root_pattern("ols.json", ".git", "*.odin") + ``` + + +## omnisharp + +https://github.com/omnisharp/omnisharp-roslyn +OmniSharp server based on Roslyn workspaces + +`omnisharp-roslyn` can be installed by downloading and extracting a release from [here](https://github.com/OmniSharp/omnisharp-roslyn/releases). +OmniSharp can also be built from source by following the instructions [here](https://github.com/omnisharp/omnisharp-roslyn#downloading-omnisharp). + +OmniSharp requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +**By default, omnisharp-roslyn doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. + +For `go_to_definition` to work fully, extended `textDocument/definition` handler is needed, for example see [omnisharp-extended-lsp.nvim](https://github.com/Hoffs/omnisharp-extended-lsp.nvim) + +```lua +require'lspconfig'.omnisharp.setup { + cmd = { "dotnet", "/path/to/omnisharp/OmniSharp.dll" }, + + settings = { + FormattingOptions = { + -- Enables support for reading code style, naming convention and analyzer + -- settings from .editorconfig. + EnableEditorConfigSupport = true, + -- Specifies whether 'using' directives should be grouped and sorted during + -- document formatting. + OrganizeImports = nil, + }, + MsBuild = { + -- If true, MSBuild project system will only load projects for files that + -- were opened in the editor. This setting is useful for big C# codebases + -- and allows for faster initialization of code navigation features only + -- for projects that are relevant to code that is being edited. With this + -- setting enabled OmniSharp may load fewer projects and may thus display + -- incomplete reference lists for symbols. + LoadProjectsOnDemand = nil, + }, + RoslynExtensionsOptions = { + -- Enables support for roslyn analyzers, code fixes and rulesets. + EnableAnalyzersSupport = nil, + -- Enables support for showing unimported types and unimported extension + -- methods in completion lists. When committed, the appropriate using + -- directive will be added at the top of the current file. This option can + -- have a negative impact on initial completion responsiveness, + -- particularly for the first few completion sessions after opening a + -- solution. + EnableImportCompletion = nil, + -- Only run analyzers against open files when 'enableRoslynAnalyzers' is + -- true + AnalyzeOpenDocumentsOnly = nil, + }, + Sdk = { + -- Specifies whether to include preview versions of the .NET SDK when + -- determining which version to use for project loading. + IncludePrereleases = true, + }, + }, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.omnisharp.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "cs", "vb" } + ``` + - `init_options` : + ```lua + {} + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("*.sln", "*.csproj", "omnisharp.json", "function.json") + ``` + - `settings` : + ```lua + { + FormattingOptions = { + EnableEditorConfigSupport = true + }, + MsBuild = {}, + RoslynExtensionsOptions = {}, + Sdk = { + IncludePrereleases = true + } + } + ``` + + +## opencl_ls + +https://github.com/Galarius/opencl-language-server + +Build instructions can be found [here](https://github.com/Galarius/opencl-language-server/blob/main/_dev/build.md). + +Prebuilt binaries are available for Linux, macOS and Windows [here](https://github.com/Galarius/opencl-language-server/releases). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.opencl_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "opencl-language-server" } + ``` + - `filetypes` : + ```lua + { "opencl" } + ``` + - `root_dir` : + ```lua + util.root_pattern(".git") + ``` + + +## openedge_ls + +[Language server](https://github.com/vscode-abl/vscode-abl) for Progress OpenEdge ABL. + +For manual installation, download abl-lsp.jar from the [VSCode +extension](https://github.com/vscode-abl/vscode-abl/releases/latest). + +Configuration + +```lua +require('lspconfig').['openedge_ls'].setup { + oe_jar_path = '/path/to/abl-lsp.jar', + dlc = '12.2:/path/to/dlc-12.2', -- Version number and OpenEdge root directory (colon separator) + debug = false, -- Set to true for debug logging + trace = false -- Set to true for trace logging (REALLY verbose) +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.openedge_ls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "progress" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern('openedge-project.json') + ``` + + +## openscad_ls + +https://github.com/dzhu/openscad-language-server + +A Language Server Protocol server for OpenSCAD + +You can build and install `openscad-language-server` binary with `cargo`: +```sh +cargo install openscad-language-server +``` + +Vim does not have built-in syntax for the `openscad` filetype currently. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.scad set filetype=openscad ]] +``` + +or by installing a filetype plugin such as https://github.com/sirtaj/vim-openscad + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.openscad_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "openscad-language-server" } + ``` + - `filetypes` : + ```lua + { "openscad" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## openscad_lsp + +https://github.com/Leathong/openscad-LSP + +A Language Server Protocol server for OpenSCAD + +You can build and install `openscad-lsp` binary with `cargo`: +```sh +cargo install openscad-lsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.openscad_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "openscad-lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "openscad" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## pact_ls + +https://github.com/kadena-io/pact-lsp + +The Pact language server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pact_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pact-lsp" } + ``` + - `filetypes` : + ```lua + { "pact" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## pasls + +https://github.com/genericptr/pascal-language-server + +An LSP server implementation for Pascal variants that are supported by Free Pascal, including Object Pascal. It uses CodeTools from Lazarus as backend. + +First set `cmd` to the Pascal lsp binary. + +Customization options are passed to pasls as environment variables for example in your `.bashrc`: +```bash +export FPCDIR='/usr/lib/fpc/src' # FPC source directory (This is the only required option for the server to work). +export PP='/usr/lib/fpc/3.2.2/ppcx64' # Path to the Free Pascal compiler executable. +export LAZARUSDIR='/usr/lib/lazarus' # Path to the Lazarus sources. +export FPCTARGET='' # Target operating system for cross compiling. +export FPCTARGETCPU='x86_64' # Target CPU for cross compiling. +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pasls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pasls" } + ``` + - `filetypes` : + ```lua + { "pascal" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## pbls + +https://git.sr.ht/~rrc/pbls + +Prerequisites: Ensure protoc is on your $PATH. + +`pbls` can be installed via `cargo install`: +```sh +cargo install --git https://git.sr.ht/~rrc/pbls +``` + +pbls is a Language Server for protobuf + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pbls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pbls" } + ``` + - `filetypes` : + ```lua + { "proto" } + ``` + - `root_dir` : + ```lua + root_pattern(".pbls.toml", ".git") + ``` + + +## perlls + +https://github.com/richterger/Perl-LanguageServer/tree/master/clients/vscode/perl + +`Perl-LanguageServer`, a language server for Perl. + +To use the language server, ensure that you have Perl::LanguageServer installed and perl command is on your path. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.perlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "perl", "-MPerl::LanguageServer", "-e", "Perl::LanguageServer::run", "--", "--port 13603", "--nostdio 0" } + ``` + - `filetypes` : + ```lua + { "perl" } + ``` + - `root_dir` : + ```lua + vim's starting directory + ``` + - `settings` : + ```lua + { + perl = { + fileFilter = { ".pm", ".pl" }, + ignoreDirs = ".git", + perlCmd = "perl", + perlInc = " " + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## perlnavigator + +https://github.com/bscan/PerlNavigator + +A Perl language server. It can be installed via npm: + +```sh +npm i -g perlnavigator-server +``` + +At minimum, you will need `perl` in your path. If you want to use a non-standard `perl` you will need to set your configuration like so: +```lua +settings = { + perlnavigator = { + perlPath = '/some/odd/location/my-perl' + } +} +``` + +The `contributes.configuration.properties` section of `perlnavigator`'s `package.json` has all available configuration settings. All +settings have a reasonable default, but, at minimum, you may want to point `perlnavigator` at your `perltidy` and `perlcritic` configurations. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.perlnavigator.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "perlnavigator" } + ``` + - `filetypes` : + ```lua + { "perl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## perlpls + +https://github.com/FractalBoy/perl-language-server +https://metacpan.org/pod/PLS + +`PLS`, another language server for Perl. + +To use the language server, ensure that you have PLS installed and that it is in your path + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.perlpls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pls" } + ``` + - `filetypes` : + ```lua + { "perl" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `settings` : + ```lua + { + perl = { + perlcritic = { + enabled = false + }, + syntax = { + enabled = true + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## pest_ls + +https://github.com/pest-parser/pest-ide-tools + +Language server for pest grammars. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pest_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pest-language-server" } + ``` + - `filetypes` : + ```lua + { "pest" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## phan + +https://github.com/phan/phan + +Installation: https://github.com/phan/phan#getting-started + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.phan.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "phan", "-m", "json", "--no-color", "--no-progress-bar", "-x", "-u", "-S", "--language-server-on-stdin", "--allow-polyfill-parser" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("composer.json", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## phpactor + +https://github.com/phpactor/phpactor + +Installation: https://phpactor.readthedocs.io/en/master/usage/standalone.html#global-installation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.phpactor.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "phpactor", "language-server" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("composer.json", ".git") + ``` + + +## pico8_ls + +https://github.com/japhib/pico8-ls + +Full language support for the PICO-8 dialect of Lua. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pico8_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pico8-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "p8" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## pkgbuild_language_server + +https://github.com/Freed-Wu/pkgbuild-language-server + +Language server for ArchLinux/Windows Msys2's PKGBUILD. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pkgbuild_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pkgbuild-language-server" } + ``` + - `filetypes` : + ```lua + { "PKGBUILD" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## please + +https://github.com/thought-machine/please + +High-performance extensible build system for reproducible multi-language builds. + +The `plz` binary will automatically install the LSP for you on first run + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.please.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "plz", "tool", "lps" } + ``` + - `filetypes` : + ```lua + { "bzl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## postgres_lsp + +https://github.com/supabase/postgres_lsp + +A Language Server for Postgres + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.postgres_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "postgres_lsp" } + ``` + - `filetypes` : + ```lua + { "sql" } + ``` + - `root_dir` : + ```lua + util.root_pattern 'root-file.txt' + ``` + - `single_file_support` : + ```lua + true + ``` + + +## powershell_es + +https://github.com/PowerShell/PowerShellEditorServices + +Language server for PowerShell. + +To install, download and extract PowerShellEditorServices.zip +from the [releases](https://github.com/PowerShell/PowerShellEditorServices/releases). +To configure the language server, set the property `bundle_path` to the root +of the extracted PowerShellEditorServices.zip. + +The default configuration doesn't set `cmd` unless `bundle_path` is specified. + +```lua +require'lspconfig'.powershell_es.setup{ + bundle_path = 'c:/w/PowerShellEditorServices', +} +``` + +By default the languageserver is started in `pwsh` (PowerShell Core). This can be changed by specifying `shell`. + +```lua +require'lspconfig'.powershell_es.setup{ + bundle_path = 'c:/w/PowerShellEditorServices', + shell = 'powershell.exe', +} +``` + +Note that the execution policy needs to be set to `Unrestricted` for the languageserver run under PowerShell + +If necessary, specific `cmd` can be defined instead of `bundle_path`. +See [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices#stdio) +to learn more. + +```lua +require'lspconfig'.powershell_es.setup{ + cmd = {'pwsh', '-NoLogo', '-NoProfile', '-Command', "c:/PSES/Start-EditorServices.ps1 ..."} +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.powershell_es.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "ps1" } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + git root or current directory + ``` + - `shell` : + ```lua + "pwsh" + ``` + - `single_file_support` : + ```lua + true + ``` + + +## prismals + +Language Server for the Prisma JavaScript and TypeScript ORM + +`@prisma/language-server` can be installed via npm +```sh +npm install -g @prisma/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.prismals.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "prisma-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "prisma" } + ``` + - `root_dir` : + ```lua + root_pattern(".git", "package.json") + ``` + - `settings` : + ```lua + { + prisma = { + prismaFmtBinPath = "" + } + } + ``` + + +## prolog_ls + + https://github.com/jamesnvc/lsp_server + + Language Server Protocol server for SWI-Prolog + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.prolog_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "swipl", "-g", "use_module(library(lsp_server)).", "-g", "lsp_server:main", "-t", "halt", "--", "stdio" } + ``` + - `filetypes` : + ```lua + { "prolog" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## prosemd_lsp + +https://github.com/kitten/prosemd-lsp + +An experimental LSP for Markdown. + +Please see the manual installation instructions: https://github.com/kitten/prosemd-lsp#manual-installation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.prosemd_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "prosemd-lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + <function 1> + ``` + - `single_file_support` : + ```lua + true + ``` + + +## psalm + +https://github.com/vimeo/psalm + +Can be installed with composer. +```sh +composer global require vimeo/psalm +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.psalm.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "psalm", "--language-server" } + ``` + - `filetypes` : + ```lua + { "php" } + ``` + - `root_dir` : + ```lua + root_pattern("psalm.xml", "psalm.xml.dist") + ``` + + +## puppet + +LSP server for Puppet. + +Installation: + +- Clone the editor-services repository: + https://github.com/puppetlabs/puppet-editor-services + +- Navigate into that directory and run: `bundle install` + +- Install the 'puppet-lint' gem: `gem install puppet-lint` + +- Add that repository to $PATH. + +- Ensure you can run `puppet-languageserver` from outside the editor-services directory. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.puppet.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "puppet-languageserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "puppet" } + ``` + - `root_dir` : + ```lua + root_pattern("manifests", ".puppet-lint.rc", "hiera.yaml", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## purescriptls + +https://github.com/nwolverson/purescript-language-server + +The `purescript-language-server` can be added to your project and `$PATH` via + +* JavaScript package manager such as npm, pnpm, Yarn, et al. +* Nix under the `nodePackages` and `nodePackages_latest` package sets + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.purescriptls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "purescript-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "purescript" } + ``` + - `root_dir` : + ```lua + root_pattern('bower.json', 'flake.nix', 'psc-package.json', 'shell.nix', 'spago.dhall', 'spago.yaml'), + ``` + + +## pylsp + +https://github.com/python-lsp/python-lsp-server + +A Python 3.6+ implementation of the Language Server Protocol. + +See the [project's README](https://github.com/python-lsp/python-lsp-server) for installation instructions. + +Configuration options are documented [here](https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md). +In order to configure an option, it must be translated to a nested Lua table and included in the `settings` argument to the `setup{}` function. +For example, in order to set the `pylsp.plugins.pycodestyle.ignore` option: +```lua +require'lspconfig'.pylsp.setup{ + settings = { + pylsp = { + plugins = { + pycodestyle = { + ignore = {'W391'}, + maxLineLength = 100 + } + } + } + } +} +``` + +Note: This is a community fork of `pyls`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pylsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pylsp" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## pylyzer + + https://github.com/mtshiba/pylyzer + + `pylyzer`, a fast static code analyzer & language server for Python. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pylyzer.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pylyzer", "--server" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + python = { + checkOnType = false, + diagnostics = true, + inlayHints = true, + smartCompletion = true + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## pyre + +https://pyre-check.org/ + +`pyre` a static type checker for Python 3. + +`pyre` offers an extremely limited featureset. It currently only supports diagnostics, +which are triggered on save. + +Do not report issues for missing features in `pyre` to `lspconfig`. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pyre.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "pyre", "persistent" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## pyright + +https://github.com/microsoft/pyright + +`pyright`, a static type checker and language server for python + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.pyright.setup{} +``` +**Commands:** +- PyrightOrganizeImports: Organize Imports +- PyrightSetPythonPath: Reconfigure pyright with the provided python path + +**Default values:** + - `cmd` : + ```lua + { "pyright-langserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + python = { + analysis = { + autoSearchPaths = true, + diagnosticMode = "openFilesOnly", + useLibraryCodeForTypes = true + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## qml_lsp + +https://invent.kde.org/sdk/qml-lsp + +LSP implementation for QML (autocompletion, live linting, etc. in editors) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.qml_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "qml-lsp" } + ``` + - `filetypes` : + ```lua + { "qmljs" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## qmlls + +https://github.com/qt/qtdeclarative + +LSP implementation for QML (autocompletion, live linting, etc. in editors), + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.qmlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "qmlls" } + ``` + - `filetypes` : + ```lua + { "qml", "qmljs" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## quick_lint_js + +https://quick-lint-js.com/ + +quick-lint-js finds bugs in JavaScript programs. + +See installation [instructions](https://quick-lint-js.com/install/) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.quick_lint_js.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "quick-lint-js", "--lsp-server" } + ``` + - `filetypes` : + ```lua + { "javascript", "typescript" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## r_language_server + +[languageserver](https://github.com/REditorSupport/languageserver) is an +implementation of the Microsoft's Language Server Protocol for the R +language. + +It is released on CRAN and can be easily installed by + +```r +install.packages("languageserver") +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.r_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "R", "--slave", "-e", "languageserver::run()" } + ``` + - `filetypes` : + ```lua + { "r", "rmd" } + ``` + - `log_level` : + ```lua + 2 + ``` + - `root_dir` : + ```lua + root_pattern(".git") or os_homedir + ``` + + +## racket_langserver + +[https://github.com/jeapostrophe/racket-langserver](https://github.com/jeapostrophe/racket-langserver) + +The Racket language server. This project seeks to use +[DrRacket](https://github.com/racket/drracket)'s public API to provide +functionality that mimics DrRacket's code tools as closely as possible. + +Install via `raco`: `raco pkg install racket-langserver` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.racket_langserver.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "racket", "--lib", "racket-langserver" } + ``` + - `filetypes` : + ```lua + { "racket", "scheme" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## raku_navigator + +https://github.com/bscan/RakuNavigator +A Raku language server +**By default, raku_navigator doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. +You have to install the language server manually. +Clone the RakuNavigator repo, install based on the [instructions](https://github.com/bscan/raku_Navigator#installation-for-other-editors), +and point `cmd` to `server.js` inside the `server/out` directory: +```lua +cmd = {'node', '<path_to_repo>/server/out/server.js', '--stdio'} +``` +At minimum, you will need `raku` in your path. If you want to use a non-standard `raku` you will need to set your configuration like so: +```lua +settings = { + raku_navigator = { + rakuPath = '/some/odd/location/my-raku' + } +} +``` +The `contributes.configuration.properties` section of `raku_navigator`'s `package.json` has all available configuration settings. All +settings have a reasonable default, but, at minimum, you may want to point `raku_navigator` at your `raku_tidy` and `raku_critic` configurations. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.raku_navigator.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + {} + ``` + - `filetypes` : + ```lua + { "raku" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## reason_ls + +Reason language server + +You can install reason language server from [reason-language-server](https://github.com/jaredly/reason-language-server) repository. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.reason_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "reason-language-server" } + ``` + - `filetypes` : + ```lua + { "reason" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## regal + +https://github.com/StyraInc/regal + +A linter for Rego, with support for running as an LSP server. + +`regal` can be installed by running: +```sh +go install github.com/StyraInc/regal@latest +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.regal.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "regal", "language-server" } + ``` + - `filetypes` : + ```lua + { "rego" } + ``` + - `root_dir` : + ```lua + root_pattern("*.rego", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## regols + +https://github.com/kitagry/regols + +OPA Rego language server. + +`regols` can be installed by running: +```sh +go install github.com/kitagry/regols@latest +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.regols.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "regols" } + ``` + - `filetypes` : + ```lua + { "rego" } + ``` + - `root_dir` : + ```lua + root_pattern("*.rego", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## relay_lsp + + https://github.com/facebook/relay + `Relay` is a JavaScript framework for building data-driven React applications + + Setup: + + - Make sure you have a Relay config file somewhere in your project. + - We support standard config file formats (`.yml`, `.js`, `.json`), and the the `relay` field in your `package.json` + - Make sure you have the `relay-compiler` installed in your project. The bare minimum is v13. + - Make sure you are able to run the `relay-compiler` command from the command line. If `yarn relay-compiler` works, it's very likely that the LSP will work. + - Remove / disable any conflicting GraphQL LSPs you have installed. + + Relay LSP is a part of the Relay Compiler binary and available when adding `relay-compiler` to your project's devDependencies. + + ```lua + require'lspconfig'.relay_lsp.setup { + -- (default: false) Whether or not we should automatically start + -- the Relay Compiler in watch mode when you open a project + auto_start_compiler = false, + + + -- (default: null) Path to a relay config relative to the + -- `root_dir`. Without this, the compiler will search for your + -- config. This is helpful if your relay project is in a nested + -- directory. + path_to_config = nil, + } + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.relay_lsp.setup{} +``` + + +**Default values:** + - `auto_start_compiler` : + ```lua + false + ``` + - `cmd` : + ```lua + { "relay-compiler", "lsp" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" } + ``` + - `handlers` : + ```lua + { + ["window/showStatus"] = <function 1> + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern("relay.config.*", "package.json") + ``` + + +## remark_ls + +https://github.com/remarkjs/remark-language-server + +`remark-language-server` can be installed via `npm`: +```sh +npm install -g remark-language-server +``` + +`remark-language-server` uses the same +[configuration files](https://github.com/remarkjs/remark/tree/main/packages/remark-cli#example-config-files-json-yaml-js) +as `remark-cli`. + +This uses a plugin based system. Each plugin needs to be installed locally using `npm` or `yarn`. + +For example, given the following `.remarkrc.json`: + +```json +{ + "presets": [ + "remark-preset-lint-recommended" + ] +} +``` + +`remark-preset-lint-recommended` needs to be installed in the local project: + +```sh +npm install remark-preset-lint-recommended +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.remark_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "remark-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## rescriptls + +https://github.com/rescript-lang/rescript-vscode/tree/master/server + +ReScript Language Server can be installed via npm: +```sh +npm install -g @rescript/language-server +``` + +See the init_options supported (see https://github.com/rescript-lang/rescript-vscode/tree/master/server/config.md): + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rescriptls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rescript-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "rescript" } + ``` + - `init_options` : + ```lua + { + extensionConfiguration = { + askToStartBuild = false + } + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## rls + +https://github.com/rust-lang/rls + +rls, a language server for Rust + +See https://github.com/rust-lang/rls#setup to setup rls itself. +See https://github.com/rust-lang/rls#configuration for rls-specific settings. +All settings listed on the rls configuration section of the readme +must be set under settings.rust as follows: + +```lua +nvim_lsp.rls.setup { + settings = { + rust = { + unstable_features = true, + build_on_save = false, + all_features = true, + }, + }, +} +``` + +If you want to use rls for a particular build, eg nightly, set cmd as follows: + +```lua +cmd = {"rustup", "run", "nightly", "rls"} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rls" } + ``` + - `filetypes` : + ```lua + { "rust" } + ``` + - `root_dir` : + ```lua + root_pattern("Cargo.toml") + ``` + + +## rnix + +https://github.com/nix-community/rnix-lsp + +A language server for Nix providing basic completion and formatting via nixpkgs-fmt. + +To install manually, run `cargo install rnix-lsp`. If you are using nix, rnix-lsp is in nixpkgs. + +This server accepts configuration via the `settings` key. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rnix.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rnix-lsp" } + ``` + - `filetypes` : + ```lua + { "nix" } + ``` + - `init_options` : + ```lua + {} + ``` + - `root_dir` : + ```lua + vim's starting directory + ``` + - `settings` : + ```lua + {} + ``` + + +## robotframework_ls + +https://github.com/robocorp/robotframework-lsp + +Language Server Protocol implementation for Robot Framework. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.robotframework_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "robotframework_ls" } + ``` + - `filetypes` : + ```lua + { "robot" } + ``` + - `root_dir` : + ```lua + util.root_pattern('robotidy.toml', 'pyproject.toml', 'conda.yaml', 'robot.yaml')(fname) + or util.find_git_ancestor(fname) + ``` + + +## roc_ls + +https://github.com/roc-lang/roc/tree/main/crates/language_server#roc_language_server + +The built-in language server for the Roc programming language. +[Installation](https://github.com/roc-lang/roc/tree/main/crates/language_server#installing) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.roc_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "roc_language_server" } + ``` + - `filetypes` : + ```lua + { "roc" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## rome + +https://rome.tools + +Language server for the Rome Frontend Toolchain. + +(Unmaintained, use [Biome](https://biomejs.dev/blog/annoucing-biome) instead.) + +```sh +npm install [-g] rome +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rome.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rome", "lsp-proxy" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "json", "typescript", "typescript.tsx", "typescriptreact" } + ``` + - `root_dir` : + ```lua + root_pattern('package.json', 'node_modules', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## rubocop + +https://github.com/rubocop/rubocop + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rubocop.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rubocop", "--lsp" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + + +## ruby_lsp + +https://shopify.github.io/ruby-lsp/ + +This gem is an implementation of the language server protocol specification for +Ruby, used to improve editor features. + +Install the gem. There's no need to require it, since the server is used as a +standalone executable. + +```sh +group :development do + gem "ruby-lsp", require: false +end +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ruby_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ruby-lsp" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `init_options` : + ```lua + { + formatter = "auto" + } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ruff + +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. + +```sh +pip install ruff +``` + +_Requires Ruff v0.3.3 or later._ + +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: + +1. Diagnostics +2. Code actions +3. Formatting +4. Range Formatting + +Please note that the `ruff-lsp` server will continue to be maintained until further notice. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ruff.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ruff", "server", "--preview" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ruff_lsp + +https://github.com/astral-sh/ruff-lsp + +A Language Server Protocol implementation for Ruff, an extremely fast Python linter and code transformation tool, written in Rust. It can be installed via pip. + +```sh +pip install ruff-lsp +``` + +Extra CLI arguments for `ruff` can be provided via + +```lua +require'lspconfig'.ruff_lsp.setup{ + init_options = { + settings = { + -- Any extra CLI arguments for `ruff` go here. + args = {}, + } + } +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ruff_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ruff-lsp" } + ``` + - `filetypes` : + ```lua + { "python" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## rune_languageserver + +https://crates.io/crates/rune-languageserver + +A language server for the [Rune](https://rune-rs.github.io/) Language, +an embeddable dynamic programming language for Rust + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rune_languageserver.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "rune-languageserver" } + ``` + - `filetypes` : + ```lua + { "rune" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## rust_analyzer + +https://github.com/rust-lang/rust-analyzer + +rust-analyzer (aka rls 2.0), a language server for Rust + + +See [docs](https://github.com/rust-lang/rust-analyzer/blob/master/docs/user/generated_config.adoc) for extra settings. The settings can be used like this: +```lua +require'lspconfig'.rust_analyzer.setup{ + settings = { + ['rust-analyzer'] = { + diagnostics = { + enable = false; + } + } + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.rust_analyzer.setup{} +``` +**Commands:** +- CargoReload: Reload current cargo workspace + +**Default values:** + - `capabilities` : + ```lua + { + experimental = { + serverStatusNotification = true + }, + general = { + positionEncodings = { "utf-16" } + }, + textDocument = { + callHierarchy = { + dynamicRegistration = false + }, + codeAction = { + codeActionLiteralSupport = { + codeActionKind = { + valueSet = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" } + } + }, + dataSupport = true, + dynamicRegistration = true, + isPreferredSupport = true, + resolveSupport = { + properties = { "edit" } + } + }, + completion = { + completionItem = { + commitCharactersSupport = false, + deprecatedSupport = false, + documentationFormat = { "markdown", "plaintext" }, + preselectSupport = false, + snippetSupport = false + }, + completionItemKind = { + valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 } + }, + completionList = { + itemDefaults = { "editRange", "insertTextFormat", "insertTextMode", "data" } + }, + contextSupport = false, + dynamicRegistration = false + }, + declaration = { + linkSupport = true + }, + definition = { + dynamicRegistration = true, + linkSupport = true + }, + diagnostic = { + dynamicRegistration = false + }, + documentHighlight = { + dynamicRegistration = false + }, + documentSymbol = { + dynamicRegistration = false, + hierarchicalDocumentSymbolSupport = true, + symbolKind = { + valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } + } + }, + formatting = { + dynamicRegistration = true + }, + hover = { + contentFormat = { "markdown", "plaintext" }, + dynamicRegistration = true + }, + implementation = { + linkSupport = true + }, + inlayHint = { + dynamicRegistration = true, + resolveSupport = { + properties = { "textEdits", "tooltip", "location", "command" } + } + }, + publishDiagnostics = { + dataSupport = true, + relatedInformation = true, + tagSupport = { + valueSet = { 1, 2 } + } + }, + rangeFormatting = { + dynamicRegistration = true + }, + references = { + dynamicRegistration = false + }, + rename = { + dynamicRegistration = true, + prepareSupport = true + }, + semanticTokens = { + augmentsSyntaxTokens = true, + dynamicRegistration = false, + formats = { "relative" }, + multilineTokenSupport = false, + overlappingTokenSupport = true, + requests = { + full = { + delta = true + }, + range = false + }, + serverCancelSupport = false, + tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary" }, + tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator" } + }, + signatureHelp = { + dynamicRegistration = false, + signatureInformation = { + activeParameterSupport = true, + documentationFormat = { "markdown", "plaintext" }, + parameterInformation = { + labelOffsetSupport = true + } + } + }, + synchronization = { + didSave = true, + dynamicRegistration = false, + willSave = true, + willSaveWaitUntil = true + }, + typeDefinition = { + linkSupport = true + } + }, + window = { + showDocument = { + support = true + }, + showMessage = { + messageActionItem = { + additionalPropertiesSupport = false + } + }, + workDoneProgress = true + }, + workspace = { + applyEdit = true, + configuration = true, + didChangeConfiguration = { + dynamicRegistration = false + }, + didChangeWatchedFiles = { + dynamicRegistration = false, + relativePatternSupport = true + }, + inlayHint = { + refreshSupport = true + }, + semanticTokens = { + refreshSupport = true + }, + symbol = { + dynamicRegistration = false, + symbolKind = { + valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } + } + }, + workspaceEdit = { + resourceOperations = { "rename", "create", "delete" } + }, + workspaceFolders = true + } + } + ``` + - `cmd` : + ```lua + { "rust-analyzer" } + ``` + - `filetypes` : + ```lua + { "rust" } + ``` + - `root_dir` : + ```lua + root_pattern("Cargo.toml", "rust-project.json") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## salt_ls + +Language server for Salt configuration files. +https://github.com/dcermak/salt-lsp + +The language server can be installed with `pip`: +```sh +pip install salt-lsp +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.salt_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "salt_lsp_server" } + ``` + - `filetypes` : + ```lua + { "sls" } + ``` + - `root_dir` : + ```lua + root_pattern('.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## scheme_langserver + +https://github.com/ufo5260987423/scheme-langserver +`scheme-langserver`, a language server protocol implementation for scheme. +And for nvim user, please add .sls to scheme file extension list. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.scheme_langserver.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "scheme-langserver" } + ``` + - `filetypes` : + ```lua + { "scheme" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## scry + +https://github.com/crystal-lang-tools/scry + +Crystal language server. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.scry.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "scry" } + ``` + - `filetypes` : + ```lua + { "crystal" } + ``` + - `root_dir` : + ```lua + root_pattern('shard.yml', '.git') + ``` + - `single_file_support` : + ```lua + true + ``` + + +## serve_d + + https://github.com/Pure-D/serve-d + + `Microsoft language server protocol implementation for D using workspace-d.` + Download a binary from https://github.com/Pure-D/serve-d/releases and put it in your $PATH. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.serve_d.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "serve-d" } + ``` + - `filetypes` : + ```lua + { "d" } + ``` + - `root_dir` : + ```lua + util.root_pattern("dub.json", "dub.sdl", ".git") + ``` + + +## shopify_theme_ls + +https://shopify.dev/docs/api/shopify-cli + +[Language Server](https://shopify.dev/docs/themes/tools/cli/language-server) and Theme Check (linter) for Shopify themes. + +`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. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.shopify_theme_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "shopify", "theme", "language-server" } + ``` + - `filetypes` : + ```lua + { "liquid" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## sixtyfps + +https://github.com/sixtyfpsui/sixtyfps +`SixtyFPS`'s language server + +You can build and install `sixtyfps-lsp` binary with `cargo`: +```sh +cargo install sixtyfps-lsp +``` + +Vim does not have built-in syntax for the `sixtyfps` filetype currently. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.60 set filetype=sixtyfps ]] +``` + +or by installing a filetype plugin such as https://github.com/RustemB/sixtyfps-vim + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sixtyfps.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sixtyfps-lsp" } + ``` + - `filetypes` : + ```lua + { "sixtyfps" } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## slangd + +https://github.com/shader-slang/slang + +The `slangd` binary can be downloaded as part of [slang releases](https://github.com/shader-slang/slang/releases) or +by [building `slang` from source](https://github.com/shader-slang/slang/blob/master/docs/building.md). + +The server can be configured by passing a "settings" object to `slangd.setup{}`: + +```lua +require('lspconfig').slangd.setup{ + settings = { + slang = { + predefinedMacros = {"MY_VALUE_MACRO=1"}, + inlayHints = { + deducedTypes = true, + parameterNames = true, + } + } + } +} +``` +Available options are documented [here](https://github.com/shader-slang/slang-vscode-extension/tree/main?tab=readme-ov-file#configurations) +or in more detail [here](https://github.com/shader-slang/slang-vscode-extension/blob/main/package.json#L70). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.slangd.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "slangd" } + ``` + - `filetypes` : + ```lua + { "hlsl", "shaderslang" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## slint_lsp + +https://github.com/slint-ui/slint +`Slint`'s language server + +You can build and install `slint-lsp` binary with `cargo`: +```sh +cargo install slint-lsp +``` + +Vim does not have built-in syntax for the `slint` filetype at this time. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.slint set filetype=slint ]] +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.slint_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "slint-lsp" } + ``` + - `filetypes` : + ```lua + { "slint" } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## smarty_ls + +https://github.com/landeaux/vscode-smarty-langserver-extracted + +Language server for Smarty. + +`smarty-language-server` can be installed via `npm`: + +```sh +npm i -g vscode-smarty-langserver-extracted +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.smarty_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "smarty-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "smarty" } + ``` + - `init_options` : + ```lua + {} + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + css = { + validate = true + }, + smarty = { + pluginDirs = {} + } + } + ``` + + +## smithy_ls + +https://github.com/awslabs/smithy-language-server + +`Smithy Language Server`, A Language Server Protocol implementation for the Smithy IDL + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.smithy_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "smithy-language-server", "0" } + ``` + - `filetypes` : + ```lua + { "smithy" } + ``` + - `root_dir` : + ```lua + root_pattern("smithy-build.json", "build.gradle", "build.gradle.kts", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## snyk_ls + +https://github.com/snyk/snyk-ls + +LSP for Snyk Open Source, Snyk Infrastructure as Code, and Snyk Code. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.snyk_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "snyk-ls" } + ``` + - `filetypes` : + ```lua + { "go", "gomod", "javascript", "typescript", "json", "python", "requirements", "helm", "yaml", "terraform", "terraform-vars" } + ``` + - `init_options` : + ```lua + Configuration from https://github.com/snyk/snyk-ls#configuration-1 + ``` + - `root_dir` : + ```lua + root_pattern(".git", ".snyk") + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## solang + +A language server for Solidity + +See the [documentation](https://solang.readthedocs.io/en/latest/installing.html) for installation instructions. + +The language server only provides the following capabilities: +* Syntax highlighting +* Diagnostics +* Hover + +There is currently no support for completion, goto definition, references, or other functionality. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solang.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solang", "language-server", "--target", "evm" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## solargraph + +https://solargraph.org/ + +solargraph, a language server for Ruby + +You can install solargraph via gem install. + +```sh +gem install --user-install solargraph +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solargraph.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solargraph", "stdio" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `init_options` : + ```lua + { + formatting = true + } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + - `settings` : + ```lua + { + solargraph = { + diagnostics = true + } + } + ``` + + +## solc + +https://docs.soliditylang.org/en/latest/installing-solidity.html + +solc is the native language server for the Solidity language. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solc.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solc", "--lsp" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + root_pattern('hardhat.config.*', '.git') + ``` + + +## solidity + +https://github.com/qiuxiang/solidity-ls + +npm i solidity-ls -g + +Make sure that solc is installed and it's the same version of the file. solc-select is recommended. + +Solidity language server is a LSP with autocomplete, go to definition and diagnostics. + +If you use brownie, use this root_dir: +root_dir = util.root_pattern('brownie-config.yaml', '.git') + +on includePath, you can add an extra path to search for external libs, on remapping you can remap lib <> path, like: + +```lua +{ solidity = { includePath = '/Users/your_user/.brownie/packages/', remapping = { ["@OpenZeppelin/"] = 'OpenZeppelin/openzeppelin-contracts@4.6.0/' } } } +``` + +**For brownie users** +Change the root_dir to: + +```lua +root_pattern("brownie-config.yaml", ".git") +``` + +The best way of using it is to have a package.json in your project folder with the packages that you will use. +After installing with package.json, just create a `remappings.txt` with: + +``` +@OpenZeppelin/=node_modules/OpenZeppelin/openzeppelin-contracts@4.6.0/ +``` + +You can omit the node_modules as well. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solidity.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solidity-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") + ``` + - `settings` : + ```lua + { + solidity = { + includePath = "", + remapping = {} + } + } + ``` + + +## solidity_ls + +https://github.com/juanfranblanco/vscode-solidity + +`vscode-solidity-server` can be installed via `npm`: + +```sh +npm install -g vscode-solidity-server +``` + +`vscode-solidity-server` is a language server for the Solidity language ported from the VSCode "solidity" extension. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solidity_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vscode-solidity-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + root_pattern("hardhat.config.js", "hardhat.config.ts", "foundry.toml", "remappings.txt", "truffle.js", "truffle-config.js", "ape-config.yaml", ".git", "package.json") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## solidity_ls_nomicfoundation + +https://github.com/NomicFoundation/hardhat-vscode/blob/development/server/README.md + +`nomicfoundation-solidity-language-server` can be installed via `npm`: + +```sh +npm install -g @nomicfoundation/solidity-language-server +``` + +A language server for the Solidity programming language, built by the Nomic Foundation for the Ethereum community. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solidity_ls_nomicfoundation.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nomicfoundation-solidity-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + root_pattern("hardhat.config.js", "hardhat.config.ts", "foundry.toml", "remappings.txt", "truffle.js", "truffle-config.js", "ape-config.yaml", ".git", "package.json") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## somesass_ls + + +https://github.com/wkillerud/some-sass/tree/main/packages/language-server + +`some-sass-language-server` can be installed via `npm`: + +```sh +npm i -g some-sass-language-server +``` + +The language server provides: + +- Full support for @use and @forward, including aliases, prefixes and hiding. +- Workspace-wide code navigation and refactoring, such as Rename Symbol. +- Rich documentation through SassDoc. +- Language features for %placeholder-selectors, both when using them and writing them. +- Suggestions and hover info for built-in Sass modules, when used with @use. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.somesass_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "some-sass-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "scss", "sass" } + ``` + - `name` : + ```lua + "somesass_ls" + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") or bufdir + ``` + - `settings` : + ```lua + { + somesass = { + suggestAllFromOpenDocument = true + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## sorbet + +https://sorbet.org + +Sorbet is a fast, powerful type checker designed for Ruby. + +You can install Sorbet via gem install. You might also be interested in how to set +Sorbet up for new projects: https://sorbet.org/docs/adopting. + +```sh +gem install sorbet +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sorbet.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "srb", "tc", "--lsp" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + + +## sourcekit + +https://github.com/apple/sourcekit-lsp + +Language server for Swift and C/C++/Objective-C. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sourcekit.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sourcekit-lsp" } + ``` + - `filetypes` : + ```lua + { "swift", "c", "cpp", "objective-c", "objective-cpp" } + ``` + - `root_dir` : + ```lua + root_pattern("buildServer.json", "*.xcodeproj", "*.xcworkspace", ".git", "compile_commands.json", "Package.swift") + ``` + + +## sourcery + +https://github.com/sourcery-ai/sourcery + +Refactor Python instantly using the power of AI. + +It requires the init_options param to be populated as shown below and will respond with the list of ServerCapabilities that it supports: + +```lua +require'lspconfig'.sourcery.setup { + init_options = { + --- The Sourcery token for authenticating the user. + --- This is retrieved from the Sourcery website and must be + --- provided by each user. The extension must provide a + --- configuration option for the user to provide this value. + token = <YOUR_TOKEN>, + + --- The extension's name and version as defined by the extension. + extension_version = 'vim.lsp', + + --- The editor's name and version as defined by the editor. + editor_version = 'vim', + }, +} +``` + +Alternatively, you can login to sourcery by running `sourcery login` with sourcery-cli. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sourcery.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sourcery", "lsp" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "python", "typescript", "typescriptreact" } + ``` + - `init_options` : + ```lua + { + editor_version = "vim", + extension_version = "vim.lsp" + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## spectral + +https://github.com/luizcorreia/spectral-language-server + `A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v2 & v3.` + +`spectral-language-server` can be installed via `npm`: +```sh +npm i -g spectral-language-server +``` +See [vscode-spectral](https://github.com/stoplightio/vscode-spectral#extension-settings) for configuration options. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.spectral.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "spectral-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml", "json", "yml" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + enable = true, + run = "onType", + validateLanguages = { "yaml", "json", "yml" } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## spyglassmc_language_server + +https://github.com/SpyglassMC/Spyglass/tree/main/packages/language-server + +Language server for Minecraft datapacks. + +`spyglassmc-language-server` can be installed via `npm`: + +```sh +npm i -g @spyglassmc/language-server +``` + +You may also need to configure the filetype: + +`autocmd BufNewFile,BufRead *.mcfunction set filetype=mcfunction` + +This is automatically done by [CrystalAlpha358/vim-mcfunction](https://github.com/CrystalAlpha358/vim-mcfunction), which also provide syntax highlight. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.spyglassmc_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "spyglassmc-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "mcfunction" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## sqlls + +https://github.com/joe-re/sql-language-server + +This LSP can be installed via `npm`. Find further instructions on manual installation of the sql-language-server at [joe-re/sql-language-server](https://github.com/joe-re/sql-language-server). +<br> + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sqlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sql-language-server", "up", "--method", "stdio" } + ``` + - `filetypes` : + ```lua + { "sql", "mysql" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## sqls + +https://github.com/sqls-server/sqls + +```lua +require'lspconfig'.sqls.setup{ + cmd = {"path/to/command", "-config", "path/to/config.yml"}; + ... +} +``` +Sqls can be installed via `go get github.com/sqls-server/sqls`. Instructions for compiling Sqls from the source can be found at [sqls-server/sqls](https://github.com/sqls-server/sqls). + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.sqls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "sqls" } + ``` + - `filetypes` : + ```lua + { "sql", "mysql" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## standardrb + +https://github.com/testdouble/standard + +Ruby Style Guide, with linter & automatic code fixer. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.standardrb.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "standardrb", "--lsp" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + + +## starlark_rust + +https://github.com/facebookexperimental/starlark-rust/ +The LSP part of `starlark-rust` is not currently documented, + but the implementation works well for linting. +This gives valuable warnings for potential issues in the code, +but does not support refactorings. + +It can be installed with cargo: https://crates.io/crates/starlark + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.starlark_rust.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "starlark", "--lsp" } + ``` + - `filetypes` : + ```lua + { "star", "bzl", "BUILD.bazel" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## starpls + +https://github.com/withered-magic/starpls + +`starpls` is an LSP implementation for Starlark. Installation instructions can be found in the project's README. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.starpls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "starpls" } + ``` + - `filetypes` : + ```lua + { "bzl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## statix + +https://github.com/nerdypepper/statix + +lints and suggestions for the nix programming language + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.statix.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "statix" } + ``` + - `filetypes` : + ```lua + { "nix" } + ``` + - `root_dir` : + ```lua + root_pattern("flake.nix", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## steep + +https://github.com/soutaro/steep + +`steep` is a static type checker for Ruby. + +You need `Steepfile` to make it work. Generate it with `steep init`. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.steep.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "steep", "langserver" } + ``` + - `filetypes` : + ```lua + { "ruby", "eruby" } + ``` + - `root_dir` : + ```lua + root_pattern("Steepfile", ".git") + ``` + + +## stimulus_ls + +https://www.npmjs.com/package/stimulus-language-server + +`stimulus-lsp` can be installed via `npm`: + +```sh +npm install -g stimulus-language-server +``` + +or via `yarn`: + +```sh +yarn global add stimulus-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.stimulus_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "stimulus-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "html", "ruby", "eruby", "blade", "php" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## stylelint_lsp + +https://github.com/bmatcuk/stylelint-lsp + +`stylelint-lsp` can be installed via `npm`: + +```sh +npm i -g stylelint-lsp +``` + +Can be configured by passing a `settings.stylelintplus` object to `stylelint_lsp.setup`: + +```lua +require'lspconfig'.stylelint_lsp.setup{ + settings = { + stylelintplus = { + -- see available options in stylelint-lsp documentation + } + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.stylelint_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "stylelint-lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "css", "less", "scss", "sugarss", "vue", "wxss", "javascript", "javascriptreact", "typescript", "typescriptreact" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## svelte + +https://github.com/sveltejs/language-tools/tree/master/packages/language-server + +Note: assuming that [tsserver](#tsserver) is setup, full JavaScript/TypeScript support (find references, rename, etc of symbols in Svelte files when working in JS/TS files) requires per-project installation and configuration of [typescript-svelte-plugin](https://github.com/sveltejs/language-tools/tree/master/packages/typescript-plugin#usage). + +`svelte-language-server` can be installed via `npm`: +```sh +npm install -g svelte-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.svelte.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "svelteserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "svelte" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") + ``` + + +## svlangserver + +https://github.com/imc-trading/svlangserver + +Language server for SystemVerilog. + +`svlangserver` can be installed via `npm`: + +```sh +$ npm install -g @imc-trading/svlangserver +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.svlangserver.setup{} +``` +**Commands:** +- SvlangserverBuildIndex: Instructs language server to rerun indexing +- SvlangserverReportHierarchy: Generates hierarchy for the given module + +**Default values:** + - `cmd` : + ```lua + { "svlangserver" } + ``` + - `filetypes` : + ```lua + { "verilog", "systemverilog" } + ``` + - `root_dir` : + ```lua + root_pattern(".svlangserver", ".git") + ``` + - `settings` : + ```lua + { + systemverilog = { + includeIndexing = { "*.{v,vh,sv,svh}", "**/*.{v,vh,sv,svh}" } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## svls + +https://github.com/dalance/svls + +Language server for verilog and SystemVerilog + +`svls` can be installed via `cargo`: + ```sh + cargo install svls + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.svls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "svls" } + ``` + - `filetypes` : + ```lua + { "verilog", "systemverilog" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## swift_mesonls + +https://github.com/JCWasmx86/Swift-MesonLSP + +Meson language server written in Swift + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.swift_mesonls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "Swift-MesonLSP", "--lsp" } + ``` + - `filetypes` : + ```lua + { "meson" } + ``` + - `root_dir` : + ```lua + util.root_pattern("meson_options.txt", "meson.options", ".git") + ``` + + +## syntax_tree + +https://ruby-syntax-tree.github.io/syntax_tree/ + +A fast Ruby parser and formatter. + +Syntax Tree is a suite of tools built on top of the internal CRuby parser. It +provides the ability to generate a syntax tree from source, as well as the +tools necessary to inspect and manipulate that syntax tree. It can be used to +build formatters, linters, language servers, and more. + +```sh +gem install syntax_tree +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.syntax_tree.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "stree", "lsp" } + ``` + - `filetypes` : + ```lua + { "ruby" } + ``` + - `root_dir` : + ```lua + root_pattern(".streerc", "Gemfile", ".git") + ``` + + +## tabby_ml + +https://tabby.tabbyml.com/blog/running-tabby-as-a-language-server + +Language server for Tabby, an opensource, self-hosted AI coding assistant. + +`tabby-agent` can be installed via `npm`: + +```sh +npm install --global tabby-agent +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tabby_ml.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tabby-agent", "--lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + {} + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## tailwindcss + +https://github.com/tailwindlabs/tailwindcss-intellisense + +Tailwind CSS Language Server can be installed via npm: +```sh +npm install -g @tailwindcss/language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tailwindcss.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tailwindcss-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "aspnetcorerazor", "astro", "astro-markdown", "blade", "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" + } + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + root_pattern('tailwind.config.js', 'tailwind.config.cjs', 'tailwind.config.mjs', 'tailwind.config.ts', 'postcss.config.js', 'postcss.config.cjs', 'postcss.config.mjs', 'postcss.config.ts', 'package.json', 'node_modules', '.git') + ``` + - `settings` : + ```lua + { + tailwindCSS = { + classAttributes = { "class", "className", "class:list", "classList", "ngClass" }, + lint = { + cssConflict = "warning", + invalidApply = "error", + invalidConfigPath = "error", + invalidScreen = "error", + invalidTailwindDirective = "error", + invalidVariant = "error", + recommendedVariantOrder = "warning" + }, + validate = true + } + } + ``` + + +## taplo + +https://taplo.tamasfe.dev/cli/usage/language-server.html + +Language server for Taplo, a TOML toolkit. + +`taplo-cli` can be installed via `cargo`: +```sh +cargo install --features lsp --locked taplo-cli +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.taplo.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "taplo", "lsp", "stdio" } + ``` + - `filetypes` : + ```lua + { "toml" } + ``` + - `root_dir` : + ```lua + root_pattern("*.toml", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## tblgen_lsp_server + +https://mlir.llvm.org/docs/Tools/MLIRLSP/#tablegen-lsp-language-server--tblgen-lsp-server + +The Language Server for the LLVM TableGen language + +`tblgen-lsp-server` can be installed at the llvm-project repository (https://github.com/llvm/llvm-project) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tblgen_lsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tblgen-lsp-server" } + ``` + - `filetypes` : + ```lua + { "tablegen" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## teal_ls + +https://github.com/teal-language/teal-language-server + +Install with: +``` +luarocks install --dev teal-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.teal_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "teal-language-server" } + ``` + - `filetypes` : + ```lua + { "teal" } + ``` + - `root_dir` : + ```lua + root_pattern("tlconfig.lua", ".git") + ``` + + +## templ + +https://templ.guide + +The official language server for the templ HTML templating language. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.templ.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "templ", "lsp" } + ``` + - `filetypes` : + ```lua + { "templ" } + ``` + - `root_dir` : + ```lua + root_pattern('go.work', 'go.mod', '.git') + ``` + + +## terraform_lsp + +https://github.com/juliosueiras/terraform-lsp + +Terraform language server +Download a released binary from +https://github.com/juliosueiras/terraform-lsp/releases. + +From https://github.com/hashicorp/terraform-ls#terraform-ls-vs-terraform-lsp: + +Both HashiCorp and the maintainer of terraform-lsp expressed interest in +collaborating on a language server and are working towards a _long-term_ +goal of a single stable and feature-complete implementation. + +For the time being both projects continue to exist, giving users the +choice: + +- `terraform-ls` providing + - overall stability (by relying only on public APIs) + - compatibility with any provider and any Terraform >=0.12.0 currently + less features + - due to project being younger and relying on public APIs which may + not offer the same functionality yet + +- `terraform-lsp` providing + - currently more features + - compatibility with a single particular Terraform (0.12.20 at time of writing) + - configs designed for other 0.12 versions may work, but interpretation may be inaccurate + - less stability (due to reliance on Terraform's own internal packages) + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.terraform_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "terraform-lsp" } + ``` + - `filetypes` : + ```lua + { "terraform", "hcl" } + ``` + - `root_dir` : + ```lua + root_pattern(".terraform", ".git") + ``` + + +## terraformls + +https://github.com/hashicorp/terraform-ls + +Terraform language server +Download a released binary from https://github.com/hashicorp/terraform-ls/releases. + +From https://github.com/hashicorp/terraform-ls#terraform-ls-vs-terraform-lsp: + +Both HashiCorp and the maintainer of terraform-lsp expressed interest in +collaborating on a language server and are working towards a _long-term_ +goal of a single stable and feature-complete implementation. + +For the time being both projects continue to exist, giving users the +choice: + +- `terraform-ls` providing + - overall stability (by relying only on public APIs) + - compatibility with any provider and any Terraform >=0.12.0 currently + less features + - due to project being younger and relying on public APIs which may + not offer the same functionality yet + +- `terraform-lsp` providing + - currently more features + - compatibility with a single particular Terraform (0.12.20 at time of writing) + - configs designed for other 0.12 versions may work, but interpretation may be inaccurate + - less stability (due to reliance on Terraform's own internal packages) + +Note, that the `settings` configuration option uses the `workspace/didChangeConfiguration` event, +[which is not supported by terraform-ls](https://github.com/hashicorp/terraform-ls/blob/main/docs/features.md). +Instead you should use `init_options` which passes the settings as part of the LSP initialize call +[as is required by terraform-ls](https://github.com/hashicorp/terraform-ls/blob/main/docs/SETTINGS.md#how-to-pass-settings). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.terraformls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "terraform-ls", "serve" } + ``` + - `filetypes` : + ```lua + { "terraform", "terraform-vars" } + ``` + - `root_dir` : + ```lua + root_pattern(".terraform", ".git") + ``` + + +## texlab + +https://github.com/latex-lsp/texlab + +A completion engine built from scratch for (La)TeX. + +See https://github.com/latex-lsp/texlab/wiki/Configuration for configuration options. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.texlab.setup{} +``` +**Commands:** +- TexlabBuild: Build the current buffer +- TexlabForward: Forward search from current position + +**Default values:** + - `cmd` : + ```lua + { "texlab" } + ``` + - `filetypes` : + ```lua + { "tex", "plaintex", "bib" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + texlab = { + auxDirectory = ".", + bibtexFormatter = "texlab", + build = { + args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" }, + executable = "latexmk", + forwardSearchAfter = false, + onSave = false + }, + chktex = { + onEdit = false, + onOpenAndSave = false + }, + diagnosticsDelay = 300, + formatterLineLength = 80, + forwardSearch = { + args = {} + }, + latexFormatter = "latexindent", + latexindent = { + modifyLineBreaks = false + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## textlsp + +https://github.com/hangyav/textLSP + +`textLSP` is an LSP server for text spell and grammar checking with various AI tools. +It supports multiple text file formats, such as LaTeX, Org or txt. + +For the available text analyzer tools and their configuration, see the [GitHub](https://github.com/hangyav/textLSP) page. +By default, all analyzers are disabled in textLSP, since most of them need special settings. +For quick testing, LanguageTool is enabled in the default `nvim-lspconfig` configuration. + +To install run: `pip install textLSP` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.textlsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "textlsp" } + ``` + - `filetypes` : + ```lua + { "text", "tex", "org" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + textLSP = { + analysers = { + languagetool = { + check_text = { + on_change = false, + on_open = true, + on_save = true + }, + enabled = true + } + }, + documents = { + org = { + org_todo_keywords = { "TODO", "IN_PROGRESS", "DONE" } + } + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## tflint + +https://github.com/terraform-linters/tflint + +A pluggable Terraform linter that can act as lsp server. +Installation instructions can be found in https://github.com/terraform-linters/tflint#installation. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tflint.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tflint", "--langserver" } + ``` + - `filetypes` : + ```lua + { "terraform" } + ``` + - `root_dir` : + ```lua + root_pattern(".terraform", ".git", ".tflint.hcl") + ``` + + +## theme_check + +https://github.com/Shopify/shopify-cli + +`theme-check-language-server` is bundled with `shopify-cli` or it can also be installed via + +https://github.com/Shopify/theme-check#installation + +**NOTE:** +If installed via Homebrew, `cmd` must be set to 'theme-check-liquid-server' + +```lua +require lspconfig.theme_check.setup { + cmd = { 'theme-check-liquid-server' } +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.theme_check.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "theme-check-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "liquid" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## thriftls + +https://github.com/joyme123/thrift-ls + +you can install thriftls by mason or download binary here: https://github.com/joyme123/thrift-ls/releases + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.thriftls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "thriftls" } + ``` + - `filetypes` : + ```lua + { "thrift" } + ``` + - `root_dir` : + ```lua + root_pattern(".thrift") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## tilt_ls + +https://github.com/tilt-dev/tilt + +Tilt language server. + +You might need to add filetype detection manually: + +```vim +autocmd BufRead Tiltfile setf=tiltfile +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tilt_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tilt", "lsp", "start" } + ``` + - `filetypes` : + ```lua + { "tiltfile" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## tinymist + +https://github.com/Myriad-Dreamin/tinymist +An integrated language service for Typst [taɪpst]. You can also call it "微霭" [wēi ǎi] in Chinese. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tinymist.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tinymist" } + ``` + - `filetypes` : + ```lua + { "typst" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + false + ``` + + +## tsp_server + +https://github.com/microsoft/typespec + +The language server for TypeSpec, a language for defining cloud service APIs and shapes. + +`tsp-server` can be installed together with the typespec compiler via `npm`: +```sh +npm install -g @typespec/compiler +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tsp-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "typespec" } + ``` + - `root_dir` : + ```lua + util.root_pattern("tspconfig.yaml", ".git") + ``` + + +## tsserver + +https://github.com/typescript-language-server/typescript-language-server + +`typescript-language-server` depends on `typescript`. Both packages can be installed via `npm`: +```sh +npm install -g typescript typescript-language-server +``` + +To configure typescript language server, add a +[`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or +[`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to the root of your +project. + +Here's an example that disables type checking in JavaScript files. + +```json +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "checkJs": false + }, + "exclude": [ + "node_modules" + ] +} +``` + +### Vue support + +As of 2.0.0, Volar no longer supports TypeScript itself. Instead, a plugin +adds Vue support to this language server. + +*IMPORTANT*: It is crucial to ensure that `@vue/typescript-plugin` and `volar `are of identical versions. + +```lua +require'lspconfig'.tsserver.setup{ + init_options = { + plugins = { + { + name = "@vue/typescript-plugin", + location = "/usr/local/lib/node_modules/@vue/typescript-plugin", + languages = {"javascript", "typescript", "vue"}, + }, + }, + }, + filetypes = { + "javascript", + "typescript", + "vue", + }, +} + +-- You must make sure volar is setup +-- e.g. require'lspconfig'.volar.setup{} +-- See volar's section for more information +``` + +`location` MUST be defined. If the plugin is installed in `node_modules`, +`location` can have any value. + +`languages` must include `vue` even if it is listed in `filetypes`. + +`filetypes` is extended here to include Vue SFC. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tsserver.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "typescript-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" } + ``` + - `init_options` : + ```lua + { + hostInfo = "neovim" + } + ``` + - `root_dir` : + ```lua + root_pattern("tsconfig.json", "package.json", "jsconfig.json", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ttags + +https://github.com/npezza93/ttags + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ttags.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ttags", "lsp" } + ``` + - `filetypes` : + ```lua + { "ruby", "rust", "javascript", "haskell" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + +## turtle_ls + +https://github.com/stardog-union/stardog-language-servers/tree/master/packages/turtle-language-server +`turtle-language-server`, An editor-agnostic server providing language intelligence (diagnostics, hover tooltips, etc.) for the W3C standard Turtle RDF syntax via the Language Server Protocol. +installable via npm install -g turtle-language-server or yarn global add turtle-language-server. +requires node. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.turtle_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "node", + [3] = "--stdio" + } + ``` + - `filetypes` : + ```lua + { "turtle", "ttl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## twiggy_language_server + +https://github.com/moetelo/twiggy + +`twiggy-language-server` can be installed via `npm`: +```sh +npm install -g twiggy-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.twiggy_language_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "twiggy-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "twig" } + ``` + - `root_dir` : + ```lua + root_pattern("composer.json", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## typeprof + +https://github.com/ruby/typeprof + +`typeprof` is the built-in analysis and LSP tool for Ruby 3.1+. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.typeprof.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "typeprof", "--lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "ruby", "eruby" } + ``` + - `root_dir` : + ```lua + root_pattern("Gemfile", ".git") + ``` + + +## typos_lsp + +https://github.com/crate-ci/typos +https://github.com/tekumara/typos-lsp + +A Language Server Protocol implementation for Typos, a low false-positive +source code spell checker, written in Rust. Download it from the releases page +on GitHub: https://github.com/tekumara/typos-lsp/releases + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.typos_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "typos-lsp" } + ``` + - `filetypes` : + ```lua + { "*" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + - `single_file_support` : + ```lua + true + ``` + + +## typst_lsp + +https://github.com/nvarner/typst-lsp + +Language server for Typst. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.typst_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "typst-lsp" } + ``` + - `filetypes` : + ```lua + { "typst" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## uiua + +https://github.com/uiua-lang/uiua/ + +The builtin language server of the Uiua interpreter. + +The Uiua interpreter can be installed with `cargo install uiua` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.uiua.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "uiua", "lsp" } + ``` + - `filetypes` : + ```lua + { "uiua" } + ``` + - `root_dir` : + ```lua + root_pattern( + 'main.ua', + 'fmt.ua', + '.git' + ) + + ``` + + +## unison + +https://github.com/unisonweb/unison/blob/trunk/docs/language-server.markdown + + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.unison.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "nc", "localhost", "5757" } + ``` + - `filetypes` : + ```lua + { "unison" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + {} + ``` + + +## unocss + +https://github.com/xna00/unocss-language-server + +UnoCSS Language Server can be installed via npm: +```sh +npm i unocss-language-server -g +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.unocss.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "unocss-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "html", "javascriptreact", "rescript", "typescriptreact", "vue", "svelte" } + ``` + - `root_dir` : + ```lua + root_pattern('unocss.config.js', 'unocss.config.ts', 'uno.config.js', 'uno.config.ts') + ``` + + +## uvls + +https://codeberg.org/caradhras/uvls +Language server for UVL, written using tree sitter and rust. +You can install the server easily using cargo: +```sh +git clone https://codeberg.org/caradhras/uvls +cd uvls +cargo install --path . +``` +Note: To activate properly nvim needs to know the uvl filetype. +You can add it via: +```lua +vim.cmd(\[\[au BufRead,BufNewFile *.uvl setfiletype uvl\]\]) +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.uvls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "uvls" } + ``` + - `filetypes` : + ```lua + { "uvl" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## v_analyzer + +https://github.com/v-analyzer/v-analyzer + +V language server. + +`v-analyzer` can be installed by following the instructions [here](https://github.com/v-analyzer/v-analyzer#installation). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.v_analyzer.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "v-analyzer" } + ``` + - `filetypes` : + ```lua + { "v", "vsh", "vv" } + ``` + - `root_dir` : + ```lua + root_pattern("v.mod", ".git") + ``` + + +## vacuum + +Vacuum is the worlds fastest OpenAPI 3, OpenAPI 2 / Swagger linter and quality analysis tool. + +You can install vacuum using mason or follow the instructions here: https://github.com/daveshanley/vacuum + +The file types are not detected automatically, you can register them manually (see below) or override the filetypes: + +```lua +vim.filetype.add { + pattern = { + ['openapi.*%.ya?ml'] = 'yaml.openapi', + ['openapi.*%.json'] = 'json.openapi', + }, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vacuum.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vacuum", "language-server" } + ``` + - `filetypes` : + ```lua + { "yaml.openapi", "json.openapi" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## vala_ls + +https://github.com/Prince781/vala-language-server + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vala_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vala-language-server" } + ``` + - `filetypes` : + ```lua + { "vala", "genie" } + ``` + - `root_dir` : + ```lua + root_pattern("meson.build", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## vale_ls + +https://github.com/errata-ai/vale-ls + +An implementation of the Language Server Protocol (LSP) for the Vale command-line tool. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vale_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vale-ls" } + ``` + - `filetypes` : + ```lua + { "markdown", "text", "tex" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## vdmj + +https://github.com/nickbattle/vdmj + +The VDMJ language server can be installed by cloning the VDMJ repository and +running `mvn clean install`. + +Various options are provided to configure the language server (see below). In +particular: +- `annotation_paths` is a list of folders and/or jar file paths for annotations +that should be used with the language server; +- any value of `debugger_port` less than zero will disable the debugger; note +that if a non-zero value is used, only one instance of the server can be active +at a time. + +More settings for VDMJ can be changed in a file called `vdmj.properties` under +`root_dir/.vscode`. For a description of the available settings, see +[Section 7 of the VDMJ User Guide](https://raw.githubusercontent.com/nickbattle/vdmj/master/vdmj/documentation/UserGuide.pdf). + +Note: proof obligations and combinatorial testing are not currently supported +by neovim. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vdmj.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + Generated from the options given + ``` + - `filetypes` : + ```lua + { "vdmsl", "vdmpp", "vdmrt" } + ``` + - `options` : + ```lua + { + annotation_paths = {}, + debugger_port = -1, + high_precision = false, + java = "$JAVA_HOME/bin/java", + java_opts = { "-Xmx3000m", "-Xss1m" }, + logfile = "path.join(vim.fn.stdpath 'cache', 'vdm-lsp.log')", + mavenrepo = "$HOME/.m2/repository/dk/au/ece/vdmj", + version = "The latest version installed in `mavenrepo`" + } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor(fname) or find_vscode_ancestor(fname) + ``` + + +## verible + +https://github.com/chipsalliance/verible + +A linter and formatter for verilog and SystemVerilog files. + +Release binaries can be downloaded from [here](https://github.com/chipsalliance/verible/releases) +and placed in a directory on PATH. + +See https://github.com/chipsalliance/verible/tree/master/verilog/tools/ls/README.md for options. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.verible.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "verible-verilog-ls" } + ``` + - `filetypes` : + ```lua + { "systemverilog", "verilog" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## veridian + +https://github.com/vivekmalneedi/veridian + +A SystemVerilog LanguageServer. + +Download the latest release for your OS from the releases page + +# install with slang feature, if C++17 compiler is available +cargo install --git https://github.com/vivekmalneedi/veridian.git --all-features +# install if C++17 compiler is not available +cargo install --git https://github.com/vivekmalneedi/veridian.git + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.veridian.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "veridian" } + ``` + - `filetypes` : + ```lua + { "systemverilog", "verilog" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## veryl_ls + +https://github.com/veryl-lang/veryl + +Language server for Veryl + +`veryl-ls` can be installed via `cargo`: + ```sh + cargo install veryl-ls + ``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.veryl_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "veryl-ls" } + ``` + - `filetypes` : + ```lua + { "veryl" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## vhdl_ls + +Install vhdl_ls from https://github.com/VHDL-LS/rust_hdl and add it to path + +Configuration + +The language server needs to know your library mapping to perform full analysis of the code. For this it uses a configuration file in the TOML format named vhdl_ls.toml. + +vhdl_ls will load configuration files in the following order of priority (first to last): + + A file named .vhdl_ls.toml in the user home folder. + A file name from the VHDL_LS_CONFIG environment variable. + A file named vhdl_ls.toml in the workspace root. + +Settings in a later files overwrites those from previously loaded files. + +Example vhdl_ls.toml +``` +# File names are either absolute or relative to the parent folder of the vhdl_ls.toml file +[libraries] +lib2.files = [ + 'pkg2.vhd', +] +lib1.files = [ + 'pkg1.vhd', + 'tb_ent.vhd' +] +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vhdl_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vhdl_ls" } + ``` + - `filetypes` : + ```lua + { "vhd", "vhdl" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## vimls + +https://github.com/iamcco/vim-language-server + +You can install vim-language-server via npm: +```sh +npm install -g vim-language-server +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vimls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vim-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "vim" } + ``` + - `init_options` : + ```lua + { + diagnostic = { + enable = true + }, + indexes = { + count = 3, + gap = 100, + projectRootPatterns = { "runtime", "nvim", ".git", "autoload", "plugin" }, + runtimepath = true + }, + isNeovim = true, + iskeyword = "@,48-57,_,192-255,-#", + runtimepath = "", + suggest = { + fromRuntimepath = true, + fromVimruntime = true + }, + vimruntime = "" + } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## visualforce_ls + +https://github.com/forcedotcom/salesforcedx-vscode + +Language server for Visualforce. + +For manual installation, download the .vsix archive file from the +[forcedotcom/salesforcedx-vscode](https://github.com/forcedotcom/salesforcedx-vscode) +GitHub releases. Then, configure `cmd` to run the Node script at the unpacked location: + +```lua +require'lspconfig'.visualforce_ls.setup { + cmd = { + 'node', + '/path/to/unpacked/archive/extension/node_modules/@salesforce/salesforcedx-visualforce-language-server/out/src/visualforceServer.js', + '--stdio' + } +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.visualforce_ls.setup{} +``` + + +**Default values:** + - `filetypes` : + ```lua + { "visualforce" } + ``` + - `init_options` : + ```lua + { + embeddedLanguages = { + css = true, + javascript = true + } + } + ``` + - `root_dir` : + ```lua + root_pattern('sfdx-project.json') + ``` + + +## vls + +https://github.com/vlang/vls + +V language server. + +`v-language-server` can be installed by following the instructions [here](https://github.com/vlang/vls#installation). + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "v", "ls" } + ``` + - `filetypes` : + ```lua + { "v", "vlang" } + ``` + - `root_dir` : + ```lua + root_pattern("v.mod", ".git") + ``` + + +## volar + +https://github.com/johnsoncodehk/volar/tree/20d713b/packages/vue-language-server + +Volar language server for Vue + +Volar can be installed via npm: + +```sh +npm install -g @vue/language-server +``` + +Volar by default supports Vue 3 projects. Vue 2 projects need +[additional configuration](https://github.com/vuejs/language-tools/tree/master/packages/vscode-vue#usage). + +**TypeScript support** +As of release 2.0.0, Volar no longer wraps around tsserver. For typescript +support, `tsserver` needs to be configured with the `@vue/typescript-plugin` +plugin. + +**Take Over Mode** + +Volar (prior to 2.0.0), can serve as a language server for both Vue and TypeScript via [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471). + +To enable Take Over Mode, override the default filetypes in `setup{}` as follows: + +```lua +require'lspconfig'.volar.setup{ + filetypes = {'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue', 'json'} +} +``` + +**Overriding the default TypeScript Server used by Volar** + +The default config looks for TS in the local `node_modules`. This can lead to issues +e.g. when working on a [monorepo](https://monorepo.tools/). The alternatives are: + +- use a global TypeScript Server installation + +```lua +require'lspconfig'.volar.setup{ + init_options = { + typescript = { + tsdk = '/path/to/.npm/lib/node_modules/typescript/lib' + -- Alternative location if installed as root: + -- tsdk = '/usr/local/lib/node_modules/typescript/lib' + } + } +} +``` + +- use a local server and fall back to a global TypeScript Server installation + +```lua +local util = require 'lspconfig.util' +local function get_typescript_server_path(root_dir) + + local global_ts = '/home/[yourusernamehere]/.npm/lib/node_modules/typescript/lib' + -- Alternative location if installed as root: + -- local global_ts = '/usr/local/lib/node_modules/typescript/lib' + local found_ts = '' + local function check_dir(path) + found_ts = util.path.join(path, 'node_modules', 'typescript', 'lib') + if util.path.exists(found_ts) then + return path + end + end + if util.search_ancestors(root_dir, check_dir) then + return found_ts + else + return global_ts + end +end + +require'lspconfig'.volar.setup{ + on_new_config = function(new_config, new_root_dir) + new_config.init_options.typescript.tsdk = get_typescript_server_path(new_root_dir) + end, +} +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.volar.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vue-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "vue" } + ``` + - `init_options` : + ```lua + { + typescript = { + tsdk = "" + } + } + ``` + - `on_new_config` : + ```lua + see source file + ``` + - `root_dir` : + ```lua + see source file + ``` + + +## vtsls + +https://github.com/yioneko/vtsls + +`vtsls` can be installed with npm: +```sh +npm install -g @vtsls/language-server +``` + +To configure a TypeScript project, add a +[`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) +or [`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to +the root of your project. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vtsls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vtsls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" } + ``` + - `root_dir` : + ```lua + root_pattern("tsconfig.json", "package.json", "jsconfig.json", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + +## vuels + +https://github.com/vuejs/vetur/tree/master/server + +Vue language server(vls) +`vue-language-server` can be installed via `npm`: +```sh +npm install -g vls +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.vuels.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "vls" } + ``` + - `filetypes` : + ```lua + { "vue" } + ``` + - `init_options` : + ```lua + { + config = { + css = {}, + emmet = {}, + html = { + suggest = {} + }, + javascript = { + format = {} + }, + stylusSupremacy = {}, + typescript = { + format = {} + }, + vetur = { + completion = { + autoImport = false, + tagCasing = "kebab", + useScaffoldSnippets = false + }, + format = { + defaultFormatter = { + js = "none", + ts = "none" + }, + defaultFormatterOptions = {}, + scriptInitialIndent = false, + styleInitialIndent = false + }, + useWorkspaceDependencies = false, + validation = { + script = true, + style = true, + template = true + } + } + } + } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", "vue.config.js") + ``` + + +## wgsl_analyzer + +https://github.com/wgsl-analyzer/wgsl-analyzer + +`wgsl_analyzer` can be installed via `cargo`: +```sh +cargo install --git https://github.com/wgsl-analyzer/wgsl-analyzer wgsl_analyzer +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.wgsl_analyzer.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "wgsl_analyzer" } + ``` + - `filetypes` : + ```lua + { "wgsl" } + ``` + - `root_dir` : + ```lua + root_pattern(".git" + ``` + - `settings` : + ```lua + {} + ``` + + +## yamlls + +https://github.com/redhat-developer/yaml-language-server + +`yaml-language-server` can be installed via `yarn`: +```sh +yarn global add yaml-language-server +``` + +To use a schema for validation, there are two options: + +1. Add a modeline to the file. A modeline is a comment of the form: + +``` +# yaml-language-server: $schema=<urlToTheSchema|relativeFilePath|absoluteFilePath}> +``` + +where the relative filepath is the path relative to the open yaml file, and the absolute filepath +is the filepath relative to the filesystem root ('/' on unix systems) + +2. Associated a schema url, relative , or absolute (to root of project, not to filesystem root) path to +the a glob pattern relative to the detected project root. Check `:LspInfo` to determine the resolved project +root. + +```lua +require('lspconfig').yamlls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + ... -- other settings. note this overrides the lspconfig defaults. + schemas = { + ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*", + ["../path/relative/to/file.yml"] = "/.github/workflows/*", + ["/path/from/root/of/project"] = "/.github/workflows/*", + }, + }, + } +} +``` + +Currently, kubernetes is special-cased in yammls, see the following upstream issues: +* [#211](https://github.com/redhat-developer/yaml-language-server/issues/211). +* [#307](https://github.com/redhat-developer/yaml-language-server/issues/307). + +To override a schema to use a specific k8s schema version (for example, to use 1.18): + +```lua +require('lspconfig').yamlls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + ... -- other settings. note this overrides the lspconfig defaults. + schemas = { + ["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.18.0-standalone-strict/all.json"] = "/*.k8s.yaml", + ... -- other schemas + }, + }, + } +} +``` + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.yamlls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "yaml-language-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "yaml", "yaml.docker-compose", "yaml.gitlab" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `settings` : + ```lua + { + redhat = { + telemetry = { + enabled = false + } + } + } + ``` + - `single_file_support` : + ```lua + true + ``` + + +## yang_lsp + +https://github.com/TypeFox/yang-lsp + +A Language Server for the YANG data modeling language. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.yang_lsp.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "yang-language-server" } + ``` + - `filetypes` : + ```lua + { "yang" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + + +## yls + +https://pypi.org/project/yls-yara/ + +An YLS plugin adding YARA linting capabilities. + +This plugin runs yara.compile on every save, parses the errors, and returns list of diagnostic messages. + +Language Server: https://github.com/avast/yls + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.yls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "yls", "-vv" } + ``` + - `filetypes` : + ```lua + { "yar", "yara" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `single_file_support` : + ```lua + true + ``` + + +## zk + +https://github.com/mickael-menu/zk + +A plain text note-taking assistant + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.zk.setup{} +``` +**Commands:** +- ZkIndex: ZkIndex +- ZkNew: ZkNew + +**Default values:** + - `cmd` : + ```lua + { "zk", "lsp" } + ``` + - `filetypes` : + ```lua + { "markdown" } + ``` + - `root_dir` : + ```lua + root_pattern(".zk") + ``` + + +## zls + +https://github.com/zigtools/zls + +Zig LSP implementation + Zig Language Server + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.zls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "zls" } + ``` + - `filetypes` : + ```lua + { "zig", "zir" } + ``` + - `root_dir` : + ```lua + util.root_pattern("zls.json", "build.zig", ".git") + ``` + - `single_file_support` : + ```lua + true + ``` + + + +vim:ft=markdown diff --git a/start/lspconfig-0.1.8/lua/lspconfig.lua b/start/lspconfig-0.1.8/lua/lspconfig.lua new file mode 100644 index 0000000..0823ec8 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig.lua @@ -0,0 +1,63 @@ +local configs = require 'lspconfig.configs' + +local M = { + util = require 'lspconfig.util', +} + +---@class Alias +---@field to string The new name of the server +---@field version string The version that the alias will be removed in +---@param name string +---@return Alias +local function server_alias(name) + local aliases = { + ['fennel-ls'] = { + to = 'fennel_ls', + version = '0.2.0', + }, + ruby_ls = { + to = 'ruby_lsp', + version = '0.2.0', + }, + ['starlark-rust'] = { + to = 'starlark_rust', + version = '0.2.0', + }, + sumneko_lua = { + to = 'lua_ls', + version = '0.2.0', + }, + } + + return aliases[name] +end + +local mt = {} +function mt:__index(k) + if configs[k] == nil then + local alias = server_alias(k) + if alias then + vim.deprecate(k, alias.to, alias.version, 'lspconfig', false) + k = alias.to + end + + local success, config = pcall(require, 'lspconfig.server_configurations.' .. k) + if success then + configs[k] = config + else + vim.notify( + string.format( + '[lspconfig] Cannot access configuration for %s. Ensure this server is listed in ' + .. '`server_configurations.md` or added as a custom server.', + k + ), + vim.log.levels.WARN + ) + -- Return a dummy function for compatibility with user configs + return { setup = function() end } + end + end + return configs[k] +end + +return setmetatable(M, mt) diff --git a/start/lspconfig-0.1.8/lua/lspconfig/async.lua b/start/lspconfig-0.1.8/lua/lspconfig/async.lua new file mode 100644 index 0000000..eb82b30 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/async.lua @@ -0,0 +1,70 @@ +local M = {} + +function M.run(func) + coroutine.resume(coroutine.create(function() + local status, err = pcall(func) + if not status then + vim.notify(('[lspconfig] unhandled error: %s'):format(tostring(err)), vim.log.levels.WARN) + end + end)) +end + +--- @param cmd string|string[] +--- @return string[]? +function M.run_command(cmd) + local co = assert(coroutine.running()) + + local stdout = {} + local stderr = {} + local exit_code = nil + + local jobid = vim.fn.jobstart(cmd, { + on_stdout = function(_, data, _) + data = table.concat(data, '\n') + if #data > 0 then + stdout[#stdout + 1] = data + end + end, + on_stderr = function(_, data, _) + stderr[#stderr + 1] = table.concat(data, '\n') + end, + on_exit = function(_, code, _) + exit_code = code + coroutine.resume(co) + end, + stdout_buffered = true, + stderr_buffered = true, + }) + + if jobid <= 0 then + vim.notify(('[lspconfig] unable to run cmd: %s'):format(cmd), vim.log.levels.WARN) + return nil + end + + coroutine.yield() + + if exit_code ~= 0 then + vim.notify( + ('[lspconfig] cmd failed with code %d: %s\n%s'):format(exit_code, cmd, table.concat(stderr, '')), + vim.log.levels.WARN + ) + return nil + end + + if next(stdout) == nil then + return nil + end + return stdout and stdout or nil +end + +function M.reenter() + if vim.in_fast_event() then + local co = assert(coroutine.running()) + vim.schedule(function() + coroutine.resume(co) + end) + coroutine.yield() + end +end + +return M diff --git a/start/lspconfig-0.1.8/lua/lspconfig/configs.lua b/start/lspconfig-0.1.8/lua/lspconfig/configs.lua new file mode 100644 index 0000000..04eecce --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/configs.lua @@ -0,0 +1,295 @@ +local util = require 'lspconfig.util' +local async = require 'lspconfig.async' +local api, validate, lsp, uv, fn = vim.api, vim.validate, vim.lsp, vim.loop, vim.fn +local tbl_deep_extend = vim.tbl_deep_extend + +local configs = {} + +--- @class lspconfig.Config : vim.lsp.ClientConfig +--- @field enabled? boolean +--- @field single_file_support? boolean +--- @field filetypes? string[] +--- @field filetype? string +--- @field on_new_config? function +--- @field autostart? boolean +--- @field package _on_attach? fun(client: vim.lsp.Client, bufnr: integer) + +--- @param cmd any +local function sanitize_cmd(cmd) + if cmd and type(cmd) == 'table' and not vim.tbl_isempty(cmd) then + local original = cmd[1] + cmd[1] = vim.fn.exepath(cmd[1]) + if #cmd[1] == 0 then + cmd[1] = original + end + end +end + +function configs.__newindex(t, config_name, config_def) + validate { + name = { config_name, 's' }, + default_config = { config_def.default_config, 't' }, + on_new_config = { config_def.on_new_config, 'f', true }, + on_attach = { config_def.on_attach, 'f', true }, + commands = { config_def.commands, 't', true }, + } + + if config_def.default_config.deprecate then + vim.deprecate( + config_name, + config_def.default_config.deprecate.to, + config_def.default_config.deprecate.version, + 'lspconfig', + false + ) + end + + if config_def.commands then + for k, v in pairs(config_def.commands) do + validate { + ['command.name'] = { k, 's' }, + ['command.fn'] = { v[1], 'f' }, + } + end + else + config_def.commands = {} + end + + local M = {} + + local default_config = tbl_deep_extend('keep', config_def.default_config, util.default_config) + + -- Force this part. + default_config.name = config_name + + --- @param user_config lspconfig.Config + function M.setup(user_config) + local lsp_group = api.nvim_create_augroup('lspconfig', { clear = false }) + + validate { + cmd = { + user_config.cmd, + { 'f', 't' }, + true, + }, + root_dir = { user_config.root_dir, 'f', true }, + filetypes = { user_config.filetype, 't', true }, + on_new_config = { user_config.on_new_config, 'f', true }, + on_attach = { user_config.on_attach, 'f', true }, + commands = { user_config.commands, 't', true }, + } + if user_config.commands then + for k, v in pairs(user_config.commands) do + validate { + ['command.name'] = { k, 's' }, + ['command.fn'] = { v[1], 'f' }, + } + end + end + + local config = tbl_deep_extend('keep', user_config, default_config) + + sanitize_cmd(config.cmd) + + if util.on_setup then + pcall(util.on_setup, config, user_config) + end + + if config.autostart == true then + local event_conf = config.filetypes and { event = 'FileType', pattern = config.filetypes } + or { event = 'BufReadPost' } + api.nvim_create_autocmd(event_conf.event, { + pattern = event_conf.pattern or '*', + callback = function(opt) + M.manager:try_add(opt.buf) + end, + group = lsp_group, + desc = string.format( + 'Checks whether server %s should start a new instance or attach to an existing one.', + config.name + ), + }) + end + + local get_root_dir = config.root_dir + + function M.launch(bufnr) + bufnr = bufnr or api.nvim_get_current_buf() + if not api.nvim_buf_is_valid(bufnr) then + return + end + local bufname = api.nvim_buf_get_name(bufnr) + if (#bufname == 0 and not config.single_file_support) or (#bufname ~= 0 and not util.bufname_valid(bufname)) then + return + end + + local pwd = uv.cwd() + + async.run(function() + local root_dir + if get_root_dir then + root_dir = get_root_dir(util.path.sanitize(bufname), bufnr) + async.reenter() + if not api.nvim_buf_is_valid(bufnr) then + return + end + end + + if root_dir then + api.nvim_create_autocmd('BufReadPost', { + pattern = fn.fnameescape(root_dir) .. '/*', + callback = function(arg) + if #M.manager:clients() == 0 then + return true + end + M.manager:try_add_wrapper(arg.buf, root_dir) + end, + group = lsp_group, + desc = string.format( + 'Checks whether server %s should attach to a newly opened buffer inside workspace %q.', + config.name, + root_dir + ), + }) + + for _, buf in ipairs(api.nvim_list_bufs()) do + local buf_name = api.nvim_buf_get_name(buf) + if util.bufname_valid(buf_name) then + local buf_dir = util.path.sanitize(buf_name) + if buf_dir:sub(1, root_dir:len()) == root_dir then + M.manager:try_add_wrapper(buf, root_dir) + end + end + end + elseif config.single_file_support then + -- This allows on_new_config to use the parent directory of the file + -- Effectively this is the root from lspconfig's perspective, as we use + -- this to attach additional files in the same parent folder to the same server. + -- We just no longer send rootDirectory or workspaceFolders during initialization. + if not api.nvim_buf_is_valid(bufnr) or (#bufname ~= 0 and not util.bufname_valid(bufname)) then + return + end + local pseudo_root = #bufname == 0 and pwd or util.path.dirname(util.path.sanitize(bufname)) + M.manager:add(pseudo_root, true, bufnr) + end + end) + end + + -- Used by :LspInfo + M.get_root_dir = get_root_dir + M.filetypes = config.filetypes + M.handlers = config.handlers + M.cmd = config.cmd + M.autostart = config.autostart + + -- In the case of a reload, close existing things. + local reload = false + if M.manager then + for _, client in ipairs(M.manager:clients()) do + client.stop(true) + end + reload = true + M.manager = nil + end + + local make_config = function(root_dir) + local new_config = tbl_deep_extend('keep', vim.empty_dict(), config) --[[@as lspconfig.Config]] + new_config.capabilities = tbl_deep_extend('keep', new_config.capabilities, { + workspace = { + configuration = true, + }, + }) + + if config_def.on_new_config then + pcall(config_def.on_new_config, new_config, root_dir) + end + if config.on_new_config then + pcall(config.on_new_config, new_config, root_dir) + end + + new_config.on_init = util.add_hook_after(new_config.on_init, function(client, result) + -- Handle offset encoding by default + if result.offsetEncoding then + client.offset_encoding = result.offsetEncoding + end + + -- Send `settings` to server via workspace/didChangeConfiguration + function client.workspace_did_change_configuration(settings) + if not settings then + return + end + if vim.tbl_isempty(settings) then + settings = { [vim.type_idx] = vim.types.dictionary } + end + return client.notify('workspace/didChangeConfiguration', { + settings = settings, + }) + end + end) + + -- Save the old _on_attach so that we can reference it via the BufEnter. + new_config._on_attach = new_config.on_attach + new_config.on_attach = function(client, bufnr) + if bufnr == api.nvim_get_current_buf() then + M._setup_buffer(client.id, bufnr) + else + if api.nvim_buf_is_valid(bufnr) then + api.nvim_create_autocmd('BufEnter', { + callback = function() + M._setup_buffer(client.id, bufnr) + end, + group = lsp_group, + buffer = bufnr, + once = true, + desc = 'Reattaches the server with the updated configurations if changed.', + }) + end + end + end + + new_config.root_dir = root_dir + new_config.workspace_folders = { + { + uri = vim.uri_from_fname(root_dir), + name = string.format('%s', root_dir), + }, + } + return new_config + end + + local manager = require('lspconfig.manager').new(config, make_config) + + M.manager = manager + M.make_config = make_config + if reload and config.autostart ~= false then + for _, bufnr in ipairs(api.nvim_list_bufs()) do + manager:try_add_wrapper(bufnr) + end + end + end + + function M._setup_buffer(client_id, bufnr) + local client = lsp.get_client_by_id(client_id) + if not client then + return + end + local config = client.config --[[@as lspconfig.Config]] + if config._on_attach then + config._on_attach(client, bufnr) + end + if client.config.commands and not vim.tbl_isempty(client.config.commands) then + M.commands = vim.tbl_deep_extend('force', M.commands, client.config.commands) + end + if not M.commands_created and not vim.tbl_isempty(M.commands) then + util.create_module_commands(config_name, M.commands) + end + end + + M.commands = config_def.commands + M.name = config_name + M.document_config = config_def + + rawset(t, config_name, M) +end + +return setmetatable({}, configs) diff --git a/start/lspconfig-0.1.8/lua/lspconfig/manager.lua b/start/lspconfig-0.1.8/lua/lspconfig/manager.lua new file mode 100644 index 0000000..9b2c7d0 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/manager.lua @@ -0,0 +1,302 @@ +local api = vim.api +local lsp = vim.lsp +local uv = vim.loop + +local async = require 'lspconfig.async' +local util = require 'lspconfig.util' + +---@param client vim.lsp.Client +---@param root_dir string +---@return boolean +local function check_in_workspace(client, root_dir) + if not client.workspace_folders then + return false + end + + for _, dir in ipairs(client.workspace_folders) do + if (root_dir .. '/'):sub(1, #dir.name + 1) == dir.name .. '/' then + return true + end + end + + return false +end + +--- @class lspconfig.Manager +--- @field _clients table<string,integer[]> +--- @field config lspconfig.Config +--- @field make_config fun(root_dir: string): lspconfig.Config +local M = {} + +--- @param config lspconfig.Config +--- @param make_config fun(root_dir: string): lspconfig.Config +--- @return lspconfig.Manager +function M.new(config, make_config) + return setmetatable({ + _clients = {}, + config = config, + make_config = make_config, + }, { + __index = M, + }) +end + +--- @private +--- @param clients table<string,integer[]> +--- @param root_dir string +--- @param client_name string +--- @return vim.lsp.Client? +local function get_client(clients, root_dir, client_name) + if vim.tbl_isempty(clients) then + return + end + + if clients[root_dir] then + for _, id in pairs(clients[root_dir]) do + local client = lsp.get_client_by_id(id) + if client and client.name == client_name then + return client + end + end + end + + for _, ids in pairs(clients) do + for _, id in ipairs(ids) do + local client = lsp.get_client_by_id(id) + if client and client.name == client_name then + return client + end + end + end +end + +--- @private +--- @param bufnr integer +--- @param root string +--- @param client_id integer +function M:_attach_and_cache(bufnr, root, client_id) + local clients = self._clients + lsp.buf_attach_client(bufnr, client_id) + if not clients[root] then + clients[root] = {} + end + if not vim.tbl_contains(clients[root], client_id) then + clients[root][#clients[root] + 1] = client_id + end +end + +--- @private +--- @param bufnr integer +--- @param root_dir string +--- @param client vim.lsp.Client +function M:_register_workspace_folders(bufnr, root_dir, client) + local params = { + event = { + added = { { uri = vim.uri_from_fname(root_dir), name = root_dir } }, + removed = {}, + }, + } + client.rpc.notify('workspace/didChangeWorkspaceFolders', params) + if not client.workspace_folders then + client.workspace_folders = {} + end + client.workspace_folders[#client.workspace_folders + 1] = params.event.added[1] + self:_attach_and_cache(bufnr, root_dir, client.id) +end + +--- @private +--- @param bufnr integer +--- @param new_config lspconfig.Config +--- @param root_dir string +--- @param single_file boolean +function M:_start_new_client(bufnr, new_config, root_dir, single_file) + -- do nothing if the client is not enabled + if new_config.enabled == false then + return + end + if not new_config.cmd then + vim.notify( + string.format( + '[lspconfig] cmd not defined for %q. Manually set cmd in the setup {} call according to server_configurations.md, see :help lspconfig-index.', + new_config.name + ), + vim.log.levels.ERROR + ) + return + end + + local clients = self._clients + + new_config.on_exit = util.add_hook_before(new_config.on_exit, function() + for index, id in pairs(clients[root_dir]) do + local exist = assert(lsp.get_client_by_id(id)) + if exist.name == new_config.name then + table.remove(clients[root_dir], index) + end + end + end) + + -- Launch the server in the root directory used internally by lspconfig, if otherwise unset + -- also check that the path exist + if not new_config.cmd_cwd and uv.fs_realpath(root_dir) then + new_config.cmd_cwd = root_dir + end + + -- Sending rootDirectory and workspaceFolders as null is not explicitly + -- codified in the spec. Certain servers crash if initialized with a NULL + -- root directory. + if single_file then + new_config.root_dir = nil + new_config.workspace_folders = nil + end + + -- TODO: Replace lsp.start_client with lsp.start + local client_id, err = lsp.start_client(new_config) + if not client_id then + if err then + vim.notify(err, vim.log.levels.WARN) + end + return + end + self:_attach_and_cache(bufnr, root_dir, client_id) +end + +--- @private +--- @param bufnr integer +--- @param new_config lspconfig.Config +--- @param root_dir string +--- @param client vim.lsp.Client +--- @param single_file boolean +function M:_attach_or_spawn(bufnr, new_config, root_dir, client, single_file) + if check_in_workspace(client, root_dir) then + return self:_attach_and_cache(bufnr, root_dir, client.id) + end + + local supported = vim.tbl_get(client, 'server_capabilities', 'workspace', 'workspaceFolders', 'supported') + if supported then + return self:_register_workspace_folders(bufnr, root_dir, client) + end + self:_start_new_client(bufnr, new_config, root_dir, single_file) +end + +--- @private +--- @param bufnr integer +--- @param new_config lspconfig.Config +--- @param root_dir string +--- @param client vim.lsp.Client +--- @param single_file boolean +function M:_attach_after_client_initialized(bufnr, new_config, root_dir, client, single_file) + local timer = assert(uv.new_timer()) + timer:start( + 0, + 10, + vim.schedule_wrap(function() + if client.initialized and client.server_capabilities and not timer:is_closing() then + self:_attach_or_spawn(bufnr, new_config, root_dir, client, single_file) + timer:stop() + timer:close() + end + end) + ) +end + +---@param root_dir string +---@param single_file boolean +---@param bufnr integer +function M:add(root_dir, single_file, bufnr) + root_dir = util.path.sanitize(root_dir) + local new_config = self.make_config(root_dir) + local client = get_client(self._clients, root_dir, new_config.name) + + if not client then + return self:_start_new_client(bufnr, new_config, root_dir, single_file) + end + + if self._clients[root_dir] or single_file then + lsp.buf_attach_client(bufnr, client.id) + return + end + + -- make sure neovim had exchanged capabilities from language server + -- it's useful to check server support workspaceFolders or not + if client.initialized and client.server_capabilities then + self:_attach_or_spawn(bufnr, new_config, root_dir, client, single_file) + else + self:_attach_after_client_initialized(bufnr, new_config, root_dir, client, single_file) + end +end + +--- @return vim.lsp.Client[] +function M:clients() + local res = {} + for _, client_ids in pairs(self._clients) do + for _, id in ipairs(client_ids) do + res[#res + 1] = lsp.get_client_by_id(id) + end + end + return res +end + +--- Try to attach the buffer `bufnr` to a client using this config, creating +--- a new client if one doesn't already exist for `bufnr`. +--- @param bufnr integer +--- @param project_root? string +function M:try_add(bufnr, project_root) + bufnr = bufnr or api.nvim_get_current_buf() + + if vim.bo[bufnr].buftype == 'nofile' then + return + end + + local bufname = api.nvim_buf_get_name(bufnr) + if #bufname == 0 and not self.config.single_file_support then + return + end + + if #bufname ~= 0 and not util.bufname_valid(bufname) then + return + end + + if project_root then + self:add(project_root, false, bufnr) + return + end + + local buf_path = util.path.sanitize(bufname) + + local get_root_dir = self.config.root_dir + + local pwd = assert(uv.cwd()) + + async.run(function() + local root_dir + if get_root_dir then + root_dir = get_root_dir(buf_path, bufnr) + async.reenter() + if not api.nvim_buf_is_valid(bufnr) then + return + end + end + + if root_dir then + self:add(root_dir, false, bufnr) + elseif self.config.single_file_support then + local pseudo_root = #bufname == 0 and pwd or util.path.dirname(buf_path) + self:add(pseudo_root, true, bufnr) + end + end) +end + +--- Check that the buffer `bufnr` has a valid filetype according to +--- `config.filetypes`, then do `manager.try_add(bufnr)`. +--- @param bufnr integer +--- @param project_root? string +function M:try_add_wrapper(bufnr, project_root) + local config = self.config + -- `config.filetypes = nil` means all filetypes are valid. + if not config.filetypes or vim.tbl_contains(config.filetypes, vim.bo[bufnr].filetype) then + self:try_add(bufnr, project_root) + end +end + +return M diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/agda_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/agda_ls.lua new file mode 100644 index 0000000..07d6e93 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/agda_ls.lua @@ -0,0 +1,17 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'als' }, + filetypes = { 'agda' }, + root_dir = util.root_pattern('.git', '*.agda-lib'), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/agda/agda-language-server + +Language Server for Agda. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/aiken.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/aiken.lua new file mode 100644 index 0000000..8025fe1 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/aiken.lua @@ -0,0 +1,25 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'aiken', 'lsp' }, + filetypes = { 'aiken' }, + root_dir = function(fname) + return util.root_pattern('aiken.toml', '.git')(fname) + end, + }, + docs = { + description = [[ +https://github.com/aiken-lang/aiken + +A language server for Aiken Programming Language. +[Installation](https://aiken-lang.org/installation-instructions) + +It can be i +]], + default_config = { + cmd = { 'aiken', 'lsp' }, + root_dir = [[root_pattern("aiken.toml", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/als.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/als.lua new file mode 100644 index 0000000..7d916ad --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/als.lua @@ -0,0 +1,37 @@ +local util = require 'lspconfig.util' +local bin_name = 'ada_language_server' + +if vim.fn.has 'win32' == 1 then + bin_name = 'ada_language_server.exe' +end + +return { + default_config = { + cmd = { bin_name }, + filetypes = { 'ada' }, + root_dir = util.root_pattern('Makefile', '.git', '*.gpr', '*.adc'), + }, + docs = { + description = [[ +https://github.com/AdaCore/ada_language_server + +Installation instructions can be found [here](https://github.com/AdaCore/ada_language_server#Install). + +Can be configured by passing a "settings" object to `als.setup{}`: + +```lua +require('lspconfig').als.setup{ + settings = { + ada = { + projectFile = "project.gpr"; + scenarioVariables = { ... }; + } + } +} +``` +]], + default_config = { + root_dir = [[util.root_pattern("Makefile", ".git", "*.gpr", "*.adc")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/anakin_language_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/anakin_language_server.lua new file mode 100644 index 0000000..f0c281c --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/anakin_language_server.lua @@ -0,0 +1,78 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'anakinls' }, + filetypes = { 'python' }, + root_dir = function(fname) + local root_files = { + 'pyproject.toml', + 'setup.py', + 'setup.cfg', + 'requirements.txt', + 'Pipfile', + } + return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + settings = { + anakinls = { + pyflakes_errors = { + -- Full list: https://github.com/PyCQA/pyflakes/blob/master/pyflakes/messages.py + + 'ImportStarNotPermitted', + + 'UndefinedExport', + 'UndefinedLocal', + 'UndefinedName', + + 'DuplicateArgument', + 'MultiValueRepeatedKeyLiteral', + 'MultiValueRepeatedKeyVariable', + + 'FutureFeatureNotDefined', + 'LateFutureImport', + + 'ReturnOutsideFunction', + 'YieldOutsideFunction', + 'ContinueOutsideLoop', + 'BreakOutsideLoop', + + 'TwoStarredExpressions', + 'TooManyExpressionsInStarredAssignment', + + 'ForwardAnnotationSyntaxError', + 'RaiseNotImplemented', + + 'StringDotFormatExtraPositionalArguments', + 'StringDotFormatExtraNamedArguments', + 'StringDotFormatMissingArgument', + 'StringDotFormatMixingAutomatic', + 'StringDotFormatInvalidFormat', + + 'PercentFormatInvalidFormat', + 'PercentFormatMixedPositionalAndNamed', + 'PercentFormatUnsupportedFormat', + 'PercentFormatPositionalCountMismatch', + 'PercentFormatExtraNamedArguments', + 'PercentFormatMissingArgument', + 'PercentFormatExpectedMapping', + 'PercentFormatExpectedSequence', + 'PercentFormatStarRequiresSequence', + }, + }, + }, + }, + docs = { + description = [[ +https://pypi.org/project/anakin-language-server/ + +`anakin-language-server` is yet another Jedi Python language server. + +Available options: + +* Initialization: https://github.com/muffinmad/anakin-language-server#initialization-option +* Configuration: https://github.com/muffinmad/anakin-language-server#configuration-options + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/angularls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/angularls.lua new file mode 100644 index 0000000..a720d44 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/angularls.lua @@ -0,0 +1,67 @@ +local util = require 'lspconfig.util' + +-- Angular requires a node_modules directory to probe for @angular/language-service and typescript +-- in order to use your projects configured versions. +-- This defaults to the vim cwd, but will get overwritten by the resolved root of the file. +local function get_probe_dir(root_dir) + local project_root = util.find_node_modules_ancestor(root_dir) + + return project_root and (project_root .. '/node_modules') or '' +end + +local default_probe_dir = get_probe_dir(vim.fn.getcwd()) + +return { + default_config = { + cmd = { + 'ngserver', + '--stdio', + '--tsProbeLocations', + default_probe_dir, + '--ngProbeLocations', + default_probe_dir, + }, + filetypes = { 'typescript', 'html', 'typescriptreact', 'typescript.tsx' }, + -- Check for angular.json since that is the root of the project. + -- Don't check for tsconfig.json or package.json since there are multiple of these + -- in an angular monorepo setup. + root_dir = util.root_pattern 'angular.json', + }, + on_new_config = function(new_config, new_root_dir) + local new_probe_dir = get_probe_dir(new_root_dir) + + -- We need to check our probe directories because they may have changed. + new_config.cmd = { + 'ngserver', + '--stdio', + '--tsProbeLocations', + new_probe_dir, + '--ngProbeLocations', + new_probe_dir, + } + end, + docs = { + description = [[ +https://github.com/angular/vscode-ng-language-service + +`angular-language-server` can be installed via npm `npm install -g @angular/language-server`. + +Note, that if you override the default `cmd`, you must also update `on_new_config` to set `new_config.cmd` during startup. + +```lua +local project_library_path = "/path/to/project/lib" +local cmd = {"ngserver", "--stdio", "--tsProbeLocations", project_library_path , "--ngProbeLocations", project_library_path} + +require'lspconfig'.angularls.setup{ + cmd = cmd, + on_new_config = function(new_config,new_root_dir) + new_config.cmd = cmd + end, +} +``` + ]], + default_config = { + root_dir = [[root_pattern("angular.json")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ansiblels.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ansiblels.lua new file mode 100644 index 0000000..acf78f2 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ansiblels.lua @@ -0,0 +1,43 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'ansible-language-server', '--stdio' }, + settings = { + ansible = { + python = { + interpreterPath = 'python', + }, + ansible = { + path = 'ansible', + }, + executionEnvironment = { + enabled = false, + }, + validation = { + enabled = true, + lint = { + enabled = true, + path = 'ansible-lint', + }, + }, + }, + }, + filetypes = { 'yaml.ansible' }, + root_dir = util.root_pattern('ansible.cfg', '.ansible-lint'), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/ansible/vscode-ansible + +Language server for the ansible configuration management tool. + +`ansible-language-server` can be installed via `npm`: + +```sh +npm install -g @ansible/ansible-language-server +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/antlersls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/antlersls.lua new file mode 100644 index 0000000..ea4cf87 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/antlersls.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'antlersls', '--stdio' }, + filetypes = { 'html', 'antlers' }, + root_dir = util.root_pattern 'composer.json', + }, + docs = { + description = [[ +https://www.npmjs.com/package/antlers-language-server + +`antlersls` can be installed via `npm`: +```sh +npm install -g antlers-language-server +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/apex_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/apex_ls.lua new file mode 100644 index 0000000..baea475 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/apex_ls.lua @@ -0,0 +1,46 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'apexcode' }, + root_dir = util.root_pattern 'sfdx-project.json', + on_new_config = function(config) + if not config.cmd and config.apex_jar_path then + config.cmd = { + vim.env.JAVA_HOME and util.path.join(vim.env.JAVA_HOME, 'bin', 'java') or 'java', + '-cp', + config.apex_jar_path, + '-Ddebug.internal.errors=true', + '-Ddebug.semantic.errors=' .. tostring(config.apex_enable_semantic_errors or false), + '-Ddebug.completion.statistics=' .. tostring(config.apex_enable_completion_statistics or false), + '-Dlwc.typegeneration.disabled=true', + } + if config.apex_jvm_max_heap then + table.insert(config.cmd, '-Xmx' .. config.apex_jvm_max_heap) + end + table.insert(config.cmd, 'apex.jorje.lsp.ApexLanguageServerLauncher') + end + end, + }, + docs = { + description = [[ +https://github.com/forcedotcom/salesforcedx-vscode + +Language server for Apex. + +For manual installation, download the JAR file from the [VSCode +extension](https://github.com/forcedotcom/salesforcedx-vscode/tree/develop/packages/salesforcedx-vscode-apex). + +```lua +require'lspconfig'.apex_ls.setup { + apex_jar_path = '/path/to/apex-jorje-lsp.jar', + apex_enable_semantic_errors = false, -- Whether to allow Apex Language Server to surface semantic errors + apex_enable_completion_statistics = false, -- Whether to allow Apex Language Server to collect telemetry on code completion usage +} +``` +]], + default_config = { + root_dir = [[root_pattern('sfdx-project.json')]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/arduino_language_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/arduino_language_server.lua new file mode 100644 index 0000000..f1d73e2 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/arduino_language_server.lua @@ -0,0 +1,87 @@ +local util = require 'lspconfig.util' + +local default_capabilities = vim.lsp.protocol.make_client_capabilities() +default_capabilities.textDocument.semanticTokens = vim.NIL +default_capabilities.workspace.semanticTokens = vim.NIL + +return { + default_config = { + filetypes = { 'arduino' }, + root_dir = util.root_pattern '*.ino', + cmd = { + 'arduino-language-server', + }, + capabilities = default_capabilities, + }, + docs = { + description = [[ +https://github.com/arduino/arduino-language-server + +Language server for Arduino + +The `arduino-language-server` can be installed by running: + +``` +go install github.com/arduino/arduino-language-server@latest +``` + +The `arduino-cli` tool must also be installed. Follow [these +installation instructions](https://arduino.github.io/arduino-cli/latest/installation/) for +your platform. + +After installing `arduino-cli`, follow [these +instructions](https://arduino.github.io/arduino-cli/latest/getting-started/#create-a-configuration-file) +for generating a configuration file if you haven't done so already, and make +sure you [install any relevant platforms +libraries](https://arduino.github.io/arduino-cli/latest/getting-started/#install-the-core-for-your-board). + +The language server also requires `clangd` to be installed. Follow [these +installation instructions](https://clangd.llvm.org/installation) for your +platform. + +If you don't have a sketch yet create one. + +```sh +$ arduino-cli sketch new test +$ cd test +``` + +You will need a `sketch.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. + + +First gather some information about your board. Make sure your board is connected and run the following: + +```sh +$ arduino-cli board list +Port Protocol Type Board Name FQBN Core +/dev/ttyACM0 serial Serial Port (USB) Arduino Uno arduino:avr:uno arduino:avr +``` + +Then generate the file: + +```sh +arduino-cli board attach -p /dev/ttyACM0 -b arduino:avr:uno test.ino +``` + +The resulting file should like like this: + +```yaml +default_fqbn: arduino:avr:uno +default_port: /dev/ttyACM0 +``` + +Your folder structure should look like this: + +``` +. +├── test.ino +└── sketch.yaml +``` + +For further instruction about configuration options, run `arduino-language-server --help`. + +Note that an upstream bug makes keywords in some cases become undefined by the language server. +Ref: https://github.com/arduino/arduino-ide/issues/159 +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/asm_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/asm_lsp.lua new file mode 100644 index 0000000..102bcba --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/asm_lsp.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'asm-lsp' }, + filetypes = { 'asm', 'vmasm' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/bergercookie/asm-lsp + +Language Server for GAS/GO Assembly + +`asm-lsp` can be installed via cargo: +cargo install asm-lsp +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ast_grep.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ast_grep.lua new file mode 100644 index 0000000..35b0189 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ast_grep.lua @@ -0,0 +1,37 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'ast-grep', 'lsp' }, + filetypes = { -- https://ast-grep.github.io/reference/languages.html + 'c', + 'cpp', + 'rust', + 'go', + 'java', + 'python', + 'javascript', + 'typescript', + 'html', + 'css', + 'kotlin', + 'dart', + 'lua', + }, + root_dir = util.root_pattern('sgconfig.yaml', 'sgconfig.yml'), + }, + docs = { + description = [[ +https://ast-grep.github.io/ + +ast-grep(sg) is a fast and polyglot tool for code structural search, lint, rewriting at large scale. +ast-grep LSP only works in projects that have `sgconfig.y[a]ml` in their root directories. +```sh +npm install [-g] @ast-grep/cli +``` +]], + default_config = { + root_dir = [[root_pattern('sgconfig.yaml', 'sgconfig.yml')]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/astro.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/astro.lua new file mode 100644 index 0000000..c28dcb6 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/astro.lua @@ -0,0 +1,35 @@ +local util = require 'lspconfig.util' + +local function get_typescript_server_path(root_dir) + local project_root = util.find_node_modules_ancestor(root_dir) + return project_root and (util.path.join(project_root, 'node_modules', 'typescript', 'lib')) or '' +end + +return { + default_config = { + cmd = { 'astro-ls', '--stdio' }, + filetypes = { 'astro' }, + root_dir = util.root_pattern('package.json', 'tsconfig.json', 'jsconfig.json', '.git'), + init_options = { + typescript = {}, + }, + on_new_config = function(new_config, new_root_dir) + if vim.tbl_get(new_config.init_options, 'typescript') and not new_config.init_options.typescript.tsdk then + new_config.init_options.typescript.tsdk = get_typescript_server_path(new_root_dir) + end + end, + }, + docs = { + description = [[ +https://github.com/withastro/language-tools/tree/main/packages/language-server + +`astro-ls` can be installed via `npm`: +```sh +npm install -g @astrojs/language-server +``` +]], + default_config = { + root_dir = [[root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/autotools_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/autotools_ls.lua new file mode 100644 index 0000000..f5bc2f7 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/autotools_ls.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +local root_files = { 'configure.ac', 'Makefile', 'Makefile.am', '*.mk' } + +return { + default_config = { + cmd = { 'autotools-language-server' }, + filetypes = { 'config', 'automake', 'make' }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/Freed-Wu/autotools-language-server + +`autotools-language-server` can be installed via `pip`: +```sh +pip install autotools-language-server +``` + +Language server for autoconf, automake and make using tree sitter in python. +]], + default_config = { + root_dir = { 'configure.ac', 'Makefile', 'Makefile.am', '*.mk' }, + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/awk_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/awk_ls.lua new file mode 100644 index 0000000..ff1087d --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/awk_ls.lua @@ -0,0 +1,22 @@ +if vim.version().major == 0 and vim.version().minor < 7 then + vim.notify('The AWK language server requires nvim >= 0.7', vim.log.levels.ERROR) + return +end + +return { + default_config = { + cmd = { 'awk-language-server' }, + filetypes = { 'awk' }, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/Beaglefoot/awk-language-server/ + +`awk-language-server` can be installed via `npm`: +```sh +npm install -g awk-language-server +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/azure_pipelines_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/azure_pipelines_ls.lua new file mode 100644 index 0000000..3e2fe94 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/azure_pipelines_ls.lua @@ -0,0 +1,44 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'azure-pipelines-language-server', '--stdio' }, + filetypes = { 'yaml' }, + root_dir = util.root_pattern 'azure-pipelines.yml', + single_file_support = true, + settings = {}, + }, + docs = { + description = [[ +https://github.com/microsoft/azure-pipelines-language-server + +An Azure Pipelines language server + +`azure-pipelines-ls` can be installed via `npm`: + +```sh +npm install -g azure-pipelines-language-server +``` + +By default `azure-pipelines-ls` will only work in files named `azure-pipelines.yml`, this can be changed by providing additional settings like so: +```lua +require("lspconfig").azure_pipelines_ls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + schemas = { + ["https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/master/service-schema.json"] = { + "/azure-pipeline*.y*l", + "/*.azure*", + "Azure-Pipelines/**/*.y*l", + "Pipelines/*.y*l", + }, + }, + }, + }, +} +``` +The Azure Pipelines LSP is a fork of `yaml-language-server` and as such the same settings can be passed to it as `yaml-language-server`. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bacon_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bacon_ls.lua new file mode 100644 index 0000000..8acf12f --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bacon_ls.lua @@ -0,0 +1,39 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'bacon-ls' }, + filetypes = { 'rust' }, + root_dir = util.root_pattern('.bacon-locations', 'Cargo.toml'), + single_file_support = true, + settings = {}, + }, + docs = { + description = [[ +https://github.com/crisidev/bacon-ls + +A Language Server Protocol wrapper for [bacon](https://dystroy.org/bacon/). +It offers textDocument/diagnostic and workspace/diagnostic capabilities for Rust +workspaces using the Bacon export locations file. + +It requires `bacon` and `bacon-ls` to be installed on the system using +[mason.nvim](https://github.com/williamboman/mason.nvim) or manually:util + +```sh +$ cargo install --locked bacon bacon-ls +``` + +Settings can be changed using the `settings` dictionary:util + +```lua +settings = { + -- Bacon export filename, default .bacon-locations + locationsFile = ".bacon-locations", + -- Maximum time in seconds the LSP server waits for Bacon to update the + -- export file before loading the new diagnostics + waitTimeSeconds = 10 +} +``` + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/basedpyright.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/basedpyright.lua new file mode 100644 index 0000000..fa45d14 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/basedpyright.lua @@ -0,0 +1,80 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'pyproject.toml', + 'setup.py', + 'setup.cfg', + 'requirements.txt', + 'Pipfile', + 'pyrightconfig.json', + '.git', +} + +local function organize_imports() + local params = { + command = 'basedpyright.organizeimports', + arguments = { vim.uri_from_bufnr(0) }, + } + + local clients = util.get_lsp_clients { + bufnr = vim.api.nvim_get_current_buf(), + name = 'basedpyright', + } + for _, client in ipairs(clients) do + client.request('workspace/executeCommand', params, nil, 0) + end +end + +local function set_python_path(path) + local clients = util.get_lsp_clients { + bufnr = vim.api.nvim_get_current_buf(), + name = 'basedpyright', + } + for _, client in ipairs(clients) do + if client.settings then + client.settings.python = vim.tbl_deep_extend('force', client.settings.python or {}, { pythonPath = path }) + else + client.config.settings = vim.tbl_deep_extend('force', client.config.settings, { python = { pythonPath = path } }) + end + client.notify('workspace/didChangeConfiguration', { settings = nil }) + end +end + +return { + default_config = { + cmd = { 'basedpyright-langserver', '--stdio' }, + filetypes = { 'python' }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) + end, + single_file_support = true, + settings = { + basedpyright = { + analysis = { + autoSearchPaths = true, + useLibraryCodeForTypes = true, + diagnosticMode = 'openFilesOnly', + }, + }, + }, + }, + commands = { + PyrightOrganizeImports = { + organize_imports, + description = 'Organize Imports', + }, + PyrightSetPythonPath = { + set_python_path, + description = 'Reconfigure basedpyright with the provided python path', + nargs = 1, + complete = 'file', + }, + }, + docs = { + description = [[ +https://detachhead.github.io/basedpyright + +`basedpyright`, a static type checker and language server for python +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bashls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bashls.lua new file mode 100644 index 0000000..953da74 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bashls.lua @@ -0,0 +1,37 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'bash-language-server', 'start' }, + settings = { + bashIde = { + -- Glob pattern for finding and parsing shell script files in the workspace. + -- Used by the background analysis features across files. + + -- Prevent recursive scanning which will cause issues when opening a file + -- directly in the home directory (e.g. ~/foo.sh). + -- + -- Default upstream pattern is "**/*@(.sh|.inc|.bash|.command)". + globPattern = vim.env.GLOB_PATTERN or '*@(.sh|.inc|.bash|.command)', + }, + }, + filetypes = { 'sh' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/bash-lsp/bash-language-server + +`bash-language-server` can be installed via `npm`: +```sh +npm i -g bash-language-server +``` + +Language server for bash, written using tree sitter in typescript. +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/beancount.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/beancount.lua new file mode 100644 index 0000000..c1f3465 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/beancount.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'beancount-language-server', '--stdio' }, + filetypes = { 'beancount', 'bean' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + init_options = {}, + }, + docs = { + description = [[ +https://github.com/polarmutex/beancount-language-server#installation + +See https://github.com/polarmutex/beancount-language-server#configuration for configuration options +]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bicep.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bicep.lua new file mode 100644 index 0000000..1ec7032 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bicep.lua @@ -0,0 +1,47 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'bicep' }, + root_dir = util.find_git_ancestor, + init_options = {}, + }, + docs = { + description = [=[ +https://github.com/azure/bicep +Bicep language server + +Bicep language server can be installed by downloading and extracting a release of bicep-langserver.zip from [Bicep GitHub releases](https://github.com/Azure/bicep/releases). + +Bicep language server requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +Neovim does not have built-in support for the bicep filetype which is required for lspconfig to automatically launch the language server. + +Filetype detection can be added via an autocmd: +```lua +vim.cmd [[ autocmd BufNewFile,BufRead *.bicep set filetype=bicep ]] +``` + +**By default, bicep language server does not have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. + +```lua +local bicep_lsp_bin = "/path/to/bicep-langserver/Bicep.LangServer.dll" +require'lspconfig'.bicep.setup{ + cmd = { "dotnet", bicep_lsp_bin }; + ... +} +``` + +To download the latest release and place in /usr/local/bin/bicep-langserver: +```bash +(cd $(mktemp -d) \ + && curl -fLO https://github.com/Azure/bicep/releases/latest/download/bicep-langserver.zip \ + && rm -rf /usr/local/bin/bicep-langserver \ + && unzip -d /usr/local/bin/bicep-langserver bicep-langserver.zip) +``` +]=], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/biome.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/biome.lua new file mode 100644 index 0000000..102954e --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/biome.lua @@ -0,0 +1,35 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'biome', 'lsp-proxy' }, + filetypes = { + 'javascript', + 'javascriptreact', + 'json', + 'jsonc', + 'typescript', + 'typescript.tsx', + 'typescriptreact', + 'astro', + 'svelte', + 'vue', + }, + root_dir = util.root_pattern('biome.json', 'biome.jsonc'), + single_file_support = false, + }, + docs = { + description = [[ +https://biomejs.dev + +Toolchain of the web. [Successor of Rome](https://biomejs.dev/blog/annoucing-biome). + +```sh +npm install [-g] @biomejs/biome +``` +]], + default_config = { + root_dir = [[root_pattern('biome.json', 'biome.jsonc')]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bitbake_language_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bitbake_language_server.lua new file mode 100644 index 0000000..726fa85 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bitbake_language_server.lua @@ -0,0 +1,14 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'bitbake-language-server' }, + filetypes = { 'bitbake' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +🛠️ bitbake language server +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/blueprint_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/blueprint_ls.lua new file mode 100644 index 0000000..6e9e645 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/blueprint_ls.lua @@ -0,0 +1,30 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'blueprint-compiler', 'lsp' }, + cmd_env = { + -- Prevent recursive scanning which will cause issues when opening a file + -- directly in the home directory (e.g. ~/foo.sh). + -- + -- Default upstream pattern is "**/*@(.sh|.inc|.bash|.command)". + GLOB_PATTERN = vim.env.GLOB_PATTERN or '*@(.blp)', + }, + filetypes = { 'blueprint' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://gitlab.gnome.org/jwestman/blueprint-compiler + +`blueprint-compiler` can be installed via your system package manager. + +Language server for the blueprint markup language, written in python and part +of the blueprint-compiler. +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bqnlsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bqnlsp.lua new file mode 100644 index 0000000..5d18e99 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bqnlsp.lua @@ -0,0 +1,45 @@ +local util = require 'lspconfig.util' + +-- set os dependent library path +local function library_path(path, cmd_env) + path = path or '/usr/local/lib' + cmd_env = cmd_env or {} + if vim.fn.has 'macunix' and not cmd_env.DYLD_LIBRARY_PATH then + cmd_env.DYLD_LIBRARY_PATH = path + elseif vim.fn.has 'linux' and not cmd_env.LD_LIBRARY_PATH then + cmd_env.LD_LIBRARY_PATH = path + end + return cmd_env +end + +return { + default_config = { + cmd = { 'bqnlsp' }, + filetypes = { 'bqn' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + libcbqnPath = nil, + on_new_config = function(new_config, _) + if new_config.libcbqnPath then + new_config.cmd_env = library_path(new_config.libcbqnPath, new_config.cmd_env) + end + end, + }, + docs = { + description = [[ +https://git.sr.ht/~detegr/bqnlsp + + +`bqnlsp`, a language server for BQN. + +The binary depends on the shared library of [CBQN](https://github.com/dzaima/CBQN) `libcbqn.so`. +If CBQN is installed system-wide (using `sudo make install` in its source directory) and `bqnlsp` errors that it can't find the shared library, update the linker cache by executing `sudo ldconfig`. +If CBQN has been installed in a non-standard directory or can't be installed globally pass `libcbqnPath = '/path/to/CBQN'` to the setup function. +This will set the environment variables `LD_LIBRARY_PATH` (Linux) or `DYLD_LIBRARY_PATH` (macOS) to the provided path. + + ]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bright_script.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bright_script.lua new file mode 100644 index 0000000..6d4ba82 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bright_script.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig/util' + +return { + default_config = { + cmd = { 'bsc', '--lsp', '--stdio' }, + filetypes = { 'brs' }, + single_file_support = true, + root_dir = util.root_pattern('makefile', 'Makefile', '.git'), + }, + docs = { + description = [[ +https://github.com/RokuCommunity/brighterscript + +`brightscript` can be installed via `npm`: +```sh +npm install -g brighterscript +``` +]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bsl_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bsl_ls.lua new file mode 100644 index 0000000..fef15f9 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bsl_ls.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'bsl', 'os' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ + https://github.com/1c-syntax/bsl-language-server + + Language Server Protocol implementation for 1C (BSL) - 1C:Enterprise 8 and OneScript languages. + + ]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/buck2.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/buck2.lua new file mode 100644 index 0000000..134a562 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/buck2.lua @@ -0,0 +1,27 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'buck2', 'lsp' }, + filetypes = { 'bzl' }, + root_dir = function(fname) + return util.root_pattern '.buckconfig'(fname) + end, + }, + docs = { + description = [=[ +https://github.com/facebook/buck2 + +Build system, successor to Buck + +To better detect Buck2 project files, the following can be added: + +``` +vim.cmd [[ autocmd BufRead,BufNewFile *.bxl,BUCK,TARGETS set filetype=bzl ]] +``` +]=], + default_config = { + root_dir = [[root_pattern(".buckconfig")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/buddy_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/buddy_ls.lua new file mode 100644 index 0000000..7343dd3 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/buddy_ls.lua @@ -0,0 +1,18 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'buddy-lsp-server' }, + filetypes = { 'mlir' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/buddy-compiler/buddy-mlir#buddy-lsp-server +The Language Server for the buddy-mlir, a drop-in replacement for mlir-lsp-server, +supporting new dialects defined in buddy-mlir. +`buddy-lsp-server` can be installed at the buddy-mlir repository (buddy-compiler/buddy-mlir) +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bufls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bufls.lua new file mode 100644 index 0000000..ba12ddb --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bufls.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'bufls', 'serve' }, + filetypes = { 'proto' }, + root_dir = function(fname) + return util.root_pattern('buf.work.yaml', '.git')(fname) + end, + }, + docs = { + description = [[ +https://github.com/bufbuild/buf-language-server + +`buf-language-server` can be installed via `go install`: +```sh +go install github.com/bufbuild/buf-language-server/cmd/bufls@latest +``` + +bufls is a Protobuf language server compatible with Buf modules and workspaces +]], + default_config = { + root_dir = [[root_pattern("buf.work.yaml", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bzl.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bzl.lua new file mode 100644 index 0000000..a2200f6 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/bzl.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'bzl', 'lsp', 'serve' }, + filetypes = { 'bzl' }, + -- https://docs.bazel.build/versions/5.4.1/build-ref.html#workspace + root_dir = util.root_pattern('WORKSPACE', 'WORKSPACE.bazel'), + }, + docs = { + description = [[ +https://bzl.io/ + +https://docs.stack.build/docs/cli/installation + +https://docs.stack.build/docs/vscode/starlark-language-server +]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cadence.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cadence.lua new file mode 100644 index 0000000..640fe5a --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cadence.lua @@ -0,0 +1,32 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'flow', 'cadence', 'language-server' }, + filetypes = { 'cdc' }, + init_options = { + numberOfAccounts = '1', + }, + root_dir = function(fname, _) + return util.root_pattern 'flow.json'(fname) or vim.env.HOME + end, + on_new_config = function(new_config, new_root_dir) + new_config.init_options.configPath = util.path.join(new_root_dir, 'flow.json') + end, + }, + docs = { + description = [[ +[Cadence Language Server](https://github.com/onflow/cadence-tools/tree/master/languageserver) +using the [flow-cli](https://developers.flow.com/tools/flow-cli). + +The `flow` command from flow-cli must be available. For install instructions see +[the docs](https://developers.flow.com/tools/flow-cli/install#install-the-flow-cli) or the +[Github page](https://github.com/onflow/flow-cli). + +By default the configuration is taken from the closest `flow.json` or the `flow.json` in the users home directory. +]], + default_config = { + root_dir = [[util.root_pattern('flow.json') or vim.env.HOME]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cairo_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cairo_ls.lua new file mode 100644 index 0000000..e79b34a --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cairo_ls.lua @@ -0,0 +1,30 @@ +local util = require 'lspconfig.util' + +local bin_name = 'cairo-language-server' +local cmd = { bin_name, '/C', '--node-ipc' } + +return { + default_config = { + init_options = { hostInfo = 'neovim' }, + cmd = cmd, + filetypes = { 'cairo' }, + root_dir = util.root_pattern('Scarb.toml', 'cairo_project.toml', '.git'), + }, + docs = { + description = [[ +[Cairo Language Server](https://github.com/starkware-libs/cairo/tree/main/crates/cairo-lang-language-server) + +First, install cairo following [this tutorial](https://medium.com/@elias.tazartes/ahead-of-the-curve-install-cairo-1-0-alpha-and-prepare-for-regenesis-85f4e3940e20) + +Then enable cairo language server in your lua configuration. +```lua +require'lspconfig'.cairo_ls.setup{} +``` + +*cairo-language-server is still under active development, some features might not work yet !* +]], + default_config = { + root_dir = [[root_pattern("Scarb.toml", "cairo_project.toml", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ccls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ccls.lua new file mode 100644 index 0000000..72977df --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ccls.lua @@ -0,0 +1,50 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'compile_commands.json', + '.ccls', +} + +return { + default_config = { + cmd = { 'ccls' }, + filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda' }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) + end, + offset_encoding = 'utf-32', + -- ccls does not support sending a null root directory + single_file_support = false, + }, + docs = { + description = [[ +https://github.com/MaskRay/ccls/wiki + +ccls relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) specified +as compile_commands.json or, for simpler projects, a .ccls. +For details on how to automatically generate one using CMake look [here](https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html). Alternatively, you can use [Bear](https://github.com/rizsotto/Bear). + +Customization options are passed to ccls at initialization time via init_options, a list of available options can be found [here](https://github.com/MaskRay/ccls/wiki/Customization#initialization-options). For example: + +```lua +local lspconfig = require'lspconfig' +lspconfig.ccls.setup { + init_options = { + compilationDatabaseDirectory = "build"; + index = { + threads = 0; + }; + clang = { + excludeArgs = { "-frounding-math"} ; + }; + } +} + +``` + +]], + default_config = { + root_dir = [[root_pattern('compile_commands.json', '.ccls', '.git')]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cds_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cds_lsp.lua new file mode 100644 index 0000000..a04876f --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cds_lsp.lua @@ -0,0 +1,33 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'package.json', + 'db', + 'srv', +} + +return { + default_config = { + cmd = { 'cds-lsp', '--stdio' }, + filetypes = { 'cds' }, + -- init_options = { provideFormatter = true }, -- needed to enable formatting capabilities + root_dir = util.root_pattern(unpack(root_files)), + single_file_support = true, + settings = { + cds = { validate = true }, + }, + }, + docs = { + description = [[ + +https://cap.cloud.sap/docs/ + +`cds-lsp` can be installed via `npm`: + +```sh +npm i -g @sap/cds-lsp +``` + +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/circom-lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/circom-lsp.lua new file mode 100644 index 0000000..dda5408 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/circom-lsp.lua @@ -0,0 +1,17 @@ +local util = require 'lspconfig/util' + +return { + default_config = { + cmd = { 'circom-lsp' }, + filetypes = { 'circom' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +[Circom Language Server](https://github.com/rubydusa/circom-lsp) + +`circom-lsp`, the language server for the Circom language. + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/clangd.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/clangd.lua new file mode 100644 index 0000000..732f556 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/clangd.lua @@ -0,0 +1,88 @@ +local util = require 'lspconfig.util' + +-- https://clangd.llvm.org/extensions.html#switch-between-sourceheader +local function switch_source_header(bufnr) + bufnr = util.validate_bufnr(bufnr) + local clangd_client = util.get_active_client_by_name(bufnr, 'clangd') + local params = { uri = vim.uri_from_bufnr(bufnr) } + if clangd_client then + clangd_client.request('textDocument/switchSourceHeader', params, function(err, result) + if err then + error(tostring(err)) + end + if not result then + print 'Corresponding file cannot be determined' + return + end + vim.api.nvim_command('edit ' .. vim.uri_to_fname(result)) + end, bufnr) + else + print 'method textDocument/switchSourceHeader is not supported by any servers active on the current buffer' + end +end + +local root_files = { + '.clangd', + '.clang-tidy', + '.clang-format', + 'compile_commands.json', + 'compile_flags.txt', + 'configure.ac', -- AutoTools +} + +local default_capabilities = { + textDocument = { + completion = { + editsNearCursor = true, + }, + }, + offsetEncoding = { 'utf-8', 'utf-16' }, +} + +return { + default_config = { + cmd = { 'clangd' }, + filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda', 'proto' }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + capabilities = default_capabilities, + }, + commands = { + ClangdSwitchSourceHeader = { + function() + switch_source_header(0) + end, + description = 'Switch between source/header', + }, + }, + docs = { + description = [[ +https://clangd.llvm.org/installation.html + +- **NOTE:** Clang >= 11 is recommended! See [#23](https://github.com/neovim/nvim-lsp/issues/23). +- If `compile_commands.json` lives in a build directory, you should + symlink it to the root of your source tree. + ``` + ln -s /path/to/myproject/build/compile_commands.json /path/to/myproject/ + ``` +- clangd relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) + specified as compile_commands.json, see https://clangd.llvm.org/installation#compile_commandsjson +]], + default_config = { + root_dir = [[ + root_pattern( + '.clangd', + '.clang-tidy', + '.clang-format', + 'compile_commands.json', + 'compile_flags.txt', + 'configure.ac', + '.git' + ) + ]], + capabilities = [[default capabilities, with offsetEncoding utf-8]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/clarity_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/clarity_lsp.lua new file mode 100644 index 0000000..72a6197 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/clarity_lsp.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'clarity-lsp' }, + filetypes = { 'clar', 'clarity' }, + root_dir = util.root_pattern '.git', + }, + docs = { + description = [[ +`clarity-lsp` is a language server for the Clarity language. Clarity is a decidable smart contract language that optimizes for predictability and security. Smart contracts allow developers to encode essential business logic on a blockchain. + +To learn how to configure the clarity language server, see the [clarity-lsp documentation](https://github.com/hirosystems/clarity-lsp). +]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/clojure_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/clojure_lsp.lua new file mode 100644 index 0000000..45b1dd6 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/clojure_lsp.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'clojure-lsp' }, + filetypes = { 'clojure', 'edn' }, + root_dir = util.root_pattern('project.clj', 'deps.edn', 'build.boot', 'shadow-cljs.edn', '.git', 'bb.edn'), + }, + docs = { + description = [[ +https://github.com/clojure-lsp/clojure-lsp + +Clojure Language Server +]], + default_config = { + root_dir = [[root_pattern("project.clj", "deps.edn", "build.boot", "shadow-cljs.edn", ".git", "bb.edn")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cmake.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cmake.lua new file mode 100644 index 0000000..7f27fea --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cmake.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +local root_files = { 'CMakePresets.json', 'CTestConfig.cmake', '.git', 'build', 'cmake' } +return { + default_config = { + cmd = { 'cmake-language-server' }, + filetypes = { 'cmake' }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) + end, + single_file_support = true, + init_options = { + buildDirectory = 'build', + }, + }, + docs = { + description = [[ +https://github.com/regen100/cmake-language-server + +CMake LSP Implementation +]], + default_config = { + root_dir = [[root_pattern('CMakePresets.json', 'CTestConfig.cmake', '.git', 'build', 'cmake')]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cobol_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cobol_ls.lua new file mode 100644 index 0000000..867271b --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cobol_ls.lua @@ -0,0 +1,17 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'cobol-language-support' }, + filetypes = { 'cobol' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +Cobol language support + ]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/codeqlls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/codeqlls.lua new file mode 100644 index 0000000..695041e --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/codeqlls.lua @@ -0,0 +1,48 @@ +local util = require 'lspconfig.util' + +local workspace_folders = {} + +return { + default_config = { + cmd = { 'codeql', 'execute', 'language-server', '--check-errors', 'ON_CHANGE', '-q' }, + filetypes = { 'ql' }, + root_dir = util.root_pattern 'qlpack.yml', + log_level = vim.lsp.protocol.MessageType.Warning, + before_init = function(initialize_params) + table.insert(workspace_folders, { name = 'workspace', uri = initialize_params['rootUri'] }) + initialize_params['workspaceFolders'] = workspace_folders + end, + settings = { + search_path = vim.empty_dict(), + }, + }, + docs = { + description = [[ +Reference: +https://codeql.github.com/docs/codeql-cli/ + +Binaries: +https://github.com/github/codeql-cli-binaries + ]], + default_config = { + settings = { + search_path = [[list containing all search paths, eg: '~/codeql-home/codeql-repo']], + }, + }, + }, + on_new_config = function(config) + if type(config.settings.search_path) == 'table' and not vim.tbl_isempty(config.settings.search_path) then + local search_path = '--search-path=' + for _, path in ipairs(config.settings.search_path) do + search_path = search_path .. vim.fn.expand(path) .. ':' + table.insert(workspace_folders, { + name = 'workspace', + uri = string.format('file://%s', path), + }) + end + config.cmd = { 'codeql', 'execute', 'language-server', '--check-errors', 'ON_CHANGE', '-q', search_path } + else + config.cmd = { 'codeql', 'execute', 'language-server', '--check-errors', 'ON_CHANGE', '-q' } + end + end, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/coffeesense.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/coffeesense.lua new file mode 100644 index 0000000..f5b75a8 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/coffeesense.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'coffeesense-language-server', '--stdio' }, + filetypes = { 'coffee' }, + root_dir = util.root_pattern 'package.json', + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/phil294/coffeesense + +CoffeeSense Language Server +`coffeesense-language-server` can be installed via `npm`: +```sh +npm install -g coffeesense-language-server +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/contextive.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/contextive.lua new file mode 100644 index 0000000..b05309d --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/contextive.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'Contextive.LanguageServer' }, + root_dir = util.root_pattern('.contextive', '.git'), + }, + docs = { + description = [[ +https://github.com/dev-cycles/contextive + +Language Server for Contextive. + +Contextive allows you to define terms in a central file and provides auto-completion suggestions and hover panels for these terms wherever they're used. + +To install the language server, you need to download the appropriate [GitHub release asset](https://github.com/dev-cycles/contextive/releases/) for your operating system and architecture. + +After the download unzip the Contextive.LanguageServer binary and copy the file into a folder that is included in your system's PATH. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/coq_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/coq_lsp.lua new file mode 100644 index 0000000..aa492d4 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/coq_lsp.lua @@ -0,0 +1,17 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'coq-lsp' }, + filetypes = { 'coq' }, + root_dir = function(fname) + return util.root_pattern '_CoqProject'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/ejgallego/coq-lsp/ +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/crystalline.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/crystalline.lua new file mode 100644 index 0000000..ef4d6bc --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/crystalline.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'crystalline' }, + filetypes = { 'crystal' }, + root_dir = util.root_pattern 'shard.yml' or util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/elbywan/crystalline + +Crystal language server. +]], + default_config = { + root_dir = [[root_pattern('shard.yml', '.git')]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/csharp_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/csharp_ls.lua new file mode 100644 index 0000000..131862f --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/csharp_ls.lua @@ -0,0 +1,25 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'csharp-ls' }, + root_dir = function(fname) + return util.root_pattern '*.sln'(fname) or util.root_pattern '*.csproj'(fname) + end, + filetypes = { 'cs' }, + init_options = { + AutomaticWorkspaceInit = true, + }, + }, + docs = { + description = [[ +https://github.com/razzmatazz/csharp-language-server + +Language Server for C#. + +csharp-ls requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +The preferred way to install csharp-ls is with `dotnet tool install --global csharp-ls`. + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/css_variables.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/css_variables.lua new file mode 100644 index 0000000..dd9257d --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/css_variables.lua @@ -0,0 +1,65 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'css-variables-language-server', '--stdio' }, + filetypes = { 'css', 'scss', 'less' }, + root_dir = util.root_pattern('package.json', '.git'), + -- Same as inlined defaults that don't seem to work without hardcoding them in the lua config + -- https://github.com/vunguyentuan/vscode-css-variables/blob/763a564df763f17aceb5f3d6070e0b444a2f47ff/packages/css-variables-language-server/src/CSSVariableManager.ts#L31-L50 + settings = { + cssVariables = { + lookupFiles = { '**/*.less', '**/*.scss', '**/*.sass', '**/*.css' }, + blacklistFolders = { + '**/.cache', + '**/.DS_Store', + '**/.git', + '**/.hg', + '**/.next', + '**/.svn', + '**/bower_components', + '**/CVS', + '**/dist', + '**/node_modules', + '**/tests', + '**/tmp', + }, + }, + }, + }, + docs = { + description = [[ +https://github.com/vunguyentuan/vscode-css-variables/tree/master/packages/css-variables-language-server + +CSS variables autocompletion and go-to-definition + +`css-variables-language-server` can be installed via `npm`: + +```sh +npm i -g css-variables-language-server +``` +]], + default_config = { + root_dir = [[root_pattern("package.json", ".git") or bufdir]], + settings = [[ +cssVariables = { + lookupFiles = { '**/*.less', '**/*.scss', '**/*.sass', '**/*.css' }, + blacklistFolders = { + '**/.cache', + '**/.DS_Store', + '**/.git', + '**/.hg', + '**/.next', + '**/.svn', + '**/bower_components', + '**/CVS', + '**/dist', + '**/node_modules', + '**/tests', + '**/tmp', + }, +}, + ]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cssls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cssls.lua new file mode 100644 index 0000000..ac8e6a1 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cssls.lua @@ -0,0 +1,43 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'vscode-css-language-server', '--stdio' }, + filetypes = { 'css', 'scss', 'less' }, + init_options = { provideFormatter = true }, -- needed to enable formatting capabilities + root_dir = util.root_pattern('package.json', '.git'), + single_file_support = true, + settings = { + css = { validate = true }, + scss = { validate = true }, + less = { validate = true }, + }, + }, + docs = { + description = [[ + +https://github.com/hrsh7th/vscode-langservers-extracted + +`css-languageserver` can be installed via `npm`: + +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-css-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.cssls.setup { + capabilities = capabilities, +} +``` +]], + default_config = { + root_dir = [[root_pattern("package.json", ".git") or bufdir]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cssmodules_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cssmodules_ls.lua new file mode 100644 index 0000000..d7f5e3d --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cssmodules_ls.lua @@ -0,0 +1,24 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'cssmodules-language-server' }, + filetypes = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact' }, + root_dir = util.find_package_json_ancestor, + }, + docs = { + description = [[ +https://github.com/antonk52/cssmodules-language-server + +Language server for autocompletion and go-to-definition functionality for CSS modules. + +You can install cssmodules-language-server via npm: +```sh +npm install -g cssmodules-language-server +``` + ]], + default_config = { + root_dir = [[root_pattern("package.json")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cucumber_language_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cucumber_language_server.lua new file mode 100644 index 0000000..1fb4b8a --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cucumber_language_server.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'cucumber-language-server', '--stdio' }, + filetypes = { 'cucumber' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://cucumber.io +https://github.com/cucumber/common +https://www.npmjs.com/package/@cucumber/language-server + +Language server for Cucumber. + +`cucumber-language-server` can be installed via `npm`: +```sh +npm install -g @cucumber/language-server +``` + ]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/custom_elements_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/custom_elements_ls.lua new file mode 100644 index 0000000..e71d7f8 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/custom_elements_ls.lua @@ -0,0 +1,39 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + init_options = { hostInfo = 'neovim' }, + cmd = { 'custom-elements-languageserver', '--stdio' }, + root_dir = util.root_pattern('tsconfig.json', 'package.json', 'jsconfig.json', '.git'), + }, + docs = { + description = [[ +https://github.com/Matsuuu/custom-elements-language-server + +`custom-elements-languageserver` depends on `typescript`. Both packages can be installed via `npm`: +```sh +npm install -g typescript custom-elements-languageserver +``` +To configure typescript language server, add a +[`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or +[`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to the root of your +project. +Here's an example that disables type checking in JavaScript files. +```json +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "checkJs": false + }, + "exclude": [ + "node_modules" + ] +} +``` +]], + default_config = { + root_dir = [[root_pattern("tsconfig.json", "package.json", "jsconfig.json", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cypher_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cypher_ls.lua new file mode 100644 index 0000000..7c0cf2c --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/cypher_ls.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'cypher-language-server', '--stdio' }, + filetypes = { 'cypher' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/neo4j/cypher-language-support/tree/main/packages/language-server + +`cypher-language-server`, language server for Cypher query language. +Part of the umbrella project cypher-language-support: https://github.com/neo4j/cypher-language-support + +`cypher-language-server` can be installed via `npm`: +```sh +npm i -g @neo4j-cypher/language-server +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dafny.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dafny.lua new file mode 100644 index 0000000..be5e72b --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dafny.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'dafny', 'server' }, + filetypes = { 'dfy', 'dafny' }, + root_dir = function(fname) + util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ + Support for the Dafny language server. + + The default `cmd` uses "dafny server", which works on Dafny 4.0.0+. For + older versions of Dafny, you can compile the language server from source at + [dafny-lang/language-server-csharp](https://github.com/dafny-lang/language-server-csharp) + and set `cmd = {"dotnet", "<Path to your language server>"}`. + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dagger.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dagger.lua new file mode 100644 index 0000000..734249f --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dagger.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'cuelsp' }, + filetypes = { 'cue' }, + root_dir = function(fname) + return util.root_pattern('cue.mod', '.git')(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/dagger/cuelsp + +Dagger's lsp server for cuelang. +]], + default_config = { + root_dir = [[root_pattern("cue.mod", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dartls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dartls.lua new file mode 100644 index 0000000..83eda99 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dartls.lua @@ -0,0 +1,32 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'dart', 'language-server', '--protocol=lsp' }, + filetypes = { 'dart' }, + root_dir = util.root_pattern 'pubspec.yaml', + init_options = { + onlyAnalyzeProjectsWithOpenFiles = true, + suggestFromUnimportedLibraries = true, + closingLabels = true, + outline = true, + flutterOutline = true, + }, + settings = { + dart = { + completeFunctionCalls = true, + showTodos = true, + }, + }, + }, + docs = { + description = [[ +https://github.com/dart-lang/sdk/tree/master/pkg/analysis_server/tool/lsp_spec + +Language server for dart. +]], + default_config = { + root_dir = [[root_pattern("pubspec.yaml")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dcmls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dcmls.lua new file mode 100644 index 0000000..9667471 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dcmls.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'dcm', 'start-server', '--client=neovim' }, + filetypes = { 'dart' }, + root_dir = util.root_pattern 'pubspec.yaml', + }, + docs = { + description = [[ +https://dcm.dev/ + +Language server for DCM analyzer. +]], + default_config = { + root_dir = [[root_pattern("pubspec.yaml")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/debputy.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/debputy.lua new file mode 100644 index 0000000..eac358d --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/debputy.lua @@ -0,0 +1,16 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'debputy', 'lsp', 'server' }, + filetypes = { 'debcontrol', 'debcopyright', 'debchangelog', 'make', 'yaml' }, + root_dir = util.root_pattern 'debian', + }, + docs = { + description = [[ +https://salsa.debian.org/debian/debputy + +Language Server for Debian packages. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/delphi_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/delphi_ls.lua new file mode 100644 index 0000000..bd02d6f --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/delphi_ls.lua @@ -0,0 +1,49 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'DelphiLSP.exe' }, + filetypes = { 'pascal' }, + root_dir = util.root_pattern '*.dpr', + single_file_support = false, + }, + docs = { + description = [[ +Language server for Delphi from Embarcadero. +https://marketplace.visualstudio.com/items?itemName=EmbarcaderoTechnologies.delphilsp + +Note, the '*.delphilsp.json' file is required, more details at: +https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Using_DelphiLSP_Code_Insight_with_Other_Editors + +Below, you'll find a sample configuration for the lazy manager. +When on_attach is triggered, it signals DelphiLSP to load settings from a configuration file. +Without this step, DelphiLSP initializes but remains non-functional: + +```lua +"neovim/nvim-lspconfig", +lazy = false, +config = function() + local capabilities = require("cmp_nvim_lsp").default_capabilities() + local lspconfig = require("lspconfig") + + lspconfig.delphi_ls.setup({ + capabilities = capabilities, + + on_attach = function(client) + local lsp_config = vim.fs.find(function(name) + return name:match(".*%.delphilsp.json$") + end, { type = "file", path = client.config.root_dir, upward = false })[1] + + if lsp_config then + client.config.settings = { settingsFile = lsp_config } + client.notify("workspace/didChangeConfiguration", { settings = client.config.settings }) + else + vim.notify_once("delphi_ls: '*.delphilsp.json' config file not found") + end + end, + }) +end, +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/denols.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/denols.lua new file mode 100644 index 0000000..81bc1e6 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/denols.lua @@ -0,0 +1,127 @@ +local util = require 'lspconfig.util' +local lsp = vim.lsp + +local function buf_cache(bufnr, client) + local params = { + command = 'deno.cache', + arguments = { {}, vim.uri_from_bufnr(bufnr) }, + } + client.request('workspace/executeCommand', params, function(err, _result, ctx) + if err then + local uri = ctx.params.arguments[2] + vim.api.nvim_err_writeln('cache command failed for ' .. vim.uri_to_fname(uri)) + end + end, bufnr) +end + +local function virtual_text_document_handler(uri, res, client) + if not res then + return nil + end + + local lines = vim.split(res.result, '\n') + local bufnr = vim.uri_to_bufnr(uri) + + local current_buf = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false) + if #current_buf ~= 0 then + return nil + end + + vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, lines) + vim.api.nvim_set_option_value('readonly', true, { buf = bufnr }) + vim.api.nvim_set_option_value('modified', false, { buf = bufnr }) + vim.api.nvim_set_option_value('modifiable', false, { buf = bufnr }) + lsp.buf_attach_client(bufnr, client.id) +end + +local function virtual_text_document(uri, client) + local params = { + textDocument = { + uri = uri, + }, + } + local result = client.request_sync('deno/virtualTextDocument', params) + virtual_text_document_handler(uri, result, client) +end + +local function denols_handler(err, result, ctx, config) + if not result or vim.tbl_isempty(result) then + return nil + end + + local client = vim.lsp.get_client_by_id(ctx.client_id) + for _, res in pairs(result) do + local uri = res.uri or res.targetUri + if uri:match '^deno:' then + virtual_text_document(uri, client) + res['uri'] = uri + res['targetUri'] = uri + end + end + + lsp.handlers[ctx.method](err, result, ctx, config) +end + +return { + default_config = { + cmd = { 'deno', 'lsp' }, + cmd_env = { NO_COLOR = true }, + filetypes = { + 'javascript', + 'javascriptreact', + 'javascript.jsx', + 'typescript', + 'typescriptreact', + 'typescript.tsx', + }, + root_dir = util.root_pattern('deno.json', 'deno.jsonc', '.git'), + settings = { + deno = { + enable = true, + suggest = { + imports = { + hosts = { + ['https://deno.land'] = true, + }, + }, + }, + }, + }, + handlers = { + ['textDocument/definition'] = denols_handler, + ['textDocument/typeDefinition'] = denols_handler, + ['textDocument/references'] = denols_handler, + }, + }, + commands = { + DenolsCache = { + function() + local clients = util.get_lsp_clients { bufnr = 0, name = 'denols' } + if #clients > 0 then + buf_cache(0, clients[#clients]) + end + end, + description = 'Cache a module and all of its dependencies.', + }, + }, + docs = { + description = [[ +https://github.com/denoland/deno + +Deno's built-in language server + +To appropriately highlight codefences returned from denols, you will need to augment vim.g.markdown_fenced languages + in your init.lua. Example: + +```lua +vim.g.markdown_fenced_languages = { + "ts=typescript" +} +``` + +]], + default_config = { + root_dir = [[root_pattern("deno.json", "deno.jsonc", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dhall_lsp_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dhall_lsp_server.lua new file mode 100644 index 0000000..af910f3 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dhall_lsp_server.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'dhall-lsp-server' }, + filetypes = { 'dhall' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-lsp-server + +language server for dhall + +`dhall-lsp-server` can be installed via cabal: +```sh +cabal install dhall-lsp-server +``` +prebuilt binaries can be found [here](https://github.com/dhall-lang/dhall-haskell/releases). +]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/diagnosticls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/diagnosticls.lua new file mode 100644 index 0000000..6fdba0f --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/diagnosticls.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'diagnostic-languageserver', '--stdio' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + filetypes = {}, + }, + docs = { + description = [[ +https://github.com/iamcco/diagnostic-languageserver + +Diagnostic language server integrate with linters. +]], + default_config = { + filetypes = 'Empty by default, override to add filetypes', + root_dir = "Vim's starting directory", + init_options = 'Configuration from https://github.com/iamcco/diagnostic-languageserver#config--document', + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/digestif.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/digestif.lua new file mode 100644 index 0000000..f89ba63 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/digestif.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'digestif' }, + filetypes = { 'tex', 'plaintex', 'context' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/astoff/digestif + +Digestif is a code analyzer, and a language server, for LaTeX, ConTeXt et caterva. It provides + +context-sensitive completion, documentation, code navigation, and related functionality to any + +text editor that speaks the LSP protocol. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/docker_compose_language_service.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/docker_compose_language_service.lua new file mode 100644 index 0000000..9a92297 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/docker_compose_language_service.lua @@ -0,0 +1,27 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'docker-compose-langserver', '--stdio' }, + filetypes = { 'yaml.docker-compose' }, + root_dir = util.root_pattern('docker-compose.yaml', 'docker-compose.yml', 'compose.yaml', 'compose.yml'), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/microsoft/compose-language-service +This project contains a language service for Docker Compose. + +`compose-language-service` can be installed via `npm`: + +```sh +npm install @microsoft/compose-language-service +``` + +Note: If the docker-compose-langserver doesn't startup when entering a `docker-compose.yaml` file, make sure that the filetype is `yaml.docker-compose`. You can set with: `:set filetype=yaml.docker-compose`. +]], + default_config = { + root_dir = [[root_pattern("docker-compose.yaml", "docker-compose.yml", "compose.yaml", "compose.yml")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dockerls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dockerls.lua new file mode 100644 index 0000000..dde050b --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dockerls.lua @@ -0,0 +1,38 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'docker-langserver', '--stdio' }, + filetypes = { 'dockerfile' }, + root_dir = util.root_pattern 'Dockerfile', + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/rcjsuen/dockerfile-language-server-nodejs + +`docker-langserver` can be installed via `npm`: +```sh +npm install -g dockerfile-language-server-nodejs +``` + +Additional configuration can be applied in the following way: +```lua +require("lspconfig").dockerls.setup { + settings = { + docker = { + languageserver = { + formatter = { + ignoreMultilineInstructions = true, + }, + }, + } + } +} +``` + ]], + default_config = { + root_dir = [[root_pattern("Dockerfile")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dolmenls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dolmenls.lua new file mode 100644 index 0000000..1f0657e --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dolmenls.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'dolmenls' }, + filetypes = { 'smt2', 'tptp', 'p', 'cnf', 'icnf', 'zf' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/Gbury/dolmen/blob/master/doc/lsp.md + +`dolmenls` can be installed via `opam` +```sh +opam install dolmen_lsp +``` + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dotls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dotls.lua new file mode 100644 index 0000000..479f430 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dotls.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'dot-language-server', '--stdio' }, + filetypes = { 'dot' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/nikeee/dot-language-server + +`dot-language-server` can be installed via `npm`: +```sh +npm install -g dot-language-server +``` + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dprint.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dprint.lua new file mode 100644 index 0000000..7ef0fad --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/dprint.lua @@ -0,0 +1,33 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'dprint', 'lsp' }, + filetypes = { + 'javascript', + 'javascriptreact', + 'typescript', + 'typescriptreact', + 'json', + 'jsonc', + 'markdown', + 'python', + 'toml', + 'rust', + 'roslyn', + }, + root_dir = util.root_pattern('dprint.json', '.dprint.json', 'dprint.jsonc', '.dprint.jsonc'), + single_file_support = true, + settings = {}, + }, + docs = { + description = [[ +https://github.com/dprint/dprint + +Pluggable and configurable code formatting platform written in Rust. + ]], + default_config = { + root_dir = util.root_pattern('dprint.json', '.dprint.json', 'dprint.jsonc', '.dprint.jsonc'), + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/drools_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/drools_lsp.lua new file mode 100644 index 0000000..d5dd3cc --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/drools_lsp.lua @@ -0,0 +1,81 @@ +local util = require 'lspconfig.util' + +local function get_java_bin(config) + local java_bin = vim.tbl_get(config, 'drools', 'java', 'bin') + if not java_bin then + java_bin = vim.env.JAVA_HOME and util.path.join(vim.env.JAVA_HOME, 'bin', 'java') or 'java' + if vim.fn.has 'win32' == 1 then + java_bin = java_bin .. '.exe' + end + end + return java_bin +end + +local function get_java_opts(config) + local java_opts = vim.tbl_get(config, 'drools', 'java', 'opts') + return java_opts and java_opts or {} +end + +local function get_jar(config) + local jar = vim.tbl_get(config, 'drools', 'jar') + return jar and jar or 'drools-lsp-server-jar-with-dependencies.jar' +end + +local function get_cmd(config) + local cmd = vim.tbl_get(config, 'cmd') + if not cmd then + cmd = { get_java_bin(config) } + for _, o in ipairs(get_java_opts(config)) do + table.insert(cmd, o) + end + ---@diagnostic disable-next-line:missing-parameter + vim.list_extend(cmd, { '-jar', get_jar(config) }) + end + return cmd +end + +return { + default_config = { + filetypes = { 'drools' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + on_new_config = function(new_config) + new_config.cmd = get_cmd(new_config) + end, + }, + docs = { + description = [=[ +https://github.com/kiegroup/drools-lsp + +Language server for the [Drools Rule Language (DRL)](https://docs.drools.org/latest/drools-docs/docs-website/drools/language-reference/#con-drl_drl-rules). + +The `drools-lsp` server is a self-contained java jar file (`drools-lsp-server-jar-with-dependencies.jar`), and can be downloaded from [https://github.com/kiegroup/drools-lsp/releases/](https://github.com/kiegroup/drools-lsp/releases/). + +Configuration information: +```lua +-- Option 1) Specify the entire command: +require('lspconfig').drools_lsp.setup { + cmd = { '/path/to/java', '-jar', '/path/to/drools-lsp-server-jar-with-dependencies.jar' }, +} + +-- Option 2) Specify just the jar path (the JAVA_HOME environment variable will be respected if present): +require('lspconfig').drools_lsp.setup { + drools = { jar = '/path/to/drools-lsp-server-jar-with-dependencies.jar' }, +} + +-- Option 3) Specify the java bin and/or java opts in addition to the jar path: +require('lspconfig').drools_lsp.setup { + drools = { + java = { bin = '/path/to/java', opts = { '-Xmx100m' } }, + jar = '/path/to/drools-lsp-server-jar-with-dependencies.jar', + }, +} +``` + +Neovim does not yet have automatic detection for the `drools` filetype, but it can be added with: +```lua +vim.cmd [[ autocmd BufNewFile,BufRead *.drl set filetype=drools ]] +``` +]=], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ds_pinyin_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ds_pinyin_lsp.lua new file mode 100644 index 0000000..bc1d7ac --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ds_pinyin_lsp.lua @@ -0,0 +1,80 @@ +local util = require 'lspconfig.util' + +local bin_name = 'ds-pinyin-lsp' +if vim.fn.has 'win32' == 1 then + bin_name = bin_name .. '.exe' +end + +local function ds_pinyin_lsp_off(bufnr) + bufnr = util.validate_bufnr(bufnr) + local ds_pinyin_lsp_client = util.get_active_client_by_name(bufnr, 'ds_pinyin_lsp') + if ds_pinyin_lsp_client then + ds_pinyin_lsp_client.notify('$/turn/completion', { + ['completion_on'] = false, + }) + else + vim.notify 'notification $/turn/completion is not supported by any servers active on the current buffer' + end +end + +local function ds_pinyin_lsp_on(bufnr) + bufnr = util.validate_bufnr(bufnr) + local ds_pinyin_lsp_client = util.get_active_client_by_name(bufnr, 'ds_pinyin_lsp') + if ds_pinyin_lsp_client then + ds_pinyin_lsp_client.notify('$/turn/completion', { + ['completion_on'] = true, + }) + else + vim.notify 'notification $/turn/completion is not supported by any servers active on the current buffer' + end +end + +return { + default_config = { + cmd = { bin_name }, + filetypes = { 'markdown', 'org' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + init_options = { + completion_on = true, + show_symbols = true, + show_symbols_only_follow_by_hanzi = false, + show_symbols_by_n_times = 0, + match_as_same_as_input = true, + match_long_input = true, + max_suggest = 15, + }, + }, + commands = { + DsPinyinCompletionOff = { + function() + ds_pinyin_lsp_off(0) + end, + description = 'Turn off the ds-pinyin-lsp completion', + }, + DsPinyinCompletionOn = { + function() + ds_pinyin_lsp_on(0) + end, + description = 'Turn on the ds-pinyin-lsp completion', + }, + }, + docs = { + description = [=[ +https://github.com/iamcco/ds-pinyin-lsp +Dead simple Pinyin language server for input Chinese without IME(input method). +To install, download the latest [release](https://github.com/iamcco/ds-pinyin-lsp/releases) and ensure `ds-pinyin-lsp` is on your path. +And make ensure the database file `dict.db3` is also downloaded. And put the path to `dict.dbs` in the following code. + +```lua + +require('lspconfig').ds_pinyin_lsp.setup { + init_options = { + db_path = "your_path_to_database" + } +} + +``` +]=], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/earthlyls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/earthlyls.lua new file mode 100644 index 0000000..5b843eb --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/earthlyls.lua @@ -0,0 +1,16 @@ +local util = require 'lspconfig/util' + +return { + default_config = { + cmd = { 'earthlyls' }, + filetypes = { 'earthfile' }, + root_dir = util.root_pattern 'Earthfile', + }, + docs = { + description = [[ +https://github.com/glehmann/earthlyls + +A fast language server for earthly. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ecsact.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ecsact.lua new file mode 100644 index 0000000..e8eaa98 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ecsact.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'ecsact_lsp_server', '--stdio' }, + filetypes = { 'ecsact' }, + root_dir = util.root_pattern '.git', + single_file_support = true, + }, + + docs = { + description = [[ +https://github.com/ecsact-dev/ecsact_lsp_server + +Language server for Ecsact. + +The default cmd assumes `ecsact_lsp_server` is in your PATH. Typically from the +Ecsact SDK: https://ecsact.dev/start +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/efm.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/efm.lua new file mode 100644 index 0000000..f5f74ed --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/efm.lua @@ -0,0 +1,43 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'efm-langserver' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + + docs = { + description = [[ +https://github.com/mattn/efm-langserver + +General purpose Language Server that can use specified error message format generated from specified command. + +Requires at minimum EFM version [v0.0.38](https://github.com/mattn/efm-langserver/releases/tag/v0.0.38) to support +launching the language server on single files. If on an older version of EFM, disable single file support: + +```lua +require('lspconfig')['efm'].setup{ + settings = ..., -- You must populate this according to the EFM readme + filetypes = ..., -- Populate this according to the note below + single_file_support = false, -- This is the important line for supporting older version of EFM +} +``` + +Note: In order for neovim's built-in language server client to send the appropriate `languageId` to EFM, **you must +specify `filetypes` in your call to `setup{}`**. Otherwise `lspconfig` will launch EFM on the `BufEnter` instead +of the `FileType` autocommand, and the `filetype` variable used to populate the `languageId` will not yet be set. + +```lua +require('lspconfig')['efm'].setup{ + settings = ..., -- You must populate this according to the EFM readme + filetypes = { 'python','cpp','lua' } +} +``` + +]], + default_config = { + root_dir = [[util.root_pattern(".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/elixirls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/elixirls.lua new file mode 100644 index 0000000..3172f6a --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/elixirls.lua @@ -0,0 +1,44 @@ +return { + default_config = { + filetypes = { 'elixir', 'eelixir', 'heex', 'surface' }, + root_dir = function(fname) + local matches = vim.fs.find({ 'mix.exs' }, { upward = true, limit = 2, path = fname }) + local child_or_root_path, maybe_umbrella_path = unpack(matches) + local root_dir = vim.fs.dirname(maybe_umbrella_path or child_or_root_path) + + return root_dir + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/elixir-lsp/elixir-ls + +`elixir-ls` can be installed by following the instructions [here](https://github.com/elixir-lsp/elixir-ls#building-and-running). + +```bash +curl -fLO https://github.com/elixir-lsp/elixir-ls/releases/latest/download/elixir-ls.zip +unzip elixir-ls.zip -d /path/to/elixir-ls +# Unix +chmod +x /path/to/elixir-ls/language_server.sh +``` + +**By default, elixir-ls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of your unzipped elixir-ls. + +```lua +require'lspconfig'.elixirls.setup{ + -- Unix + cmd = { "/path/to/elixir-ls/language_server.sh" }; + -- Windows + cmd = { "/path/to/elixir-ls/language_server.bat" }; + ... +} +``` + +'root_dir' is chosen like this: if two or more directories containing `mix.exs` were found when searching directories upward, the second one (higher up) is chosen, with the assumption that it is the root of an umbrella app. Otherwise the directory containing the single mix.exs that was found is chosen. +]], + default_config = { + root_dir = '{{see description above}}', + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/elmls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/elmls.lua new file mode 100644 index 0000000..f42449d --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/elmls.lua @@ -0,0 +1,40 @@ +local util = require 'lspconfig.util' +local lsp = vim.lsp +local api = vim.api + +local default_capabilities = lsp.protocol.make_client_capabilities() +default_capabilities.offsetEncoding = { 'utf-8', 'utf-16' } +local elm_root_pattern = util.root_pattern 'elm.json' + +return { + default_config = { + cmd = { 'elm-language-server' }, + -- TODO(ashkan) if we comment this out, it will allow elmls to operate on elm.json. It seems like it could do that, but no other editor allows it right now. + filetypes = { 'elm' }, + root_dir = function(fname) + local filetype = api.nvim_buf_get_option(0, 'filetype') + if filetype == 'elm' or (filetype == 'json' and fname:match 'elm%.json$') then + return elm_root_pattern(fname) + end + end, + init_options = { + elmReviewDiagnostics = 'off', -- 'off' | 'warning' | 'error' + skipInstallPackageConfirmation = false, + disableElmLSDiagnostics = false, + onlyUpdateDiagnosticsOnSave = false, + }, + }, + docs = { + description = [[ +https://github.com/elm-tooling/elm-language-server#installation + +If you don't want to use Nvim to install it, then you can use: +```sh +npm install -g elm elm-test elm-format @elm-tooling/elm-language-server +``` +]], + default_config = { + root_dir = [[root_pattern("elm.json")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/elp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/elp.lua new file mode 100644 index 0000000..00678a5 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/elp.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'elp', 'server' }, + filetypes = { 'erlang' }, + root_dir = util.root_pattern('rebar.config', 'erlang.mk', '.git'), + single_file_support = true, + }, + docs = { + description = [[ +https://whatsapp.github.io/erlang-language-platform + +ELP integrates Erlang into modern IDEs via the language server protocol and was +inspired by rust-analyzer. +]], + default_config = { + root_dir = [[root_pattern('rebar.config', 'erlang.mk', '.git')]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ember.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ember.lua new file mode 100644 index 0000000..7702bd7 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ember.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'ember-language-server', '--stdio' }, + filetypes = { 'handlebars', 'typescript', 'javascript', 'typescript.glimmer', 'javascript.glimmer' }, + root_dir = util.root_pattern('ember-cli-build.js', '.git'), + }, + docs = { + description = [[ +https://github.com/ember-tooling/ember-language-server + +`ember-language-server` can be installed via `npm`: + +```sh +npm install -g @ember-tooling/ember-language-server +``` +]], + default_config = { + root_dir = [[root_pattern("ember-cli-build.js", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/emmet_language_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/emmet_language_server.lua new file mode 100644 index 0000000..8673dca --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/emmet_language_server.lua @@ -0,0 +1,35 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'emmet-language-server', '--stdio' }, + filetypes = { + 'css', + 'eruby', + 'html', + 'htmldjango', + 'javascriptreact', + 'less', + 'pug', + 'sass', + 'scss', + 'typescriptreact', + }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/olrtg/emmet-language-server + +Package can be installed via `npm`: +```sh +npm install -g @olrtg/emmet-language-server +``` +]], + default_config = { + root_dir = 'git root', + single_file_support = true, + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/emmet_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/emmet_ls.lua new file mode 100644 index 0000000..171bd56 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/emmet_ls.lua @@ -0,0 +1,38 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'emmet-ls', '--stdio' }, + filetypes = { + 'astro', + 'css', + 'eruby', + 'html', + 'htmldjango', + 'javascriptreact', + 'less', + 'pug', + 'sass', + 'scss', + 'svelte', + 'typescriptreact', + 'vue', + }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/aca/emmet-ls + +Package can be installed via `npm`: +```sh +npm install -g emmet-ls +``` +]], + default_config = { + root_dir = 'git root', + single_file_support = true, + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/erg_language_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/erg_language_server.lua new file mode 100644 index 0000000..9b198a8 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/erg_language_server.lua @@ -0,0 +1,27 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'erg', '--language-server' }, + filetypes = { 'erg' }, + root_dir = function(fname) + return util.root_pattern 'package.er'(fname) or util.find_git_ancestor(fname) + end, + }, + docs = { + description = [[ +https://github.com/erg-lang/erg#flags ELS + +ELS (erg-language-server) is a language server for the Erg programming language. + +erg-language-server can be installed via `cargo` and used as follows: + ```sh + cargo install erg --features els + erg --language-server + ``` + ]], + default_config = { + root_dir = [[root_pattern("package.er") or find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/erlangls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/erlangls.lua new file mode 100644 index 0000000..e2467f2 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/erlangls.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'erlang_ls' }, + filetypes = { 'erlang' }, + root_dir = util.root_pattern('rebar.config', 'erlang.mk', '.git'), + single_file_support = true, + }, + docs = { + description = [[ +https://erlang-ls.github.io + +Language Server for Erlang. + +Clone [erlang_ls](https://github.com/erlang-ls/erlang_ls) +Compile the project with `make` and copy resulting binaries somewhere in your $PATH eg. `cp _build/*/bin/* ~/local/bin` + +Installation instruction can be found [here](https://github.com/erlang-ls/erlang_ls). + +Installation requirements: + - [Erlang OTP 21+](https://github.com/erlang/otp) + - [rebar3 3.9.1+](https://github.com/erlang/rebar3) +]], + default_config = { + root_dir = [[root_pattern('rebar.config', 'erlang.mk', '.git')]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/esbonio.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/esbonio.lua new file mode 100644 index 0000000..ff13473 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/esbonio.lua @@ -0,0 +1,55 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'python3', '-m', 'esbonio' }, + filetypes = { 'rst' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/swyddfa/esbonio + +Esbonio is a language server for [Sphinx](https://www.sphinx-doc.org/en/master/) documentation projects. +The language server can be installed via pip + +``` +pip install esbonio +``` + +Since Sphinx is highly extensible you will get best results if you install the language server in the same +Python environment as the one used to build your documentation. To ensure that the correct Python environment +is picked up, you can either launch `nvim` with the correct environment activated. + +``` +source env/bin/activate +nvim +``` + +Or you can modify the default `cmd` to include the full path to the Python interpreter. + +```lua +require'lspconfig'.esbonio.setup { + cmd = { '/path/to/virtualenv/bin/python', '-m', 'esbonio' } +} +``` + +Esbonio supports a number of config values passed as `init_options` on startup, for example. + +```lua +require'lspconfig'.esbonio.setup { + init_options = { + server = { + logLevel = "debug" + }, + sphinx = { + confDir = "/path/to/docs", + srcDir = "${confDir}/../docs-src" + } +} +``` + +A full list and explanation of the available options can be found [here](https://docs.esbon.io/en/esbonio-language-server-v0.16.4/lsp/getting-started.html?editor=neovim-lspconfig#configuration) +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/eslint.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/eslint.lua new file mode 100644 index 0000000..c52f827 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/eslint.lua @@ -0,0 +1,202 @@ +local util = require 'lspconfig.util' +local lsp = vim.lsp + +local function fix_all(opts) + opts = opts or {} + + local eslint_lsp_client = util.get_active_client_by_name(opts.bufnr, 'eslint') + if eslint_lsp_client == nil then + return + end + + local request + if opts.sync then + request = function(bufnr, method, params) + eslint_lsp_client.request_sync(method, params, nil, bufnr) + end + else + request = function(bufnr, method, params) + eslint_lsp_client.request(method, params, nil, bufnr) + end + end + + local bufnr = util.validate_bufnr(opts.bufnr or 0) + request(0, 'workspace/executeCommand', { + command = 'eslint.applyAllFixes', + arguments = { + { + uri = vim.uri_from_bufnr(bufnr), + version = lsp.util.buf_versions[bufnr], + }, + }, + }) +end + +local root_file = { + '.eslintrc', + '.eslintrc.js', + '.eslintrc.cjs', + '.eslintrc.yaml', + '.eslintrc.yml', + '.eslintrc.json', + 'eslint.config.js', + 'eslint.config.mjs', + 'eslint.config.cjs', + 'eslint.config.ts', + 'eslint.config.mts', + 'eslint.config.cts', +} + +return { + default_config = { + cmd = { 'vscode-eslint-language-server', '--stdio' }, + filetypes = { + 'javascript', + 'javascriptreact', + 'javascript.jsx', + 'typescript', + 'typescriptreact', + 'typescript.tsx', + 'vue', + 'svelte', + 'astro', + }, + -- https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-file-formats + root_dir = function(fname) + root_file = util.insert_package_json(root_file, 'eslintConfig', fname) + return util.root_pattern(unpack(root_file))(fname) + end, + -- Refer to https://github.com/Microsoft/vscode-eslint#settings-options for documentation. + settings = { + validate = 'on', + packageManager = nil, + useESLintClass = false, + experimental = { + useFlatConfig = false, + }, + codeActionOnSave = { + enable = false, + mode = 'all', + }, + format = true, + quiet = false, + onIgnoredFiles = 'off', + rulesCustomizations = {}, + run = 'onType', + problems = { + shortenToSingleLine = false, + }, + -- nodePath configures the directory in which the eslint server should start its node_modules resolution. + -- This path is relative to the workspace folder (root dir) of the server instance. + nodePath = '', + -- use the workspace folder location or the file location (if no workspace folder is open) as the working directory + workingDirectory = { mode = 'location' }, + codeAction = { + disableRuleComment = { + enable = true, + location = 'separateLine', + }, + showDocumentation = { + enable = true, + }, + }, + }, + on_new_config = function(config, new_root_dir) + -- The "workspaceFolder" is a VSCode concept. It limits how far the + -- server will traverse the file system when locating the ESLint config + -- file (e.g., .eslintrc). + config.settings.workspaceFolder = { + uri = new_root_dir, + name = vim.fn.fnamemodify(new_root_dir, ':t'), + } + + -- Support flat config + if + vim.fn.filereadable(new_root_dir .. '/eslint.config.js') == 1 + or vim.fn.filereadable(new_root_dir .. '/eslint.config.mjs') == 1 + or vim.fn.filereadable(new_root_dir .. '/eslint.config.cjs') == 1 + or vim.fn.filereadable(new_root_dir .. '/eslint.config.ts') == 1 + or vim.fn.filereadable(new_root_dir .. '/eslint.config.mts') == 1 + or vim.fn.filereadable(new_root_dir .. '/eslint.config.cts') == 1 + then + config.settings.experimental.useFlatConfig = true + end + + -- Support Yarn2 (PnP) projects + local pnp_cjs = util.path.join(new_root_dir, '.pnp.cjs') + local pnp_js = util.path.join(new_root_dir, '.pnp.js') + if util.path.exists(pnp_cjs) or util.path.exists(pnp_js) then + config.cmd = vim.list_extend({ 'yarn', 'exec' }, config.cmd) + end + end, + handlers = { + ['eslint/openDoc'] = function(_, result) + if not result then + return + end + local sysname = vim.loop.os_uname().sysname + if sysname:match 'Windows' then + os.execute(string.format('start %q', result.url)) + elseif sysname:match 'Linux' then + os.execute(string.format('xdg-open %q', result.url)) + else + os.execute(string.format('open %q', result.url)) + end + return {} + end, + ['eslint/confirmESLintExecution'] = function(_, result) + if not result then + return + end + return 4 -- approved + end, + ['eslint/probeFailed'] = function() + vim.notify('[lspconfig] ESLint probe failed.', vim.log.levels.WARN) + return {} + end, + ['eslint/noLibrary'] = function() + vim.notify('[lspconfig] Unable to find ESLint library.', vim.log.levels.WARN) + return {} + end, + }, + }, + commands = { + EslintFixAll = { + function() + fix_all { sync = true, bufnr = 0 } + end, + description = 'Fix all eslint problems for this buffer', + }, + }, + docs = { + description = [[ +https://github.com/hrsh7th/vscode-langservers-extracted + +`vscode-eslint-language-server` is a linting engine for JavaScript / Typescript. +It can be installed via `npm`: + +```sh +npm i -g vscode-langservers-extracted +``` + +`vscode-eslint-language-server` provides an `EslintFixAll` command that can be used to format a document on save: +```lua +lspconfig.eslint.setup({ + --- ... + on_attach = function(client, bufnr) + vim.api.nvim_create_autocmd("BufWritePre", { + buffer = bufnr, + command = "EslintFixAll", + }) + end, +}) +``` + +See [vscode-eslint](https://github.com/microsoft/vscode-eslint/blob/55871979d7af184bf09af491b6ea35ebd56822cf/server/src/eslintServer.ts#L216-L229) for configuration options. + +Messages handled in lspconfig: `eslint/openDoc`, `eslint/confirmESLintExecution`, `eslint/probeFailed`, `eslint/noLibrary` + +Additional messages you can handle: `eslint/noConfig` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/facility_language_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/facility_language_server.lua new file mode 100644 index 0000000..c37069d --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/facility_language_server.lua @@ -0,0 +1,17 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'facility-language-server' }, + filetypes = { 'fsd' }, + single_file_support = true, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/FacilityApi/FacilityLanguageServer + +Facility language server protocol (LSP) support. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/fennel_language_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/fennel_language_server.lua new file mode 100644 index 0000000..919b544 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/fennel_language_server.lua @@ -0,0 +1,18 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'fennel-language-server' }, + filetypes = { 'fennel' }, + single_file_support = true, + root_dir = util.find_git_ancestor, + settings = {}, + }, + docs = { + description = [[ +https://github.com/rydesun/fennel-language-server + +Fennel language server protocol (LSP) support. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/fennel_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/fennel_ls.lua new file mode 100644 index 0000000..50a7739 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/fennel_ls.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +local default_capabilities = vim.lsp.protocol.make_client_capabilities() +default_capabilities.offsetEncoding = { 'utf-8', 'utf-16' } + +return { + default_config = { + cmd = { 'fennel-ls' }, + filetypes = { 'fennel' }, + root_dir = function(dir) + return util.find_git_ancestor(dir) + end, + settings = {}, + capabilities = default_capabilities, + }, + docs = { + description = [[ +https://sr.ht/~xerool/fennel-ls/ + +A language server for fennel. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/flow.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/flow.lua new file mode 100644 index 0000000..3ac59aa --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/flow.lua @@ -0,0 +1,27 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'npx', '--no-install', 'flow', 'lsp' }, + filetypes = { 'javascript', 'javascriptreact', 'javascript.jsx' }, + root_dir = util.root_pattern '.flowconfig', + }, + docs = { + description = [[ +https://flow.org/ +https://github.com/facebook/flow + +See below for how to setup Flow itself. +https://flow.org/en/docs/install/ + +See below for lsp command options. + +```sh +npx flow lsp --help +``` + ]], + default_config = { + root_dir = [[root_pattern(".flowconfig")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/flux_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/flux_lsp.lua new file mode 100644 index 0000000..3be9a1b --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/flux_lsp.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'flux-lsp' }, + filetypes = { 'flux' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/influxdata/flux-lsp +`flux-lsp` can be installed via `cargo`: +```sh +cargo install --git https://github.com/influxdata/flux-lsp +``` +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/foam_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/foam_ls.lua new file mode 100644 index 0000000..1a991b6 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/foam_ls.lua @@ -0,0 +1,25 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'foam-ls', '--stdio' }, + filetypes = { 'foam', 'OpenFOAM' }, + root_dir = function(fname) + return util.search_ancestors(fname, function(path) + if util.path.exists(util.path.join(path, 'system', 'controlDict')) then + return path + end + end) + end, + }, + docs = { + description = [[ +https://github.com/FoamScience/foam-language-server + +`foam-language-server` can be installed via `npm` +```sh +npm install -g foam-language-server +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/fortls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/fortls.lua new file mode 100644 index 0000000..41a0005 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/fortls.lua @@ -0,0 +1,36 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { + 'fortls', + '--notify_init', + '--hover_signature', + '--hover_language=fortran', + '--use_signature_help', + }, + filetypes = { 'fortran' }, + root_dir = function(fname) + return util.root_pattern '.fortls'(fname) or util.find_git_ancestor(fname) + end, + settings = {}, + }, + docs = { + description = [[ +https://github.com/gnikit/fortls + +fortls is a Fortran Language Server, the server can be installed via pip + +```sh +pip install fortls +``` + +Settings to the server can be passed either through the `cmd` option or through +a local configuration file e.g. `.fortls`. For more information +see the `fortls` [documentation](https://gnikit.github.io/fortls/options.html). + ]], + default_config = { + root_dir = [[root_pattern(".fortls")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/fsautocomplete.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/fsautocomplete.lua new file mode 100644 index 0000000..4858c04 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/fsautocomplete.lua @@ -0,0 +1,32 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'fsautocomplete', '--adaptive-lsp-server-enabled' }, + root_dir = util.root_pattern('*.sln', '*.fsproj', '.git'), + filetypes = { 'fsharp' }, + init_options = { + AutomaticWorkspaceInit = true, + }, + }, + docs = { + description = [[ +https://github.com/fsharp/FsAutoComplete + +Language Server for F# provided by FsAutoComplete (FSAC). + +FsAutoComplete requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +The preferred way to install FsAutoComplete is with `dotnet tool install --global fsautocomplete`. + +Instructions to compile from source are found on the main [repository](https://github.com/fsharp/FsAutoComplete). + +You may also need to configure the filetype as Vim defaults to Forth for `*.fs` files: + +`autocmd BufNewFile,BufRead *.fs,*.fsx,*.fsi set filetype=fsharp` + +This is automatically done by plugins such as [PhilT/vim-fsharp](https://github.com/PhilT/vim-fsharp), [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp), and [adelarsq/neofsharp.vim](https://github.com/adelarsq/neofsharp.vim). + + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/fsharp_language_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/fsharp_language_server.lua new file mode 100644 index 0000000..1abc606 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/fsharp_language_server.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'dotnet', 'FSharpLanguageServer.dll' }, + root_dir = util.root_pattern('*.sln', '*.fsproj', '.git'), + filetypes = { 'fsharp' }, + init_options = { + AutomaticWorkspaceInit = true, + }, + settings = {}, + }, + docs = { + description = [[ +F# Language Server +https://github.com/faldor20/fsharp-language-server + +An implementation of the language server protocol using the F# Compiler Service. + +Build the project from source and override the command path to location of DLL. + +If filetype determination is not already performed by an available plugin ([PhilT/vim-fsharp](https://github.com/PhilT/vim-fsharp), [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp), and [adelarsq/neofsharp.vim](https://github.com/adelarsq/neofsharp.vim). +), then the following must be added to initialization configuration: + + +`autocmd BufNewFile,BufRead *.fs,*.fsx,*.fsi set filetype=fsharp` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/fstar.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/fstar.lua new file mode 100644 index 0000000..d866c54 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/fstar.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'fstar.exe', '--lsp' }, + filetypes = { 'fstar' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/FStarLang/FStar + +LSP support is included in FStar. Make sure `fstar.exe` is in your PATH. +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/futhark_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/futhark_lsp.lua new file mode 100644 index 0000000..2521cc1 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/futhark_lsp.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'futhark', 'lsp' }, + filetypes = { 'futhark', 'fut' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/diku-dk/futhark + +Futhark Language Server + +This language server comes with the futhark compiler and is run with the command +``` +futhark lsp +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/gdscript.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/gdscript.lua new file mode 100644 index 0000000..5ae1799 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/gdscript.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +local port = os.getenv 'GDScript_Port' or '6005' +local cmd = { 'nc', 'localhost', port } + +if vim.fn.has 'nvim-0.8' == 1 then + cmd = vim.lsp.rpc.connect('127.0.0.1', port) +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'gd', 'gdscript', 'gdscript3' }, + root_dir = util.root_pattern('project.godot', '.git'), + }, + docs = { + description = [[ +https://github.com/godotengine/godot + +Language server for GDScript, used by Godot Engine. +]], + default_config = { + root_dir = [[util.root_pattern("project.godot", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/gdshader_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/gdshader_lsp.lua new file mode 100644 index 0000000..a01efa8 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/gdshader_lsp.lua @@ -0,0 +1,16 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'gdshader-lsp', '--stdio' }, + filetypes = { 'gdshader', 'gdshaderinc' }, + root_dir = util.root_pattern 'project.godot', + }, + docs = { + description = [[ +https://github.com/godofavacyn/gdshader-lsp + +A language server for the Godot Shading language. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ghcide.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ghcide.lua new file mode 100644 index 0000000..7f9307b --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ghcide.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'ghcide', '--lsp' }, + filetypes = { 'haskell', 'lhaskell' }, + root_dir = util.root_pattern('stack.yaml', 'hie-bios', 'BUILD.bazel', 'cabal.config', 'package.yaml'), + }, + + docs = { + description = [[ +https://github.com/digital-asset/ghcide + +A library for building Haskell IDE tooling. +"ghcide" isn't for end users now. Use "haskell-language-server" instead of "ghcide". +]], + default_config = { + root_dir = [[root_pattern("stack.yaml", "hie-bios", "BUILD.bazel", "cabal.config", "package.yaml")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ghdl_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ghdl_ls.lua new file mode 100644 index 0000000..0f9e118 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ghdl_ls.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'ghdl-ls' }, + filetypes = { 'vhdl' }, + root_dir = function(fname) + return util.root_pattern 'hdl-prj.json'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/ghdl/ghdl-language-server + +A language server for VHDL, using ghdl as its backend. + +`ghdl-ls` is part of pyghdl, for installation instructions see +[the upstream README](https://github.com/ghdl/ghdl/tree/master/pyGHDL/lsp). +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ginko_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ginko_ls.lua new file mode 100644 index 0000000..61f9de6 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ginko_ls.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'ginko_ls' }, + filetypes = { 'dts' }, + root_dir = util.find_git_ancestor, + settings = {}, + }, + docs = { + description = [[ +`ginko_ls` is meant to be a feature-complete language server for device-trees. +Language servers can be used in many editors, such as Visual Studio Code, Emacs +or Vim + +Install `ginko_ls` from https://github.com/Schottkyc137/ginko and add it to path + +`ginko_ls` doesn't require any configuration. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/gitlab_ci_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/gitlab_ci_ls.lua new file mode 100644 index 0000000..f9d8402 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/gitlab_ci_ls.lua @@ -0,0 +1,33 @@ +local util = require 'lspconfig.util' + +local cache_dir = util.path.join(vim.loop.os_homedir(), '.cache/gitlab-ci-ls/') +return { + default_config = { + cmd = { 'gitlab-ci-ls' }, + filetypes = { 'yaml.gitlab' }, + root_dir = util.root_pattern('.gitlab*', '.git'), + init_options = { + cache_path = cache_dir, + log_path = util.path.join(cache_dir, 'log/gitlab-ci-ls.log'), + }, + }, + docs = { + description = [[ +https://github.com/alesbrelih/gitlab-ci-ls + +Language Server for Gitlab CI + +`gitlab-ci-ls` can be installed via cargo: +cargo install gitlab-ci-ls +]], + default_config = { + cmd = { 'gitlab-ci-ls' }, + filetypes = { 'yaml.gitlab' }, + root_dir = [[util.root_pattern('.gitlab*', '.git')]], + init_options = { + cache_path = [[util.path.join(vim.loop.os_homedir(), '.cache/gitlab-ci-ls/')]], + log_path = [[util.path.join(util.path.join(vim.loop.os_homedir(), '.cache/gitlab-ci-ls/'), 'log/gitlab-ci-ls.log')]], + }, + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/gleam.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/gleam.lua new file mode 100644 index 0000000..ec5504c --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/gleam.lua @@ -0,0 +1,25 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'gleam', 'lsp' }, + filetypes = { 'gleam' }, + root_dir = function(fname) + return util.root_pattern('gleam.toml', '.git')(fname) + end, + }, + docs = { + description = [[ +https://github.com/gleam-lang/gleam + +A language server for Gleam Programming Language. +[Installation](https://gleam.run/getting-started/installing/) + +It can be i +]], + default_config = { + cmd = { 'gleam', 'lsp' }, + root_dir = [[root_pattern("gleam.toml", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/glint.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/glint.lua new file mode 100644 index 0000000..1d991cf --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/glint.lua @@ -0,0 +1,59 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'glint-language-server' }, + on_new_config = function(config, new_root_dir) + local project_root = util.find_node_modules_ancestor(new_root_dir) + -- Glint should not be installed globally. + local node_bin_path = util.path.join(project_root, 'node_modules', '.bin') + local path = node_bin_path .. util.path.path_separator .. vim.env.PATH + if config.cmd_env then + config.cmd_env.PATH = path + else + config.cmd_env = { PATH = path } + end + end, + filetypes = { + 'html.handlebars', + 'handlebars', + 'typescript', + 'typescript.glimmer', + 'javascript', + 'javascript.glimmer', + }, + root_dir = util.root_pattern( + '.glintrc.yml', + '.glintrc', + '.glintrc.json', + '.glintrc.js', + 'glint.config.js', + 'package.json' + ), + }, + docs = { + description = [[ + https://github.com/typed-ember/glint + + https://typed-ember.gitbook.io/glint/ + + `glint-language-server` is installed when adding `@glint/core` to your project's devDependencies: + + ```sh + npm install @glint/core --save-dev + ``` + + or + + ```sh + yarn add -D @glint/core + ``` + + or + + ```sh + pnpm add -D @glint/core + ``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/glsl_analyzer.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/glsl_analyzer.lua new file mode 100644 index 0000000..74ffbba --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/glsl_analyzer.lua @@ -0,0 +1,18 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'glsl_analyzer' }, + filetypes = { 'glsl', 'vert', 'tesc', 'tese', 'frag', 'geom', 'comp' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + capabilities = {}, + }, + docs = { + description = [[ +https://github.com/nolanderc/glsl_analyzer + +Language server for GLSL + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/glslls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/glslls.lua new file mode 100644 index 0000000..7d1c363 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/glslls.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'glslls', '--stdin' }, + filetypes = { 'glsl', 'vert', 'tesc', 'tese', 'frag', 'geom', 'comp' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + capabilities = { + textDocument = { + completion = { + editsNearCursor = true, + }, + }, + offsetEncoding = { 'utf-8', 'utf-16' }, + }, + }, + docs = { + description = [[ +https://github.com/svenstaro/glsl-language-server + +Language server implementation for GLSL + +`glslls` can be compiled and installed manually, or, if your distribution has access to the AUR, +via the `glsl-language-server` AUR package + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/golangci_lint_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/golangci_lint_ls.lua new file mode 100644 index 0000000..b1b51c4 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/golangci_lint_ls.lua @@ -0,0 +1,42 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'golangci-lint-langserver' }, + filetypes = { 'go', 'gomod' }, + init_options = { + command = { 'golangci-lint', 'run', '--out-format', 'json' }, + }, + root_dir = function(fname) + return util.root_pattern( + '.golangci.yml', + '.golangci.yaml', + '.golangci.toml', + '.golangci.json', + 'go.work', + 'go.mod', + '.git' + )(fname) + end, + }, + docs = { + description = [[ +Combination of both lint server and client + +https://github.com/nametake/golangci-lint-langserver +https://github.com/golangci/golangci-lint + + +Installation of binaries needed is done via + +``` +go install github.com/nametake/golangci-lint-langserver@latest +go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest +``` + +]], + default_config = { + root_dir = [[root_pattern('.golangci.yml', '.golangci.yaml', '.golangci.toml', '.golangci.json', 'go.work', 'go.mod', '.git')]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/gopls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/gopls.lua new file mode 100644 index 0000000..aceb38d --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/gopls.lua @@ -0,0 +1,37 @@ +local util = require 'lspconfig.util' +local async = require 'lspconfig.async' +local mod_cache = nil + +return { + default_config = { + cmd = { 'gopls' }, + filetypes = { 'go', 'gomod', 'gowork', 'gotmpl' }, + root_dir = function(fname) + -- see: https://github.com/neovim/nvim-lspconfig/issues/804 + if not mod_cache then + local result = async.run_command { 'go', 'env', 'GOMODCACHE' } + if result and result[1] then + mod_cache = vim.trim(result[1]) + end + end + if fname:sub(1, #mod_cache) == mod_cache then + local clients = util.get_lsp_clients { name = 'gopls' } + if #clients > 0 then + return clients[#clients].config.root_dir + end + end + return util.root_pattern('go.work', 'go.mod', '.git')(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/golang/tools/tree/master/gopls + +Google's lsp server for golang. +]], + default_config = { + root_dir = [[root_pattern("go.work", "go.mod", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/gradle_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/gradle_ls.lua new file mode 100644 index 0000000..6af1ee6 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/gradle_ls.lua @@ -0,0 +1,43 @@ +local util = require 'lspconfig.util' + +local bin_name = 'gradle-language-server' +if vim.fn.has 'win32' == 1 then + bin_name = bin_name .. '.bat' +end + +local root_files = { + 'settings.gradle', -- Gradle (multi-project) + 'build.gradle', -- Gradle +} + +return { + default_config = { + filetypes = { 'groovy' }, + root_dir = util.root_pattern(unpack(root_files)), + cmd = { bin_name }, + -- gradle-language-server expects init_options.settings to be defined + init_options = { + settings = { + gradleWrapperEnabled = true, + }, + }, + }, + docs = { + description = [[ +https://github.com/microsoft/vscode-gradle + +Microsoft's lsp server for gradle files + +If you're setting this up manually, build vscode-gradle using `./gradlew installDist` and point `cmd` to the `gradle-language-server` generated in the build directory +]], + default_config = { + root_dir = [[root_pattern("settings.gradle", "build.gradle")]], + cmd = { 'gradle-language-server' }, + init_options = { + settings = { + gradleWrapperEnabled = true, + }, + }, + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/grammarly.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/grammarly.lua new file mode 100644 index 0000000..6b37a14 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/grammarly.lua @@ -0,0 +1,34 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'grammarly-languageserver', '--stdio' }, + filetypes = { 'markdown' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + handlers = { + ['$/updateDocumentState'] = function() + return '' + end, + }, + init_options = { + clientId = 'client_BaDkMgx4X19X9UxxYRCXZo', + }, + }, + docs = { + description = [[ +https://github.com/znck/grammarly + +`grammarly-languageserver` can be installed via `npm`: + +```sh +npm i -g grammarly-languageserver +``` + +WARNING: Since this language server uses Grammarly's API, any document you open with it running is shared with them. Please evaluate their [privacy policy](https://www.grammarly.com/privacy-policy) before using this. +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/graphql.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/graphql.lua new file mode 100644 index 0000000..fa1e871 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/graphql.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'graphql-lsp', 'server', '-m', 'stream' }, + filetypes = { 'graphql', 'typescriptreact', 'javascriptreact' }, + root_dir = util.root_pattern('.graphqlrc*', '.graphql.config.*', 'graphql.config.*'), + }, + + docs = { + description = [[ +https://github.com/graphql/graphiql/tree/main/packages/graphql-language-service-cli + +`graphql-lsp` can be installed via `npm`: + +```sh +npm install -g graphql-language-service-cli +``` + +Note that you must also have [the graphql package](https://github.com/graphql/graphql-js) installed within your project and create a [GraphQL config file](https://the-guild.dev/graphql/config/docs). +]], + default_config = { + root_dir = [[util.root_pattern('.git', '.graphqlrc*', '.graphql.config.*', 'graphql.config.*')]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/groovyls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/groovyls.lua new file mode 100644 index 0000000..b4182f4 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/groovyls.lua @@ -0,0 +1,36 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { + 'java', + '-jar', + 'groovy-language-server-all.jar', + }, + filetypes = { 'groovy' }, + root_dir = function(fname) + return util.root_pattern 'Jenkinsfile'(fname) or util.find_git_ancestor(fname) + end, + }, + docs = { + description = [[ +https://github.com/prominic/groovy-language-server.git + +Requirements: + - Linux/macOS (for now) + - Java 11+ + +`groovyls` can be installed by following the instructions [here](https://github.com/prominic/groovy-language-server.git#build). + +If you have installed groovy language server, you can set the `cmd` custom path as follow: + +```lua +require'lspconfig'.groovyls.setup{ + -- Unix + cmd = { "java", "-jar", "path/to/groovyls/groovy-language-server-all.jar" }, + ... +} +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/guile_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/guile_ls.lua new file mode 100644 index 0000000..41b44ed --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/guile_ls.lua @@ -0,0 +1,30 @@ +local util = require 'lspconfig.util' +return { + default_config = { + cmd = { 'guile-lsp-server' }, + filetypes = { + 'scheme.guile', + }, + root_dir = function(fname) + return util.root_pattern 'guix.scm'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://codeberg.org/rgherdt/scheme-lsp-server + +The recommended way is to install guile-lsp-server is using Guix. Unfortunately it is still not available at the official Guix channels, but you can use the provided channel guix.scm in the repo: +```sh +guix package -f guix.scm +``` + +Checkout the repo for more info. + +Note: This LSP will start on `scheme.guile` filetype. You can set this file type using `:help modeline` or adding https://gitlab.com/HiPhish/guile.vim to your plugins to automatically set it. + ]], + default_config = { + root_dir = [[root_pattern("guix.scm", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/harper_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/harper_ls.lua new file mode 100644 index 0000000..0a989a6 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/harper_ls.lua @@ -0,0 +1,48 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'harper-ls', '--stdio' }, + filetypes = { + 'markdown', + 'rust', + 'typescript', + 'typescriptreact', + 'javascript', + 'python', + 'go', + 'c', + 'cpp', + 'ruby', + 'swift', + 'csharp', + 'toml', + 'lua', + }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/chilipepperhott/harper + +The language server for Harper, the slim, clean language checker for developers. + +See [docs](https://github.com/chilipepperhott/harper/tree/master/harper-ls#configuration) for more information on settings. + +In short, however, they should look something like this: +```lua +lspconfig.harper_ls.setup { + settings = { + ["harper-ls"] = { + userDictPath = "~/dict.txt" + } + }, +} +``` + ]], + default_config = { + root_dir = [[bufdir]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/haxe_language_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/haxe_language_server.lua new file mode 100644 index 0000000..1589c7b --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/haxe_language_server.lua @@ -0,0 +1,47 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'haxe-language-server' }, + filetypes = { 'haxe' }, + root_dir = util.root_pattern '*.hxml', + settings = { + haxe = { + executable = 'haxe', + }, + }, + init_options = { + displayArguments = { 'build.hxml' }, + }, + }, + docs = { + description = [[ +https://github.com/vshaxe/haxe-language-server + +The Haxe language server can be built by running the following commands from +the project's root directory: + + npm install + npx lix run vshaxe-build -t language-server + +This will create `bin/server.js`. Note that the server requires Haxe 3.4.0 or +higher. + +After building the language server, set the `cmd` setting in your setup +function: + +```lua +lspconfig.haxe_language_server.setup({ + cmd = {"node", "path/to/bin/server.js"}, +}) +``` + +By default, an HXML compiler arguments file named `build.hxml` is expected in +your project's root directory. If your file is named something different, +specify it using the `init_options.displayArguments` setting. +]], + default_config = { + root_dir = [[root_pattern("*.hxml")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hdl_checker.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hdl_checker.lua new file mode 100644 index 0000000..5cf2941 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hdl_checker.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'hdl_checker', '--lsp' }, + filetypes = { 'vhdl', 'verilog', 'systemverilog' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/suoto/hdl_checker +Language server for hdl-checker. +Install using: `pip install hdl-checker --upgrade` +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/helm_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/helm_ls.lua new file mode 100644 index 0000000..4908e23 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/helm_ls.lua @@ -0,0 +1,36 @@ +local util = require 'lspconfig.util' + +local default_capabilities = { + workspace = { + didChangeWatchedFiles = { + dynamicRegistration = true, + }, + }, +} + +return { + default_config = { + cmd = { 'helm_ls', 'serve' }, + filetypes = { 'helm' }, + root_dir = util.root_pattern 'Chart.yaml', + single_file_support = true, + capabilities = default_capabilities, + }, + docs = { + description = [[ +https://github.com/mrjosh/helm-ls + +Helm Language server. (This LSP is in early development) + +`helm Language server` can be installed by following the instructions [here](https://github.com/mrjosh/helm-ls). + +The default `cmd` assumes that the `helm_ls` binary can be found in `$PATH`. + +If need Helm file highlight use [vim-helm](https://github.com/towolf/vim-helm) plugin. +]], + default_config = { + root_dir = [[root_pattern("Chart.yaml")]], + capabilities = [[default capabilities, with dynamicRegistration for didChangeWatchedFiles true]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hhvm.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hhvm.lua new file mode 100644 index 0000000..0e8ac5c --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hhvm.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'hh_client', 'lsp' }, + filetypes = { 'php', 'hack' }, + root_dir = util.root_pattern '.hhconfig', + }, + docs = { + description = [[ +Language server for programs written in Hack +https://hhvm.com/ +https://github.com/facebook/hhvm +See below for how to setup HHVM & typechecker: +https://docs.hhvm.com/hhvm/getting-started/getting-started + ]], + default_config = { + root_dir = [[root_pattern(".hhconfig")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hie.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hie.lua new file mode 100644 index 0000000..96148ad --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hie.lua @@ -0,0 +1,34 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'hie-wrapper', '--lsp' }, + filetypes = { 'haskell' }, + root_dir = util.root_pattern('stack.yaml', 'package.yaml', '.git'), + }, + + docs = { + description = [[ +https://github.com/haskell/haskell-ide-engine + +the following init_options are supported (see https://github.com/haskell/haskell-ide-engine#configuration): +```lua +init_options = { + languageServerHaskell = { + hlintOn = bool; + maxNumberOfProblems = number; + diagnosticsDebounceDuration = number; + liquidOn = bool (default false); + completionSnippetsOn = bool (default true); + formatOnImportOn = bool (default true); + formattingProvider = string (default "brittany", alternate "floskell"); + } +} +``` + ]], + + default_config = { + root_dir = [[root_pattern("stack.yaml", "package.yaml", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hlasm.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hlasm.lua new file mode 100644 index 0000000..285b627 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hlasm.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'hlasm_language_server' }, + filetypes = { 'hlasm' }, + root_dir = util.root_pattern '.hlasmplugin', + single_file_support = true, + }, + docs = { + description = [[ + `hlasm_language_server` is a language server for the High Level Assembler language used on IBM SystemZ mainframes. + + To learn how to configure the HLASM language server, see the [HLASM Language Support documentation](https://github.com/eclipse-che4z/che-che4z-lsp-for-hlasm). + ]], + default_config = { + root_dir = [[root_pattern(".hlasmplugin")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hls.lua new file mode 100644 index 0000000..4390440 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hls.lua @@ -0,0 +1,52 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'haskell-language-server-wrapper', '--lsp' }, + filetypes = { 'haskell', 'lhaskell' }, + root_dir = util.root_pattern('hie.yaml', 'stack.yaml', 'cabal.project', '*.cabal', 'package.yaml'), + single_file_support = true, + settings = { + haskell = { + formattingProvider = 'ormolu', + cabalFormattingProvider = 'cabalfmt', + }, + }, + lspinfo = function(cfg) + local extra = {} + local function on_stdout(_, data, _) + local version = data[1] + table.insert(extra, 'version: ' .. version) + end + + local opts = { + cwd = cfg.cwd, + stdout_buffered = true, + on_stdout = on_stdout, + } + local chanid = vim.fn.jobstart({ cfg.cmd[1], '--version' }, opts) + vim.fn.jobwait { chanid } + return extra + end, + }, + + docs = { + description = [[ +https://github.com/haskell/haskell-language-server + +Haskell Language Server + +If you are using HLS 1.9.0.0, enable the language server to launch on Cabal files as well: + +```lua +require('lspconfig')['hls'].setup{ + filetypes = { 'haskell', 'lhaskell', 'cabal' }, +} +``` + ]], + + default_config = { + root_dir = [[root_pattern("hie.yaml", "stack.yaml", "cabal.project", "*.cabal", "package.yaml")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hoon_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hoon_ls.lua new file mode 100644 index 0000000..1a9240b --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hoon_ls.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'hoon-language-server' }, + filetypes = { 'hoon' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/urbit/hoon-language-server + +A language server for Hoon. + +The language server can be installed via `npm install -g @hoon-language-server` + +Start a fake ~zod with `urbit -F zod`. +Start the language server at the Urbit Dojo prompt with: `|start %language-server` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/html.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/html.lua new file mode 100644 index 0000000..2370734 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/html.lua @@ -0,0 +1,41 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'vscode-html-language-server', '--stdio' }, + filetypes = { 'html', 'templ' }, + root_dir = util.root_pattern('package.json', '.git'), + single_file_support = true, + settings = {}, + init_options = { + provideFormatter = true, + embeddedLanguages = { css = true, javascript = true }, + configurationSection = { 'html', 'css', 'javascript' }, + }, + }, + docs = { + description = [[ +https://github.com/hrsh7th/vscode-langservers-extracted + +`vscode-html-language-server` can be installed via `npm`: +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-html-language-server` only provides completions when snippet support is enabled. +To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +The code-formatting feature of the lsp can be controlled with the `provideFormatter` option. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.html.setup { + capabilities = capabilities, +} +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/htmx.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/htmx.lua new file mode 100644 index 0000000..26611b7 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/htmx.lua @@ -0,0 +1,24 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'htmx-lsp' }, + filetypes = { 'html', 'templ' }, + single_file_support = true, + root_dir = function(fname) + return util.find_git_ancestor(fname) + end, + }, + docs = { + description = [[ +https://github.com/ThePrimeagen/htmx-lsp + +`htmx-lsp` can be installed via `cargo`: +```sh +cargo install htmx-lsp +``` + +Lsp is still very much work in progress and experimental. Use at your own risk. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hydra_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hydra_lsp.lua new file mode 100644 index 0000000..e162ebe --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hydra_lsp.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'hydra-lsp' }, + filetypes = { 'yaml' }, + root_dir = util.root_pattern '.git', + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/Retsediv/hydra-lsp + +LSP for Hydra Python package config files. +]], + default_config = { + root_dir = [[util.root_pattern '.git']], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hyprls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hyprls.lua new file mode 100644 index 0000000..1a29023 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/hyprls.lua @@ -0,0 +1,24 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'hyprls', '--stdio' }, + filetypes = { '*.hl', 'hypr*.conf', '.config/hypr/*.conf' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/hyprland-community/hyprls + +`hyprls` can be installed via `go`: +```sh +go install github.com/ewen-lbh/hyprls/cmd/hyprls@latest +``` + +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/idris2_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/idris2_lsp.lua new file mode 100644 index 0000000..acb906e --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/idris2_lsp.lua @@ -0,0 +1,41 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'idris2-lsp' }, + filetypes = { 'idris2' }, + root_dir = util.root_pattern '*.ipkg', + }, + docs = { + description = [[ +https://github.com/idris-community/idris2-lsp + +The Idris 2 language server. + +Plugins for the Idris 2 filetype include +[Idris2-Vim](https://github.com/edwinb/idris2-vim) (fewer features, stable) and +[Nvim-Idris2](https://github.com/ShinKage/nvim-idris2) (cutting-edge, +experimental). + +Idris2-Lsp requires a build of Idris 2 that includes the "Idris 2 API" package. +Package managers with known support for this build include the +[AUR](https://aur.archlinux.org/packages/idris2/) and +[Homebrew](https://formulae.brew.sh/formula/idris2#default). + +If your package manager does not support the Idris 2 API, you will need to build +Idris 2 from source. Refer to the +[the Idris 2 installation instructions](https://github.com/idris-lang/Idris2/blob/main/INSTALL.md) +for details. Steps 5 and 8 are listed as "optional" in that guide, but they are +necessary in order to make the Idris 2 API available. + +You need to install a version of Idris2-Lsp that is compatible with your +version of Idris 2. There should be a branch corresponding to every released +Idris 2 version after v0.4.0. Use the latest commit on that branch. For example, +if you have Idris v0.5.1, you should use the v0.5.1 branch of Idris2-Lsp. + +If your Idris 2 version is newer than the newest Idris2-Lsp branch, use the +latest commit on the `master` branch, and set a reminder to check the Idris2-Lsp +repo for the release of a compatible versioned branch. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/intelephense.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/intelephense.lua new file mode 100644 index 0000000..2b9ad0f --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/intelephense.lua @@ -0,0 +1,43 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'intelephense', '--stdio' }, + filetypes = { 'php' }, + root_dir = function(pattern) + local cwd = vim.loop.cwd() + local root = util.root_pattern('composer.json', '.git')(pattern) + + -- prefer cwd if root is a descendant + return util.path.is_descendant(cwd, root) and cwd or root + end, + }, + docs = { + description = [[ +https://intelephense.com/ + +`intelephense` can be installed via `npm`: +```sh +npm install -g intelephense +``` +]], + default_config = { + root_dir = [[root_pattern("composer.json", ".git")]], + init_options = [[{ + storagePath = Optional absolute path to storage dir. Defaults to os.tmpdir(). + globalStoragePath = Optional absolute path to a global storage dir. Defaults to os.homedir(). + licenceKey = Optional licence key or absolute path to a text file containing the licence key. + clearCache = Optional flag to clear server state. State can also be cleared by deleting {storagePath}/intelephense + -- See https://github.com/bmewburn/intelephense-docs/blob/master/installation.md#initialisation-options + }]], + settings = [[{ + intelephense = { + files = { + maxSize = 1000000; + }; + }; + -- See https://github.com/bmewburn/intelephense-docs + }]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/java_language_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/java_language_server.lua new file mode 100644 index 0000000..3ddf4b1 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/java_language_server.lua @@ -0,0 +1,18 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'java' }, + root_dir = util.root_pattern('build.gradle', 'pom.xml', '.git'), + settings = {}, + }, + docs = { + description = [[ +https://github.com/georgewfraser/java-language-server + +Java language server + +Point `cmd` to `lang_server_linux.sh` or the equivalent script for macOS/Windows provided by java-language-server +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/jdtls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/jdtls.lua new file mode 100644 index 0000000..62bf2a5 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/jdtls.lua @@ -0,0 +1,173 @@ +local util = require 'lspconfig.util' +local handlers = require 'vim.lsp.handlers' + +local env = { + HOME = vim.loop.os_homedir(), + XDG_CACHE_HOME = os.getenv 'XDG_CACHE_HOME', + JDTLS_JVM_ARGS = os.getenv 'JDTLS_JVM_ARGS', +} + +local function get_cache_dir() + return env.XDG_CACHE_HOME and env.XDG_CACHE_HOME or util.path.join(env.HOME, '.cache') +end + +local function get_jdtls_cache_dir() + return util.path.join(get_cache_dir(), 'jdtls') +end + +local function get_jdtls_config_dir() + return util.path.join(get_jdtls_cache_dir(), 'config') +end + +local function get_jdtls_workspace_dir() + return util.path.join(get_jdtls_cache_dir(), 'workspace') +end + +local function get_jdtls_jvm_args() + local args = {} + for a in string.gmatch((env.JDTLS_JVM_ARGS or ''), '%S+') do + local arg = string.format('--jvm-arg=%s', a) + table.insert(args, arg) + end + return unpack(args) +end + +-- TextDocument version is reported as 0, override with nil so that +-- the client doesn't think the document is newer and refuses to update +-- See: https://github.com/eclipse/eclipse.jdt.ls/issues/1695 +local function fix_zero_version(workspace_edit) + if workspace_edit and workspace_edit.documentChanges then + for _, change in pairs(workspace_edit.documentChanges) do + local text_document = change.textDocument + if text_document and text_document.version and text_document.version == 0 then + text_document.version = nil + end + end + end + return workspace_edit +end + +local function on_textdocument_codeaction(err, actions, ctx) + for _, action in ipairs(actions) do + -- TODO: (steelsojka) Handle more than one edit? + if action.command == 'java.apply.workspaceEdit' then -- 'action' is Command in java format + action.edit = fix_zero_version(action.edit or action.arguments[1]) + elseif type(action.command) == 'table' and action.command.command == 'java.apply.workspaceEdit' then -- 'action' is CodeAction in java format + action.edit = fix_zero_version(action.edit or action.command.arguments[1]) + end + end + + handlers[ctx.method](err, actions, ctx) +end + +local function on_textdocument_rename(err, workspace_edit, ctx) + handlers[ctx.method](err, fix_zero_version(workspace_edit), ctx) +end + +local function on_workspace_applyedit(err, workspace_edit, ctx) + handlers[ctx.method](err, fix_zero_version(workspace_edit), ctx) +end + +-- Non-standard notification that can be used to display progress +local function on_language_status(_, result) + local command = vim.api.nvim_command + command 'echohl ModeMsg' + command(string.format('echo "%s"', result.message)) + command 'echohl None' +end + +local root_files = { + -- Multi-module projects + { '.git', 'build.gradle', 'build.gradle.kts' }, + -- Single-module projects + { + 'build.xml', -- Ant + 'pom.xml', -- Maven + 'settings.gradle', -- Gradle + 'settings.gradle.kts', -- Gradle + }, +} + +return { + default_config = { + cmd = { + 'jdtls', + '-configuration', + get_jdtls_config_dir(), + '-data', + get_jdtls_workspace_dir(), + get_jdtls_jvm_args(), + }, + filetypes = { 'java' }, + root_dir = function(fname) + for _, patterns in ipairs(root_files) do + local root = util.root_pattern(unpack(patterns))(fname) + if root then + return root + end + end + end, + single_file_support = true, + init_options = { + workspace = get_jdtls_workspace_dir(), + jvm_args = {}, + os_config = nil, + }, + handlers = { + -- Due to an invalid protocol implementation in the jdtls we have to conform these to be spec compliant. + -- https://github.com/eclipse/eclipse.jdt.ls/issues/376 + ['textDocument/codeAction'] = on_textdocument_codeaction, + ['textDocument/rename'] = on_textdocument_rename, + ['workspace/applyEdit'] = on_workspace_applyedit, + ['language/status'] = vim.schedule_wrap(on_language_status), + }, + }, + docs = { + description = [[ +https://projects.eclipse.org/projects/eclipse.jdt.ls + +Language server for Java. + +IMPORTANT: If you want all the features jdtls has to offer, [nvim-jdtls](https://github.com/mfussenegger/nvim-jdtls) +is highly recommended. If all you need is diagnostics, completion, imports, gotos and formatting and some code actions +you can keep reading here. + +For manual installation you can download precompiled binaries from the +[official downloads site](http://download.eclipse.org/jdtls/snapshots/?d) +and ensure that the `PATH` variable contains the `bin` directory of the extracted archive. + +```lua + -- init.lua + require'lspconfig'.jdtls.setup{} +``` + +You can also pass extra custom jvm arguments with the JDTLS_JVM_ARGS environment variable as a space separated list of arguments, +that will be converted to multiple --jvm-arg=<param> args when passed to the jdtls script. This will allow for example tweaking +the jvm arguments or integration with external tools like lombok: + +```sh +export JDTLS_JVM_ARGS="-javaagent:$HOME/.local/share/java/lombok.jar" +``` + +For automatic installation you can use the following unofficial installers/launchers under your own risk: + - [jdtls-launcher](https://github.com/eruizc-dev/jdtls-launcher) (Includes lombok support by default) + ```lua + -- init.lua + require'lspconfig'.jdtls.setup{ cmd = { 'jdtls' } } + ``` + ]], + default_config = { + root_dir = [[{ + -- Single-module projects + { + 'build.xml', -- Ant + 'pom.xml', -- Maven + 'settings.gradle', -- Gradle + 'settings.gradle.kts', -- Gradle + }, + -- Multi-module projects + { 'build.gradle', 'build.gradle.kts' }, + } or vim.fn.getcwd()]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/jedi_language_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/jedi_language_server.lua new file mode 100644 index 0000000..c95c960 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/jedi_language_server.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'pyproject.toml', + 'setup.py', + 'setup.cfg', + 'requirements.txt', + 'Pipfile', + '.git', +} + +return { + default_config = { + cmd = { 'jedi-language-server' }, + filetypes = { 'python' }, + root_dir = util.root_pattern(unpack(root_files)), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/pappasam/jedi-language-server + +`jedi-language-server`, a language server for Python, built on top of jedi + ]], + default_config = { + root_dir = "vim's starting directory", + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/jinja_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/jinja_lsp.lua new file mode 100644 index 0000000..e372ee9 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/jinja_lsp.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + name = 'jinja_lsp', + cmd = { 'jinja-lsp' }, + filetypes = { 'jinja' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +jinja-lsp enhances minijinja development experience by providing Helix/Nvim users with advanced features such as autocomplete, syntax highlighting, hover, goto definition, code actions and linting. + +The file types are not detected automatically, you can register them manually (see below) or override the filetypes: + +```lua +vim.filetype.add { + extension = { + jinja = 'jinja', + jinja2 = 'jinja', + j2 = 'jinja', + }, +} +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/jqls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/jqls.lua new file mode 100644 index 0000000..740138e --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/jqls.lua @@ -0,0 +1,30 @@ +local util = require 'lspconfig.util' +return { + default_config = { + cmd = { 'jq-lsp' }, + filetypes = { 'jq' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/wader/jq-lsp +Language server for jq, written using Go. +You can install the server easily using go install: +```sh +# install directly +go install github.com/wader/jq-lsp@master +# copy binary to $PATH +cp $(go env GOPATH)/bin/jq-lsp /usr/local/bin +``` +Note: To activate properly nvim needs to know the jq filetype. +You can add it via: +```lua +vim.cmd(\[\[au BufRead,BufNewFile *.jq setfiletype jq\]\]) +``` +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/jsonls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/jsonls.lua new file mode 100644 index 0000000..b629959 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/jsonls.lua @@ -0,0 +1,41 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'vscode-json-language-server', '--stdio' }, + filetypes = { 'json', 'jsonc' }, + init_options = { + provideFormatter = true, + }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + -- this language server config is in VSCode built-in package.json + description = [[ +https://github.com/hrsh7th/vscode-langservers-extracted + +vscode-json-language-server, a language server for JSON and JSON schema + +`vscode-json-language-server` can be installed via `npm`: +```sh +npm i -g vscode-langservers-extracted +``` + +Neovim does not currently include built-in snippets. `vscode-json-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. + +```lua +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.jsonls.setup { + capabilities = capabilities, +} +``` +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/jsonnet_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/jsonnet_ls.lua new file mode 100644 index 0000000..e2e7bff --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/jsonnet_ls.lua @@ -0,0 +1,44 @@ +local util = require 'lspconfig.util' + +-- common jsonnet library paths +local function jsonnet_path(root_dir) + local paths = { + util.path.join(root_dir, 'lib'), + util.path.join(root_dir, 'vendor'), + } + return table.concat(paths, ':') +end + +return { + default_config = { + cmd = { 'jsonnet-language-server' }, + filetypes = { 'jsonnet', 'libsonnet' }, + single_file_support = true, + root_dir = function(fname) + return util.root_pattern 'jsonnetfile.json'(fname) or util.find_git_ancestor(fname) + end, + on_new_config = function(new_config, root_dir) + if not new_config.cmd_env then + new_config.cmd_env = {} + end + if not new_config.cmd_env.JSONNET_PATH then + new_config.cmd_env.JSONNET_PATH = jsonnet_path(root_dir) + end + end, + }, + docs = { + description = [[ +https://github.com/grafana/jsonnet-language-server + +A Language Server Protocol (LSP) server for Jsonnet. + +The language server can be installed with `go`: +```sh +go install github.com/grafana/jsonnet-language-server@latest +``` +]], + default_config = { + root_dir = [[root_pattern("jsonnetfile.json")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/julials.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/julials.lua new file mode 100644 index 0000000..44360c7 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/julials.lua @@ -0,0 +1,75 @@ +local util = require 'lspconfig.util' + +local cmd = { + 'julia', + '--startup-file=no', + '--history-file=no', + '-e', + [[ + # Load LanguageServer.jl: attempt to load from ~/.julia/environments/nvim-lspconfig + # with the regular load path as a fallback + ls_install_path = joinpath( + get(DEPOT_PATH, 1, joinpath(homedir(), ".julia")), + "environments", "nvim-lspconfig" + ) + pushfirst!(LOAD_PATH, ls_install_path) + using LanguageServer + popfirst!(LOAD_PATH) + depot_path = get(ENV, "JULIA_DEPOT_PATH", "") + project_path = let + dirname(something( + ## 1. Finds an explicitly set project (JULIA_PROJECT) + Base.load_path_expand(( + p = get(ENV, "JULIA_PROJECT", nothing); + p === nothing ? nothing : isempty(p) ? nothing : p + )), + ## 2. Look for a Project.toml file in the current working directory, + ## or parent directories, with $HOME as an upper boundary + Base.current_project(), + ## 3. First entry in the load path + get(Base.load_path(), 1, nothing), + ## 4. Fallback to default global environment, + ## this is more or less unreachable + Base.load_path_expand("@v#.#"), + )) + end + @info "Running language server" VERSION pwd() project_path depot_path + server = LanguageServer.LanguageServerInstance(stdin, stdout, project_path, depot_path) + server.runlinter = true + run(server) + ]], +} + +return { + default_config = { + cmd = cmd, + filetypes = { 'julia' }, + root_dir = function(fname) + return util.root_pattern 'Project.toml'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/julia-vscode/julia-vscode + +LanguageServer.jl can be installed with `julia` and `Pkg`: +```sh +julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.add("LanguageServer")' +``` +where `~/.julia/environments/nvim-lspconfig` is the location where +the default configuration expects LanguageServer.jl to be installed. + +To update an existing install, use the following command: +```sh +julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.update()' +``` + +Note: In order to have LanguageServer.jl pick up installed packages or dependencies in a +Julia project, you must make sure that the project is instantiated: +```sh +julia --project=/path/to/my/project -e 'using Pkg; Pkg.instantiate()' +``` + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/koka.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/koka.lua new file mode 100644 index 0000000..63f3838 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/koka.lua @@ -0,0 +1,36 @@ +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, + single_file_support = true, + capabilities = default_capabilities, + }, + 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]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/kotlin_language_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/kotlin_language_server.lua new file mode 100644 index 0000000..a151403 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/kotlin_language_server.lua @@ -0,0 +1,57 @@ +local util = require 'lspconfig.util' + +local bin_name = 'kotlin-language-server' +if vim.fn.has 'win32' == 1 then + bin_name = bin_name .. '.bat' +end + +--- The presence of one of these files indicates a project root directory +-- +-- These are configuration files for the various build systems supported by +-- Kotlin. I am not sure whether the language server supports Ant projects, +-- but I'm keeping it here as well since Ant does support Kotlin. +local root_files = { + 'settings.gradle', -- Gradle (multi-project) + 'settings.gradle.kts', -- Gradle (multi-project) + 'build.xml', -- Ant + 'pom.xml', -- Maven + 'build.gradle', -- Gradle + 'build.gradle.kts', -- Gradle +} + +return { + default_config = { + filetypes = { 'kotlin' }, + root_dir = util.root_pattern(unpack(root_files)), + cmd = { bin_name }, + init_options = { + storagePath = util.root_pattern(unpack(root_files))(vim.fn.expand '%:p:h'), + }, + }, + docs = { + description = [[ + A kotlin language server which was developed for internal usage and + released afterwards. Maintaining is not done by the original author, + but by fwcd. + + It is built via gradle and developed on github. + Source and additional description: + https://github.com/fwcd/kotlin-language-server + + This server requires vim to be aware of the kotlin-filetype. + You could refer for this capability to: + https://github.com/udalov/kotlin-vim (recommended) + Note that there is no LICENSE specified yet. + + For faster startup, you can setup caching by specifying a storagePath + in the init_options. The default is your home directory. + ]], + default_config = { + root_dir = [[See source]], + cmd = { 'kotlin-language-server' }, + init_options = { + storagePath = [[Enables caching and use project root to store cache data. See source]], + }, + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/lean3ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/lean3ls.lua new file mode 100644 index 0000000..ebcec10 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/lean3ls.lua @@ -0,0 +1,46 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'lean-language-server', '--stdio', '--', '-M', '4096', '-T', '100000' }, + filetypes = { 'lean3' }, + offset_encoding = 'utf-32', + root_dir = function(fname) + fname = util.path.sanitize(fname) + -- check if inside elan stdlib + local stdlib_dir + do + local _, endpos = fname:find '/lean/library' + if endpos then + stdlib_dir = fname:sub(1, endpos) + end + end + + return util.root_pattern 'leanpkg.toml'(fname) + or util.root_pattern 'leanpkg.path'(fname) + or stdlib_dir + or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/leanprover/lean-client-js/tree/master/lean-language-server + +Lean installation instructions can be found +[here](https://leanprover-community.github.io/get_started.html#regular-install). + +Once Lean is installed, you can install the Lean 3 language server by running +```sh +npm install -g lean-language-server +``` + +Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim), +that plugin fully handles the setup of the Lean language server, +and you shouldn't set up `lean3ls` both with it and `lspconfig`. + ]], + default_config = { + root_dir = [[root_pattern("leanpkg.toml") or root_pattern(".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/leanls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/leanls.lua new file mode 100644 index 0000000..208598a --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/leanls.lua @@ -0,0 +1,77 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'lake', 'serve', '--' }, + filetypes = { 'lean' }, + root_dir = function(fname) + -- check if inside elan stdlib + fname = util.path.sanitize(fname) + local stdlib_dir + do + local _, endpos = fname:find '/src/lean' + if endpos then + stdlib_dir = fname:sub(1, endpos) + end + end + if not stdlib_dir then + local _, endpos = fname:find '/lib/lean' + if endpos then + stdlib_dir = fname:sub(1, endpos) + end + end + + return util.root_pattern('lakefile.lean', 'lean-toolchain', 'leanpkg.toml')(fname) + or stdlib_dir + or util.find_git_ancestor(fname) + end, + options = { + -- Only Lake 3.0+ supports lake serve, so for old enough Lean 4, + -- or core Lean itself, this command (typically using the in-built + -- Lean 4 language server) will be used instead. + no_lake_lsp_cmd = { 'lean', '--server' }, + }, + on_new_config = function(config, root_dir) + local use_lake_serve = false + if util.path.exists(util.path.join(root_dir, 'lakefile.lean')) then + local lake_version = '' + local lake_job = vim.fn.jobstart({ 'lake', '--version' }, { + on_stdout = function(_, d, _) + lake_version = table.concat(d, '\n') + end, + stdout_buffered = true, + }) + if lake_job > 0 and vim.fn.jobwait({ lake_job })[1] == 0 then + local major = lake_version:match 'Lake version (%d).' + if major and tonumber(major) >= 3 then + use_lake_serve = true + end + end + end + if not use_lake_serve then + config.cmd = config.options.no_lake_lsp_cmd + end + -- add root dir as command-line argument for `ps aux` + table.insert(config.cmd, root_dir) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/leanprover/lean4 + +Lean installation instructions can be found +[here](https://leanprover-community.github.io/get_started.html#regular-install). + +The Lean 4 language server is built-in with a Lean 4 install +(and can be manually run with, e.g., `lean --server`). + +Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim), +that plugin fully handles the setup of the Lean language server, +and you shouldn't set up `leanls` both with it and `lspconfig`. + ]], + default_config = { + root_dir = [[root_pattern("lakefile.lean", "lean-toolchain", "leanpkg.toml", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/lelwel_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/lelwel_ls.lua new file mode 100644 index 0000000..ac8c456 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/lelwel_ls.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'lelwel-ls' }, + filetypes = { 'llw' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/0x2a-42/lelwel + +Language server for lelwel grammars. + +You can install `lelwel-ls` via cargo: +```sh +cargo install --features="lsp" lelwel +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/lemminx.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/lemminx.lua new file mode 100644 index 0000000..eb1ccaa --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/lemminx.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'lemminx' }, + filetypes = { 'xml', 'xsd', 'xsl', 'xslt', 'svg' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/eclipse/lemminx + +The easiest way to install the server is to get a binary from https://github.com/redhat-developer/vscode-xml/releases and place it on your PATH. + +NOTE to macOS users: Binaries from unidentified developers are blocked by default. If you trust the downloaded binary, run it once, cancel the prompt, then remove the binary from Gatekeeper quarantine with `xattr -d com.apple.quarantine lemminx`. It should now run without being blocked. + +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/lexical.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/lexical.lua new file mode 100644 index 0000000..d8235d5 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/lexical.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'elixir', 'eelixir', 'heex', 'surface' }, + root_dir = function(fname) + return util.root_pattern 'mix.exs'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ + https://github.com/lexical-lsp/lexical + + Lexical is a next-generation language server for the Elixir programming language. + + Follow the [Detailed Installation Instructions](https://github.com/lexical-lsp/lexical/blob/main/pages/installation.md) + + **By default, `lexical` doesn't have a `cmd` set.** + This is because nvim-lspconfig does not make assumptions about your path. + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ltex.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ltex.lua new file mode 100644 index 0000000..6afc30a --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ltex.lua @@ -0,0 +1,95 @@ +local util = require 'lspconfig.util' + +local language_id_mapping = { + bib = 'bibtex', + plaintex = 'tex', + rnoweb = 'rsweave', + rst = 'restructuredtext', + tex = 'latex', + pandoc = 'markdown', + text = 'plaintext', +} + +local bin_name = 'ltex-ls' +if vim.fn.has 'win32' == 1 then + bin_name = bin_name .. '.bat' +end + +local filetypes = { + 'bib', + 'gitcommit', + 'markdown', + 'org', + 'plaintex', + 'rst', + 'rnoweb', + 'tex', + 'pandoc', + 'quarto', + 'rmd', + 'context', + 'html', + 'xhtml', + 'mail', + 'text', +} + +local function get_language_id(_, filetype) + local language_id = language_id_mapping[filetype] + if language_id then + return language_id + else + return filetype + end +end +local enabled_ids = {} +do + local enabled_keys = {} + for _, ft in ipairs(filetypes) do + local id = get_language_id({}, ft) + if not enabled_keys[id] then + enabled_keys[id] = true + table.insert(enabled_ids, id) + end + end +end + +return { + default_config = { + cmd = { bin_name }, + filetypes = filetypes, + root_dir = util.find_git_ancestor, + single_file_support = true, + get_language_id = get_language_id, + settings = { + ltex = { + enabled = enabled_ids, + }, + }, + }, + docs = { + description = [=[ +https://github.com/valentjn/ltex-ls + +LTeX Language Server: LSP language server for LanguageTool 🔍✔️ with support for LaTeX 🎓, Markdown 📝, and others + +To install, download the latest [release](https://github.com/valentjn/ltex-ls/releases) and ensure `ltex-ls` is on your path. + +This server accepts configuration via the `settings` key. + +```lua + settings = { + ltex = { + language = "en-GB", + }, + }, +``` + +To support org files or R sweave, users can define a custom filetype autocommand (or use a plugin which defines these filetypes): + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.org set filetype=org ]] +``` +]=], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/lua_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/lua_ls.lua new file mode 100644 index 0000000..3bb9fd6 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/lua_ls.lua @@ -0,0 +1,88 @@ +local util = require 'lspconfig.util' + +local root_files = { + '.luarc.json', + '.luarc.jsonc', + '.luacheckrc', + '.stylua.toml', + 'stylua.toml', + 'selene.toml', + 'selene.yml', +} + +return { + default_config = { + cmd = { 'lua-language-server' }, + filetypes = { 'lua' }, + root_dir = function(fname) + local root = util.root_pattern(unpack(root_files))(fname) + if root and root ~= vim.env.HOME then + return root + end + root = util.root_pattern 'lua/'(fname) + if root then + return root + end + return util.find_git_ancestor(fname) + end, + single_file_support = true, + log_level = vim.lsp.protocol.MessageType.Warning, + }, + docs = { + description = [[ +https://github.com/luals/lua-language-server + +Lua language server. + +`lua-language-server` can be installed by following the instructions [here](https://luals.github.io/#neovim-install). + +The default `cmd` assumes that the `lua-language-server` binary can be found in `$PATH`. + +If you primarily use `lua-language-server` for Neovim, and want to provide completions, +analysis, and location handling for plugins on runtime path, you can use the following +settings. + +```lua +require'lspconfig'.lua_ls.setup { + on_init = function(client) + local path = client.workspace_folders[1].name + if vim.loop.fs_stat(path..'/.luarc.json') or vim.loop.fs_stat(path..'/.luarc.jsonc') then + return + end + + client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { + runtime = { + -- Tell the language server which version of Lua you're using + -- (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT' + }, + -- Make the server aware of Neovim runtime files + workspace = { + checkThirdParty = false, + library = { + vim.env.VIMRUNTIME + -- Depending on the usage, you might want to add additional paths here. + -- "${3rd}/luv/library" + -- "${3rd}/busted/library", + } + -- or pull in all of 'runtimepath'. NOTE: this is a lot slower + -- library = vim.api.nvim_get_runtime_file("", true) + } + }) + end, + settings = { + Lua = {} + } +} +``` + +See `lua-language-server`'s [documentation](https://luals.github.io/wiki/settings/) for an explanation of the above fields: +* [Lua.runtime.path](https://luals.github.io/wiki/settings/#runtimepath) +* [Lua.workspace.library](https://luals.github.io/wiki/settings/#workspacelibrary) + +]], + default_config = { + root_dir = [[root_pattern(".luarc.json", ".luarc.jsonc", ".luacheckrc", ".stylua.toml", "stylua.toml", "selene.toml", "selene.yml", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/luau_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/luau_lsp.lua new file mode 100644 index 0000000..c916114 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/luau_lsp.lua @@ -0,0 +1,27 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'luau-lsp', 'lsp' }, + filetypes = { 'luau' }, + root_dir = util.find_git_ancestor, + }, + docs = { + [[ +https://github.com/JohnnyMorganz/luau-lsp + +Language server for the [Luau](https://luau-lang.org/) language. + +`luau-lsp` can be installed by downloading one of the release assets available at https://github.com/JohnnyMorganz/luau-lsp. + +You might also have to set up automatic filetype detection for Luau files, for example like so: + +```vim +autocmd BufRead,BufNewFile *.luau setf luau +``` +]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/lwc_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/lwc_ls.lua new file mode 100644 index 0000000..ac8841a --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/lwc_ls.lua @@ -0,0 +1,37 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'lwc-language-server', '--stdio' }, + filetypes = { 'javascript', 'html' }, + root_dir = util.root_pattern 'sfdx-project.json', + init_options = { + embeddedLanguages = { + javascript = true, + }, + }, + }, + docs = { + description = [[ +https://github.com/forcedotcom/lightning-language-server/ + +Language server for Lightning Web Components. + +For manual installation, utilize the official [NPM package](https://www.npmjs.com/package/@salesforce/lwc-language-server). +Then, configure `cmd` to run the Node script at the unpacked location: + +```lua +require'lspconfig'.lwc_ls.setup { + cmd = { + 'node', + '/path/to/node_modules/@salesforce/lwc-language-server/bin/lwc-language-server.js', + '--stdio' + } +} +``` +]], + default_config = { + root_dir = [[root_pattern('sfdx-project.json')]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/m68k.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/m68k.lua new file mode 100644 index 0000000..053d442 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/m68k.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'm68k-lsp-server', '--stdio' }, + filetypes = { 'asm68k' }, + root_dir = util.root_pattern('Makefile', '.git'), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/grahambates/m68k-lsp + +Language server for Motorola 68000 family assembly + +`m68k-lsp-server` can be installed via `npm`: + +```sh +npm install -g m68k-lsp-server +``` + +Ensure you are using the 68k asm syntax variant in Neovim. + +```lua +vim.g.asmsyntax = 'asm68k' +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/markdown_oxide.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/markdown_oxide.lua new file mode 100644 index 0000000..13882dc --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/markdown_oxide.lua @@ -0,0 +1,42 @@ +return { + default_config = { + root_dir = function(fname, _) + return require('lspconfig').util.root_pattern('.git', '.obsidian', '.moxide.toml')(fname) + end, + filetypes = { 'markdown' }, + single_file_support = true, + cmd = { 'markdown-oxide' }, + }, + docs = { + description = [[ +https://github.com/Feel-ix-343/markdown-oxide + +Editor Agnostic PKM: you bring the text editor and we +bring the PKM. + +Inspired by and compatible with Obsidian. + +Check the readme to see how to properly setup. + ]], + }, + commands = { + Today = { + function() + vim.lsp.buf.execute_command { command = 'jump', arguments = { 'today' } } + end, + description = "Open today's daily note", + }, + Tomorrow = { + function() + vim.lsp.buf.execute_command { command = 'jump', arguments = { 'tomorrow' } } + end, + description = "Open tomorrow's daily note", + }, + Yesterday = { + function() + vim.lsp.buf.execute_command { command = 'jump', arguments = { 'yesterday' } } + end, + description = "Open yesterday's daily note", + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/marksman.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/marksman.lua new file mode 100644 index 0000000..2dd01a2 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/marksman.lua @@ -0,0 +1,30 @@ +local util = require 'lspconfig.util' + +local bin_name = 'marksman' +local cmd = { bin_name, 'server' } + +return { + default_config = { + cmd = cmd, + filetypes = { 'markdown', 'markdown.mdx' }, + root_dir = function(fname) + local root_files = { '.marksman.toml' } + return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/artempyanykh/marksman + +Marksman is a Markdown LSP server providing completion, cross-references, diagnostics, and more. + +Marksman works on MacOS, Linux, and Windows and is distributed as a self-contained binary for each OS. + +Pre-built binaries can be downloaded from https://github.com/artempyanykh/marksman/releases +]], + default_config = { + root_dir = [[root_pattern(".git", ".marksman.toml")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/matlab_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/matlab_ls.lua new file mode 100644 index 0000000..cadc60b --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/matlab_ls.lua @@ -0,0 +1,25 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'matlab-language-server', '--stdio' }, + filetypes = { 'matlab' }, + root_dir = util.find_git_ancestor, + single_file_support = false, + settings = { + MATLAB = { + indexWorkspace = false, + installPath = '', + matlabConnectionTiming = 'onStart', + telemetry = true, + }, + }, + }, + docs = { + description = [[ +https://github.com/mathworks/MATLAB-language-server + +MATLAB® language server implements the Microsoft® Language Server Protocol for the MATLAB language. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mdx_analyzer.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mdx_analyzer.lua new file mode 100644 index 0000000..1dfbcb5 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mdx_analyzer.lua @@ -0,0 +1,32 @@ +local util = require 'lspconfig.util' + +local function get_typescript_server_path(root_dir) + local project_root = util.find_node_modules_ancestor(root_dir) + return project_root and (util.path.join(project_root, 'node_modules', 'typescript', 'lib')) or '' +end + +return { + default_config = { + cmd = { 'mdx-language-server', '--stdio' }, + filetypes = { 'markdown.mdx' }, + root_dir = util.root_pattern 'package.json', + single_file_support = true, + settings = {}, + init_options = { + typescript = {}, + }, + on_new_config = function(new_config, new_root_dir) + if vim.tbl_get(new_config.init_options, 'typescript') and not new_config.init_options.typescript.tsdk then + new_config.init_options.typescript.tsdk = get_typescript_server_path(new_root_dir) + end + end, + }, + commands = {}, + docs = { + description = [[ +https://github.com/mdx-js/mdx-analyzer + +`mdx-analyzer`, a language server for MDX +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mesonlsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mesonlsp.lua new file mode 100644 index 0000000..29eaef9 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mesonlsp.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'mesonlsp', '--lsp' }, + filetypes = { 'meson' }, + root_dir = util.root_pattern('meson_options.txt', 'meson.options', '.git'), + }, + docs = { + description = [[ +https://github.com/JCWasmx86/mesonlsp + +An unofficial, unendorsed language server for meson written in C++ +]], + default_config = { + root_dir = [[util.root_pattern("meson_options.txt", "meson.options", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/metals.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/metals.lua new file mode 100644 index 0000000..1242f51 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/metals.lua @@ -0,0 +1,40 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'metals' }, + filetypes = { 'scala' }, + root_dir = util.root_pattern('build.sbt', 'build.sc', 'build.gradle', 'pom.xml'), + message_level = vim.lsp.protocol.MessageType.Log, + init_options = { + statusBarProvider = 'show-message', + isHttpEnabled = true, + compilerOptions = { + snippetAutoIndent = false, + }, + }, + capabilities = { + workspace = { + configuration = false, + }, + }, + }, + docs = { + description = [[ +https://scalameta.org/metals/ + +Scala language server with rich IDE features. + +See full instructions in the Metals documentation: + +https://scalameta.org/metals/docs/editors/vim#using-an-alternative-lsp-client + +Note: that if you're using [nvim-metals](https://github.com/scalameta/nvim-metals), that plugin fully handles the setup and installation of Metals, and you shouldn't set up Metals both with it and `lspconfig`. + +To install Metals, make sure to have [coursier](https://get-coursier.io/docs/cli-installation) installed, and once you do you can install the latest Metals with `cs install metals`. +]], + default_config = { + root_dir = [[util.root_pattern("build.sbt", "build.sc", "build.gradle", "pom.xml")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/millet.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/millet.lua new file mode 100644 index 0000000..e870054 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/millet.lua @@ -0,0 +1,24 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'millet' }, + filetypes = { 'sml' }, + root_dir = util.root_pattern 'millet.toml', + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/azdavis/millet + +Millet, a language server for Standard ML + +To use with nvim: + +1. Install a Rust toolchain: https://rustup.rs +2. Clone the repo +3. Run `cargo build --release --bin lang-srv` +4. Move `target/release/lang-srv` to somewhere on your $PATH as `millet` + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mint.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mint.lua new file mode 100644 index 0000000..7fde1c4 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mint.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'mint', 'ls' }, + filetypes = { 'mint' }, + root_dir = function(fname) + return util.root_pattern 'mint.json'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://www.mint-lang.com + +Install Mint using the [instructions](https://www.mint-lang.com/install). +The language server is included since version 0.12.0. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mlir_lsp_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mlir_lsp_server.lua new file mode 100644 index 0000000..22a7126 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mlir_lsp_server.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'mlir-lsp-server' }, + filetypes = { 'mlir' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://mlir.llvm.org/docs/Tools/MLIRLSP/#mlir-lsp-language-server--mlir-lsp-server= + +The Language Server for the LLVM MLIR language + +`mlir-lsp-server` can be installed at the llvm-project repository (https://github.com/llvm/llvm-project) +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mlir_pdll_lsp_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mlir_pdll_lsp_server.lua new file mode 100644 index 0000000..e24d634 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mlir_pdll_lsp_server.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'mlir-pdll-lsp-server' }, + filetypes = { 'pdll' }, + root_dir = function(fname) + return util.root_pattern 'pdll_compile_commands.yml'(fname) or util.find_git_ancestor(fname) + end, + }, + docs = { + description = [[ +https://mlir.llvm.org/docs/Tools/MLIRLSP/#pdll-lsp-language-server--mlir-pdll-lsp-server + +The Language Server for the LLVM PDLL language + +`mlir-pdll-lsp-server` can be installed at the llvm-project repository (https://github.com/llvm/llvm-project) +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mm0_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mm0_ls.lua new file mode 100644 index 0000000..513bbeb --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mm0_ls.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'mm0-rs', 'server' }, + root_dir = util.find_git_ancestor, + filetypes = { 'metamath-zero' }, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/digama0/mm0 + +Language Server for the metamath-zero theorem prover. + +Requires [mm0-rs](https://github.com/digama0/mm0/tree/master/mm0-rs) to be installed +and available on the `PATH`. + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mojo.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mojo.lua new file mode 100644 index 0000000..9092ba6 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mojo.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'mojo-lsp-server' }, + filetypes = { 'mojo' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/modularml/mojo + +`mojo-lsp-server` can be installed [via Modular](https://developer.modular.com/download) + +Mojo is a new programming language that bridges the gap between research and production by combining Python syntax and ecosystem with systems programming and metaprogramming features. +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/motoko_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/motoko_lsp.lua new file mode 100644 index 0000000..c0f6a35 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/motoko_lsp.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'motoko-lsp', '--stdio' }, + filetypes = { 'motoko' }, + root_dir = util.root_pattern('dfx.json', '.git'), + init_options = { + formatter = 'auto', + }, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/dfinity/vscode-motoko + +Language server for the Motoko programming language. + ]], + default_config = { + root_dir = [[root_pattern("dfx.json", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/move_analyzer.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/move_analyzer.lua new file mode 100644 index 0000000..ab97745 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/move_analyzer.lua @@ -0,0 +1,31 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'move-analyzer' }, + filetypes = { 'move' }, + root_dir = function(fname) + local move_package_dir = util.root_pattern 'Move.toml'(fname) + return move_package_dir + end, + }, + commands = {}, + docs = { + description = [[ +https://github.com/move-language/move/tree/main/language/move-analyzer + +Language server for Move + +The `move-analyzer` can be installed by running: + +``` +cargo install --git https://github.com/move-language/move move-analyzer +``` + +See [`move-analyzer`'s doc](https://github.com/move-language/move/blob/1b258a06e3c7d2bc9174578aac92cca3ac19de71/language/move-analyzer/editors/code/README.md#how-to-install) for details. + ]], + default_config = { + root_dir = [[root_pattern("Move.toml")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mutt_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mutt_ls.lua new file mode 100644 index 0000000..2026bf9 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/mutt_ls.lua @@ -0,0 +1,25 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'mutt-language-server' }, + filetypes = { 'muttrc', 'neomuttrc' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + settings = {}, + }, + docs = { + description = [[ +https://github.com/neomutt/mutt-language-server + +A language server for (neo)mutt's muttrc. It can be installed via pip. + +```sh +pip install mutt-language-server +``` + ]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nelua_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nelua_lsp.lua new file mode 100644 index 0000000..ab5faab --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nelua_lsp.lua @@ -0,0 +1,36 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'nelua' }, + root_dir = util.root_pattern('Makefile', '.git', '*.nelua'), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/codehz/nelua-lsp + +nelua-lsp is an experimental nelua language server. + +You need [nelua.vim](https://github.com/stefanos82/nelua.vim/blob/main/ftdetect/nelua.vim) for nelua files to be recognized or add this to your config: + +in vimscript: +```vimscript +au BufNewFile,BufRead *.nelua setf nelua +``` + +in lua: +```lua +vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, { pattern = { "*.nelua" }, command = "setf nelua"}) +``` + +**By default, nelua-lsp doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. + +```lua +require'lspconfig'.nelua_lsp.setup { + cmd = { "nelua", "-L", "/path/to/nelua-lsp/", "--script", "/path/to/nelua-lsp/nelua-lsp.lua" }, +} +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/neocmake.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/neocmake.lua new file mode 100644 index 0000000..3839bdb --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/neocmake.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +local root_files = { '.git', 'build', 'cmake' } +return { + default_config = { + cmd = { 'neocmakelsp', '--stdio' }, + filetypes = { 'cmake' }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/Decodetalkers/neocmakelsp + +CMake LSP Implementation +]], + default_config = { + root_dir = [[root_pattern('.git', 'cmake')]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nextls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nextls.lua new file mode 100644 index 0000000..acecaf7 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nextls.lua @@ -0,0 +1,18 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'elixir', 'eelixir', 'heex', 'surface' }, + root_dir = function(fname) + return util.root_pattern 'mix.exs'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/elixir-tools/next-ls + +**By default, next-ls does not set its `cmd`. Please see the following [detailed instructions](https://www.elixir-tools.dev/docs/next-ls/installation/) for possible installation methods.** +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nginx_language_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nginx_language_server.lua new file mode 100644 index 0000000..9dfc0b5 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nginx_language_server.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'nginx-language-server' }, + filetypes = { 'nginx' }, + root_dir = function(fname) + return util.root_pattern('nginx.conf', '.git')(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://pypi.org/project/nginx-language-server/ + +`nginx-language-server` can be installed via pip: + +```sh +pip install -U nginx-language-server +``` + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nickel_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nickel_ls.lua new file mode 100644 index 0000000..391abfe --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nickel_ls.lua @@ -0,0 +1,37 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'nls' }, + filetypes = { 'ncl', 'nickel' }, + root_dir = util.find_git_ancestor, + }, + + docs = { + description = [[ +Nickel Language Server + +https://github.com/tweag/nickel + +`nls` can be installed with nix, or cargo, from the Nickel repository. +```sh +git clone https://github.com/tweag/nickel.git +``` + +Nix: +```sh +cd nickel +nix-env -f . -i +``` + +cargo: +```sh +cd nickel/lsp/nls +cargo install --path . +``` + +In order to have lspconfig detect Nickel filetypes (a prerequisite for autostarting a server), +install the [Nickel vim plugin](https://github.com/nickel-lang/vim-nickel). + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nil_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nil_ls.lua new file mode 100644 index 0000000..49044c1 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nil_ls.lua @@ -0,0 +1,25 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'nil' }, + filetypes = { 'nix' }, + single_file_support = true, + root_dir = util.root_pattern('flake.nix', '.git'), + }, + docs = { + description = [[ +https://github.com/oxalica/nil + +A new language server for Nix Expression Language. + +If you are using Nix with Flakes support, run `nix profile install github:oxalica/nil` to install. +Check the repository README for more information. + +_See an example config at https://github.com/oxalica/nil/blob/main/dev/nvim-lsp.nix._ + ]], + default_config = { + root_dir = [[root_pattern("flake.nix", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nim_langserver.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nim_langserver.lua new file mode 100644 index 0000000..f3c4827 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nim_langserver.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'nimlangserver' }, + filetypes = { 'nim' }, + root_dir = function(fname) + return util.root_pattern '*.nimble'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/nim-lang/langserver + + +`nim-langserver` can be installed via the `nimble` package manager: +```sh +nimble install nimlangserver +``` + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nimls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nimls.lua new file mode 100644 index 0000000..3c1aeb2 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nimls.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'nimlsp' }, + filetypes = { 'nim' }, + root_dir = function(fname) + return util.root_pattern '*.nimble'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/PMunch/nimlsp + +`nimlsp` can be installed via the `nimble` package manager: + +```sh +nimble install nimlsp +``` + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nixd.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nixd.lua new file mode 100644 index 0000000..b6289db --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nixd.lua @@ -0,0 +1,25 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'nixd' }, + filetypes = { 'nix' }, + single_file_support = true, + root_dir = function(fname) + return util.root_pattern 'flake.nix'(fname) or util.find_git_ancestor(fname) + end, + }, + docs = { + description = [[ +https://github.com/nix-community/nixd + +Nix language server, based on nix libraries. + +If you are using Nix with Flakes support, run `nix profile install github:nix-community/nixd` to install. +Check the repository README for more information. + ]], + default_config = { + root_dir = [[root_pattern("flake.nix",".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nomad_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nomad_lsp.lua new file mode 100644 index 0000000..5ffa98a --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nomad_lsp.lua @@ -0,0 +1,36 @@ +local util = require 'lspconfig.util' +local bin_name = 'nomad-lsp' + +if vim.fn.has 'win32' == 1 then + bin_name = bin_name .. '.exe' +end + +return { + default_config = { + cmd = { bin_name }, + filetypes = { 'hcl.nomad', 'nomad' }, + root_dir = util.root_pattern '*.nomad', + }, + docs = { + description = [[ +https://github.com/juliosueiras/nomad-lsp + +Written in Go, compilation is needed for `nomad_lsp` to be used. Please see the [original repository](https://github.com/juliosuieras/nomad-lsp). + +Add the executable to your system or vim PATH and it will be set to go. + +No configuration option is needed unless you choose not to add `nomad-lsp` executable to the PATH. You should know what you are doing if you choose so. + +```lua +require('lspconfig').nomad_lsp.setup{ } +``` + +However, a `hcl.nomad` or `nomad` filetype should be defined. + +Description of your jobs should be written in `.nomad` files for the LSP client to configure the server's `root_dir` configuration option. +]], + default_config = { + root_dir = [[util.root_pattern("hcl.nomad", "nomad")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ntt.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ntt.lua new file mode 100644 index 0000000..0f68a89 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ntt.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' +local bin_name = 'ntt' + +return { + default_config = { + cmd = { bin_name, 'langserver' }, + filetypes = { 'ttcn' }, + root_dir = util.root_pattern '.git', + }, + docs = { + description = [[ +https://github.com/nokia/ntt +Installation instructions can be found [here](https://github.com/nokia/ntt#Install). +Can be configured by passing a "settings" object to `ntt.setup{}`: +```lua +require('lspconfig').ntt.setup{ + settings = { + ntt = { + } + } +} +``` +]], + default_config = { + root_dir = [[util.root_pattern(".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nushell.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nushell.lua new file mode 100644 index 0000000..13bd34e --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nushell.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'nu', '--lsp' }, + filetypes = { 'nu' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/nushell/nushell + +Nushell built-in language server. +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nxls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nxls.lua new file mode 100644 index 0000000..e3d3874 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/nxls.lua @@ -0,0 +1,24 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'nxls', '--stdio' }, + filetypes = { 'json', 'jsonc' }, + root_dir = util.root_pattern('nx.json', '.git'), + }, + docs = { + description = [[ +https://github.com/nrwl/nx-console/tree/master/apps/nxls + +nxls, a language server for Nx Workspaces + +`nxls` can be installed via `npm`: +```sh +npm i -g nxls +``` +]], + default_config = { + root_dir = [[util.root_pattern]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ocamlls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ocamlls.lua new file mode 100644 index 0000000..8526f3e --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ocamlls.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'ocaml-language-server', '--stdio' }, + filetypes = { 'ocaml', 'reason' }, + root_dir = util.root_pattern('*.opam', 'esy.json', 'package.json'), + }, + docs = { + description = [[ +https://github.com/ocaml-lsp/ocaml-language-server + +`ocaml-language-server` can be installed via `npm` +```sh +npm install -g ocaml-language-server +``` + ]], + default_config = { + root_dir = [[root_pattern("*.opam", "esy.json", "package.json")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ocamllsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ocamllsp.lua new file mode 100644 index 0000000..4f33c9a --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ocamllsp.lua @@ -0,0 +1,38 @@ +local util = require 'lspconfig.util' + +local language_id_of = { + menhir = 'ocaml.menhir', + ocaml = 'ocaml', + ocamlinterface = 'ocaml.interface', + ocamllex = 'ocaml.ocamllex', + reason = 'reason', + dune = 'dune', +} + +local get_language_id = function(_, ftype) + return language_id_of[ftype] +end + +return { + default_config = { + cmd = { 'ocamllsp' }, + filetypes = { 'ocaml', 'menhir', 'ocamlinterface', 'ocamllex', 'reason', 'dune' }, + root_dir = util.root_pattern('*.opam', 'esy.json', 'package.json', '.git', 'dune-project', 'dune-workspace'), + get_language_id = get_language_id, + }, + docs = { + description = [[ +https://github.com/ocaml/ocaml-lsp + +`ocaml-lsp` can be installed as described in [installation guide](https://github.com/ocaml/ocaml-lsp#installation). + +To install the lsp server in a particular opam switch: +```sh +opam install ocaml-lsp-server +``` + ]], + default_config = { + root_dir = [[root_pattern("*.opam", "esy.json", "package.json", ".git", "dune-project", "dune-workspace")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ols.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ols.lua new file mode 100644 index 0000000..6b890f6 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ols.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'ols' }, + filetypes = { 'odin' }, + root_dir = util.root_pattern('ols.json', '.git', '*.odin'), + }, + docs = { + description = [[ + https://github.com/DanielGavin/ols + + `Odin Language Server`. + ]], + default_config = { + root_dir = [[util.root_pattern("ols.json", ".git", "*.odin")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/omnisharp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/omnisharp.lua new file mode 100644 index 0000000..71af00a --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/omnisharp.lua @@ -0,0 +1,144 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + settings = { + FormattingOptions = { + -- Enables support for reading code style, naming convention and analyzer + -- settings from .editorconfig. + EnableEditorConfigSupport = true, + -- Specifies whether 'using' directives should be grouped and sorted during + -- document formatting. + OrganizeImports = nil, + }, + MsBuild = { + -- If true, MSBuild project system will only load projects for files that + -- were opened in the editor. This setting is useful for big C# codebases + -- and allows for faster initialization of code navigation features only + -- for projects that are relevant to code that is being edited. With this + -- setting enabled OmniSharp may load fewer projects and may thus display + -- incomplete reference lists for symbols. + LoadProjectsOnDemand = nil, + }, + RoslynExtensionsOptions = { + -- Enables support for roslyn analyzers, code fixes and rulesets. + EnableAnalyzersSupport = nil, + -- Enables support for showing unimported types and unimported extension + -- methods in completion lists. When committed, the appropriate using + -- directive will be added at the top of the current file. This option can + -- have a negative impact on initial completion responsiveness, + -- particularly for the first few completion sessions after opening a + -- solution. + EnableImportCompletion = nil, + -- Only run analyzers against open files when 'enableRoslynAnalyzers' is + -- true + AnalyzeOpenDocumentsOnly = nil, + }, + Sdk = { + -- Specifies whether to include preview versions of the .NET SDK when + -- determining which version to use for project loading. + IncludePrereleases = true, + }, + }, + + filetypes = { 'cs', 'vb' }, + root_dir = util.root_pattern('*.sln', '*.csproj', 'omnisharp.json', 'function.json'), + on_new_config = function(new_config, _) + -- Get the initially configured value of `cmd` + new_config.cmd = { unpack(new_config.cmd or {}) } + + -- Append hard-coded command arguments + table.insert(new_config.cmd, '-z') -- https://github.com/OmniSharp/omnisharp-vscode/pull/4300 + vim.list_extend(new_config.cmd, { '--hostPID', tostring(vim.fn.getpid()) }) + table.insert(new_config.cmd, 'DotNet:enablePackageRestore=false') + vim.list_extend(new_config.cmd, { '--encoding', 'utf-8' }) + table.insert(new_config.cmd, '--languageserver') + + -- Append configuration-dependent command arguments + local function flatten(tbl) + local ret = {} + for k, v in pairs(tbl) do + if type(v) == 'table' then + for _, pair in ipairs(flatten(v)) do + ret[#ret + 1] = k .. ':' .. pair + end + else + ret[#ret + 1] = k .. '=' .. vim.inspect(v) + end + end + return ret + end + if new_config.settings then + vim.list_extend(new_config.cmd, flatten(new_config.settings)) + end + + -- Disable the handling of multiple workspaces in a single instance + new_config.capabilities = vim.deepcopy(new_config.capabilities) + new_config.capabilities.workspace.workspaceFolders = false -- https://github.com/OmniSharp/omnisharp-roslyn/issues/909 + end, + init_options = {}, + }, + docs = { + description = [[ +https://github.com/omnisharp/omnisharp-roslyn +OmniSharp server based on Roslyn workspaces + +`omnisharp-roslyn` can be installed by downloading and extracting a release from [here](https://github.com/OmniSharp/omnisharp-roslyn/releases). +OmniSharp can also be built from source by following the instructions [here](https://github.com/omnisharp/omnisharp-roslyn#downloading-omnisharp). + +OmniSharp requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +**By default, omnisharp-roslyn doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. + +For `go_to_definition` to work fully, extended `textDocument/definition` handler is needed, for example see [omnisharp-extended-lsp.nvim](https://github.com/Hoffs/omnisharp-extended-lsp.nvim) + +```lua +require'lspconfig'.omnisharp.setup { + cmd = { "dotnet", "/path/to/omnisharp/OmniSharp.dll" }, + + settings = { + FormattingOptions = { + -- Enables support for reading code style, naming convention and analyzer + -- settings from .editorconfig. + EnableEditorConfigSupport = true, + -- Specifies whether 'using' directives should be grouped and sorted during + -- document formatting. + OrganizeImports = nil, + }, + MsBuild = { + -- If true, MSBuild project system will only load projects for files that + -- were opened in the editor. This setting is useful for big C# codebases + -- and allows for faster initialization of code navigation features only + -- for projects that are relevant to code that is being edited. With this + -- setting enabled OmniSharp may load fewer projects and may thus display + -- incomplete reference lists for symbols. + LoadProjectsOnDemand = nil, + }, + RoslynExtensionsOptions = { + -- Enables support for roslyn analyzers, code fixes and rulesets. + EnableAnalyzersSupport = nil, + -- Enables support for showing unimported types and unimported extension + -- methods in completion lists. When committed, the appropriate using + -- directive will be added at the top of the current file. This option can + -- have a negative impact on initial completion responsiveness, + -- particularly for the first few completion sessions after opening a + -- solution. + EnableImportCompletion = nil, + -- Only run analyzers against open files when 'enableRoslynAnalyzers' is + -- true + AnalyzeOpenDocumentsOnly = nil, + }, + Sdk = { + -- Specifies whether to include preview versions of the .NET SDK when + -- determining which version to use for project loading. + IncludePrereleases = true, + }, + }, +} +``` +]], + default_config = { + root_dir = [[root_pattern("*.sln", "*.csproj", "omnisharp.json", "function.json")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/opencl_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/opencl_ls.lua new file mode 100644 index 0000000..dc88d24 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/opencl_ls.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'opencl-language-server' }, + filetypes = { 'opencl' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/Galarius/opencl-language-server + +Build instructions can be found [here](https://github.com/Galarius/opencl-language-server/blob/main/_dev/build.md). + +Prebuilt binaries are available for Linux, macOS and Windows [here](https://github.com/Galarius/opencl-language-server/releases). +]], + default_config = { + root_dir = [[util.root_pattern(".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/openedge_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/openedge_ls.lua new file mode 100644 index 0000000..682b683 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/openedge_ls.lua @@ -0,0 +1,55 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'progress' }, + root_dir = util.root_pattern 'openedge-project.json', + on_new_config = function(config) + if not config.cmd and config.oe_jar_path then + config.cmd = { + 'java', + '--add-opens=java.base/java.lang=ALL-UNNAMED', + '--add-opens=java.base/java.math=ALL-UNNAMED', + '--add-opens=java.base/java.util=ALL-UNNAMED', + '--add-opens=java.base/java.util.concurrent=ALL-UNNAMED', + '--add-opens=java.base/java.net=ALL-UNNAMED', + '--add-opens=java.base/java.text=ALL-UNNAMED', + } + if config.debug then + config.cmd[#config.cmd + 1] = '-Dorg.slf4j.simpleLogger.defaultLogLevel=DEBUG' + end + config.cmd[#config.cmd + 1] = '-jar' + config.cmd[#config.cmd + 1] = config.oe_jar_path + if config.dlc then + config.cmd[#config.cmd + 1] = '--dlc' + config.cmd[#config.cmd + 1] = config.dlc + end + if config.trace then + config.cmd[#config.cmd + 1] = '--trace' + end + end + end, + }, + docs = { + description = [[ +[Language server](https://github.com/vscode-abl/vscode-abl) for Progress OpenEdge ABL. + +For manual installation, download abl-lsp.jar from the [VSCode +extension](https://github.com/vscode-abl/vscode-abl/releases/latest). + +Configuration + +```lua +require('lspconfig').['openedge_ls'].setup { + oe_jar_path = '/path/to/abl-lsp.jar', + dlc = '12.2:/path/to/dlc-12.2', -- Version number and OpenEdge root directory (colon separator) + debug = false, -- Set to true for debug logging + trace = false -- Set to true for trace logging (REALLY verbose) +} +``` +]], + default_config = { + root_dir = [[root_pattern('openedge-project.json')]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/openscad_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/openscad_ls.lua new file mode 100644 index 0000000..e5ca9ca --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/openscad_ls.lua @@ -0,0 +1,32 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'openscad-language-server' }, + filetypes = { 'openscad' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [=[ +https://github.com/dzhu/openscad-language-server + +A Language Server Protocol server for OpenSCAD + +You can build and install `openscad-language-server` binary with `cargo`: +```sh +cargo install openscad-language-server +``` + +Vim does not have built-in syntax for the `openscad` filetype currently. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.scad set filetype=openscad ]] +``` + +or by installing a filetype plugin such as https://github.com/sirtaj/vim-openscad +]=], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/openscad_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/openscad_lsp.lua new file mode 100644 index 0000000..f00a377 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/openscad_lsp.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'openscad-lsp', '--stdio' }, + filetypes = { 'openscad' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [=[ +https://github.com/Leathong/openscad-LSP + +A Language Server Protocol server for OpenSCAD + +You can build and install `openscad-lsp` binary with `cargo`: +```sh +cargo install openscad-lsp +``` +]=], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pact_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pact_ls.lua new file mode 100644 index 0000000..1eb8976 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pact_ls.lua @@ -0,0 +1,17 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'pact-lsp' }, + filetypes = { 'pact' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/kadena-io/pact-lsp + +The Pact language server + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pasls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pasls.lua new file mode 100644 index 0000000..19ef848 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pasls.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'pasls' }, + filetypes = { 'pascal' }, + root_dir = util.root_pattern('*.lpi', '*.lpk', '.git'), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/genericptr/pascal-language-server + +An LSP server implementation for Pascal variants that are supported by Free Pascal, including Object Pascal. It uses CodeTools from Lazarus as backend. + +First set `cmd` to the Pascal lsp binary. + +Customization options are passed to pasls as environment variables for example in your `.bashrc`: +```bash +export FPCDIR='/usr/lib/fpc/src' # FPC source directory (This is the only required option for the server to work). +export PP='/usr/lib/fpc/3.2.2/ppcx64' # Path to the Free Pascal compiler executable. +export LAZARUSDIR='/usr/lib/lazarus' # Path to the Lazarus sources. +export FPCTARGET='' # Target operating system for cross compiling. +export FPCTARGETCPU='x86_64' # Target CPU for cross compiling. +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pbls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pbls.lua new file mode 100644 index 0000000..d1fbe22 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pbls.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'pbls' }, + filetypes = { 'proto' }, + root_dir = util.root_pattern('.pbls.toml', '.git'), + }, + docs = { + description = [[ +https://git.sr.ht/~rrc/pbls + +Prerequisites: Ensure protoc is on your $PATH. + +`pbls` can be installed via `cargo install`: +```sh +cargo install --git https://git.sr.ht/~rrc/pbls +``` + +pbls is a Language Server for protobuf +]], + default_config = { + root_dir = [[root_pattern(".pbls.toml", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/perlls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/perlls.lua new file mode 100644 index 0000000..fba57d0 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/perlls.lua @@ -0,0 +1,38 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { + 'perl', + '-MPerl::LanguageServer', + '-e', + 'Perl::LanguageServer::run', + '--', + '--port 13603', + '--nostdio 0', + }, + settings = { + perl = { + perlCmd = 'perl', + perlInc = ' ', + fileFilter = { '.pm', '.pl' }, + ignoreDirs = '.git', + }, + }, + filetypes = { 'perl' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/richterger/Perl-LanguageServer/tree/master/clients/vscode/perl + +`Perl-LanguageServer`, a language server for Perl. + +To use the language server, ensure that you have Perl::LanguageServer installed and perl command is on your path. +]], + default_config = { + root_dir = "vim's starting directory", + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/perlnavigator.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/perlnavigator.lua new file mode 100644 index 0000000..d3c8f7f --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/perlnavigator.lua @@ -0,0 +1,33 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'perlnavigator' }, + filetypes = { 'perl' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/bscan/PerlNavigator + +A Perl language server. It can be installed via npm: + +```sh +npm i -g perlnavigator-server +``` + +At minimum, you will need `perl` in your path. If you want to use a non-standard `perl` you will need to set your configuration like so: +```lua +settings = { + perlnavigator = { + perlPath = '/some/odd/location/my-perl' + } +} +``` + +The `contributes.configuration.properties` section of `perlnavigator`'s `package.json` has all available configuration settings. All +settings have a reasonable default, but, at minimum, you may want to point `perlnavigator` at your `perltidy` and `perlcritic` configurations. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/perlpls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/perlpls.lua new file mode 100644 index 0000000..3326028 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/perlpls.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'pls' }, + settings = { + perl = { + perlcritic = { enabled = false }, + syntax = { enabled = true }, + }, + }, + filetypes = { 'perl' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/FractalBoy/perl-language-server +https://metacpan.org/pod/PLS + +`PLS`, another language server for Perl. + +To use the language server, ensure that you have PLS installed and that it is in your path +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pest_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pest_ls.lua new file mode 100644 index 0000000..4a56ea9 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pest_ls.lua @@ -0,0 +1,17 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'pest-language-server' }, + filetypes = { 'pest' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/pest-parser/pest-ide-tools + +Language server for pest grammars. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/phan.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/phan.lua new file mode 100644 index 0000000..bb5242e --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/phan.lua @@ -0,0 +1,40 @@ +local util = require 'lspconfig.util' + +local cmd = { + 'phan', + '-m', + 'json', + '--no-color', + '--no-progress-bar', + '-x', + '-u', + '-S', + '--language-server-on-stdin', + '--allow-polyfill-parser', +} + +return { + default_config = { + cmd = cmd, + filetypes = { 'php' }, + single_file_support = true, + root_dir = function(pattern) + local cwd = vim.loop.cwd() + local root = util.root_pattern('composer.json', '.git')(pattern) + + -- prefer cwd if root is a descendant + return util.path.is_descendant(cwd, root) and cwd or root + end, + }, + docs = { + description = [[ +https://github.com/phan/phan + +Installation: https://github.com/phan/phan#getting-started +]], + default_config = { + cmd = cmd, + root_dir = [[root_pattern("composer.json", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/phpactor.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/phpactor.lua new file mode 100644 index 0000000..b3c4009 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/phpactor.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'phpactor', 'language-server' }, + filetypes = { 'php' }, + root_dir = function(pattern) + local cwd = vim.loop.cwd() + local root = util.root_pattern('composer.json', '.git', '.phpactor.json', '.phpactor.yml')(pattern) + + -- prefer cwd if root is a descendant + return util.path.is_descendant(cwd, root) and cwd or root + end, + }, + docs = { + description = [[ +https://github.com/phpactor/phpactor + +Installation: https://phpactor.readthedocs.io/en/master/usage/standalone.html#global-installation +]], + default_config = { + cmd = { 'phpactor', 'language-server' }, + root_dir = [[root_pattern("composer.json", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pico8_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pico8_ls.lua new file mode 100644 index 0000000..0da26b7 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pico8_ls.lua @@ -0,0 +1,17 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'pico8-ls', '--stdio' }, + filetypes = { 'p8' }, + root_dir = util.root_pattern '*.p8', + settings = {}, + }, + docs = { + description = [[ +https://github.com/japhib/pico8-ls + +Full language support for the PICO-8 dialect of Lua. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pkgbuild_language_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pkgbuild_language_server.lua new file mode 100644 index 0000000..d3c9f31 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pkgbuild_language_server.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'pkgbuild-language-server' }, + filetypes = { 'PKGBUILD' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/Freed-Wu/pkgbuild-language-server + +Language server for ArchLinux/Windows Msys2's PKGBUILD. +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/please.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/please.lua new file mode 100644 index 0000000..085d1e7 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/please.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'plz', 'tool', 'lps' }, + filetypes = { 'bzl' }, + root_dir = util.root_pattern '.plzconfig', + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/thought-machine/please + +High-performance extensible build system for reproducible multi-language builds. + +The `plz` binary will automatically install the LSP for you on first run +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/postgres_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/postgres_lsp.lua new file mode 100644 index 0000000..a45824a --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/postgres_lsp.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'postgres_lsp' }, + filetypes = { 'sql' }, + root_dir = util.root_pattern 'root-file.txt', + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/supabase/postgres_lsp + +A Language Server for Postgres + ]], + default_config = { + root_dir = [[util.root_pattern 'root-file.txt']], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/powershell_es.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/powershell_es.lua new file mode 100644 index 0000000..d4cb744 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/powershell_es.lua @@ -0,0 +1,72 @@ +local util = require 'lspconfig.util' + +local temp_path = vim.fn.stdpath 'cache' + +local function make_cmd(new_config) + if new_config.bundle_path ~= nil then + local command_fmt = + [[& '%s/PowerShellEditorServices/Start-EditorServices.ps1' -BundledModulesPath '%s' -LogPath '%s/powershell_es.log' -SessionDetailsPath '%s/powershell_es.session.json' -FeatureFlags @() -AdditionalModules @() -HostName nvim -HostProfileId 0 -HostVersion 1.0.0 -Stdio -LogLevel Normal]] + local command = command_fmt:format(new_config.bundle_path, new_config.bundle_path, temp_path, temp_path) + return { new_config.shell, '-NoLogo', '-NoProfile', '-Command', command } + end +end + +return { + default_config = { + shell = 'pwsh', + on_new_config = function(new_config, _) + -- Don't overwrite cmd if already set + if not new_config.cmd then + new_config.cmd = make_cmd(new_config) + end + end, + + filetypes = { 'ps1' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/PowerShell/PowerShellEditorServices + +Language server for PowerShell. + +To install, download and extract PowerShellEditorServices.zip +from the [releases](https://github.com/PowerShell/PowerShellEditorServices/releases). +To configure the language server, set the property `bundle_path` to the root +of the extracted PowerShellEditorServices.zip. + +The default configuration doesn't set `cmd` unless `bundle_path` is specified. + +```lua +require'lspconfig'.powershell_es.setup{ + bundle_path = 'c:/w/PowerShellEditorServices', +} +``` + +By default the languageserver is started in `pwsh` (PowerShell Core). This can be changed by specifying `shell`. + +```lua +require'lspconfig'.powershell_es.setup{ + bundle_path = 'c:/w/PowerShellEditorServices', + shell = 'powershell.exe', +} +``` + +Note that the execution policy needs to be set to `Unrestricted` for the languageserver run under PowerShell + +If necessary, specific `cmd` can be defined instead of `bundle_path`. +See [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices#stdio) +to learn more. + +```lua +require'lspconfig'.powershell_es.setup{ + cmd = {'pwsh', '-NoLogo', '-NoProfile', '-Command', "c:/PSES/Start-EditorServices.ps1 ..."} +} +``` +]], + default_config = { + root_dir = 'git root or current directory', + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/prismals.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/prismals.lua new file mode 100644 index 0000000..16d252e --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/prismals.lua @@ -0,0 +1,27 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'prisma-language-server', '--stdio' }, + filetypes = { 'prisma' }, + settings = { + prisma = { + prismaFmtBinPath = '', + }, + }, + root_dir = util.root_pattern('.git', 'package.json'), + }, + docs = { + description = [[ +Language Server for the Prisma JavaScript and TypeScript ORM + +`@prisma/language-server` can be installed via npm +```sh +npm install -g @prisma/language-server +``` +]], + default_config = { + root_dir = [[root_pattern(".git", "package.json")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/prolog_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/prolog_ls.lua new file mode 100644 index 0000000..91b4ba3 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/prolog_ls.lua @@ -0,0 +1,27 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { + 'swipl', + '-g', + 'use_module(library(lsp_server)).', + '-g', + 'lsp_server:main', + '-t', + 'halt', + '--', + 'stdio', + }, + filetypes = { 'prolog' }, + root_dir = util.root_pattern 'pack.pl', + single_file_support = true, + }, + docs = { + description = [[ + https://github.com/jamesnvc/lsp_server + + Language Server Protocol server for SWI-Prolog + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/prosemd_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/prosemd_lsp.lua new file mode 100644 index 0000000..048e4b4 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/prosemd_lsp.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'prosemd-lsp', '--stdio' }, + filetypes = { 'markdown' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/kitten/prosemd-lsp + +An experimental LSP for Markdown. + +Please see the manual installation instructions: https://github.com/kitten/prosemd-lsp#manual-installation +]], + default_config = { + root_dir = util.find_git_ancestor, + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/psalm.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/psalm.lua new file mode 100644 index 0000000..f0f25f2 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/psalm.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'psalm', '--language-server' }, + filetypes = { 'php' }, + root_dir = util.root_pattern('psalm.xml', 'psalm.xml.dist'), + }, + docs = { + description = [[ +https://github.com/vimeo/psalm + +Can be installed with composer. +```sh +composer global require vimeo/psalm +``` +]], + default_config = { + cmd = { 'psalm', '--language-server' }, + root_dir = [[root_pattern("psalm.xml", "psalm.xml.dist")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/puppet.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/puppet.lua new file mode 100644 index 0000000..18a1532 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/puppet.lua @@ -0,0 +1,38 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'manifests', + '.puppet-lint.rc', + 'hiera.yaml', + '.git', +} + +return { + default_config = { + cmd = { 'puppet-languageserver', '--stdio' }, + filetypes = { 'puppet' }, + root_dir = util.root_pattern(unpack(root_files)), + single_file_support = true, + }, + docs = { + description = [[ +LSP server for Puppet. + +Installation: + +- Clone the editor-services repository: + https://github.com/puppetlabs/puppet-editor-services + +- Navigate into that directory and run: `bundle install` + +- Install the 'puppet-lint' gem: `gem install puppet-lint` + +- Add that repository to $PATH. + +- Ensure you can run `puppet-languageserver` from outside the editor-services directory. +]], + default_config = { + root_dir = [[root_pattern("manifests", ".puppet-lint.rc", "hiera.yaml", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/purescriptls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/purescriptls.lua new file mode 100644 index 0000000..baed504 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/purescriptls.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'purescript-language-server', '--stdio' }, + filetypes = { 'purescript' }, + root_dir = util.root_pattern( + 'bower.json', + 'flake.nix', + 'psc-package.json', + 'shell.nix', + 'spago.dhall', + 'spago.yaml' + ), + }, + docs = { + description = [[ +https://github.com/nwolverson/purescript-language-server + +The `purescript-language-server` can be added to your project and `$PATH` via + +* JavaScript package manager such as npm, pnpm, Yarn, et al. +* Nix under the `nodePackages` and `nodePackages_latest` package sets +]], + default_config = { + root_dir = [[root_pattern('bower.json', 'flake.nix', 'psc-package.json', 'shell.nix', 'spago.dhall', 'spago.yaml'),]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pylsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pylsp.lua new file mode 100644 index 0000000..d76b2ea --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pylsp.lua @@ -0,0 +1,48 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'pylsp' }, + filetypes = { 'python' }, + root_dir = function(fname) + local root_files = { + 'pyproject.toml', + 'setup.py', + 'setup.cfg', + 'requirements.txt', + 'Pipfile', + } + return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/python-lsp/python-lsp-server + +A Python 3.6+ implementation of the Language Server Protocol. + +See the [project's README](https://github.com/python-lsp/python-lsp-server) for installation instructions. + +Configuration options are documented [here](https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md). +In order to configure an option, it must be translated to a nested Lua table and included in the `settings` argument to the `setup{}` function. +For example, in order to set the `pylsp.plugins.pycodestyle.ignore` option: +```lua +require'lspconfig'.pylsp.setup{ + settings = { + pylsp = { + plugins = { + pycodestyle = { + ignore = {'W391'}, + maxLineLength = 100 + } + } + } + } +} +``` + +Note: This is a community fork of `pyls`. + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pylyzer.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pylyzer.lua new file mode 100644 index 0000000..34a4914 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pylyzer.lua @@ -0,0 +1,34 @@ +local util = require('lspconfig').util + +return { + default_config = { + cmd = { 'pylyzer', '--server' }, + filetypes = { 'python' }, + root_dir = function(fname) + local root_files = { + 'setup.py', + 'tox.ini', + 'requirements.txt', + 'Pipfile', + 'pyproject.toml', + } + return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + settings = { + python = { + diagnostics = true, + inlayHints = true, + smartCompletion = true, + checkOnType = false, + }, + }, + }, + docs = { + description = [[ + https://github.com/mtshiba/pylyzer + + `pylyzer`, a fast static code analyzer & language server for Python. + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pyre.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pyre.lua new file mode 100644 index 0000000..5c2f8fb --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pyre.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'pyre', 'persistent' }, + filetypes = { 'python' }, + root_dir = util.root_pattern '.pyre_configuration', + }, + docs = { + description = [[ +https://pyre-check.org/ + +`pyre` a static type checker for Python 3. + +`pyre` offers an extremely limited featureset. It currently only supports diagnostics, +which are triggered on save. + +Do not report issues for missing features in `pyre` to `lspconfig`. + +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pyright.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pyright.lua new file mode 100644 index 0000000..51681df --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/pyright.lua @@ -0,0 +1,80 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'pyproject.toml', + 'setup.py', + 'setup.cfg', + 'requirements.txt', + 'Pipfile', + 'pyrightconfig.json', + '.git', +} + +local function organize_imports() + local params = { + command = 'pyright.organizeimports', + arguments = { vim.uri_from_bufnr(0) }, + } + + local clients = util.get_lsp_clients { + bufnr = vim.api.nvim_get_current_buf(), + name = 'pyright', + } + for _, client in ipairs(clients) do + client.request('workspace/executeCommand', params, nil, 0) + end +end + +local function set_python_path(path) + local clients = util.get_lsp_clients { + bufnr = vim.api.nvim_get_current_buf(), + name = 'pyright', + } + for _, client in ipairs(clients) do + if client.settings then + client.settings.python = vim.tbl_deep_extend('force', client.settings.python, { pythonPath = path }) + else + client.config.settings = vim.tbl_deep_extend('force', client.config.settings, { python = { pythonPath = path } }) + end + client.notify('workspace/didChangeConfiguration', { settings = nil }) + end +end + +return { + default_config = { + cmd = { 'pyright-langserver', '--stdio' }, + filetypes = { 'python' }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) + end, + single_file_support = true, + settings = { + python = { + analysis = { + autoSearchPaths = true, + useLibraryCodeForTypes = true, + diagnosticMode = 'openFilesOnly', + }, + }, + }, + }, + commands = { + PyrightOrganizeImports = { + organize_imports, + description = 'Organize Imports', + }, + PyrightSetPythonPath = { + set_python_path, + description = 'Reconfigure pyright with the provided python path', + nargs = 1, + complete = 'file', + }, + }, + docs = { + description = [[ +https://github.com/microsoft/pyright + +`pyright`, a static type checker and language server for python +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/qml_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/qml_lsp.lua new file mode 100644 index 0000000..0f334a3 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/qml_lsp.lua @@ -0,0 +1,16 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'qml-lsp' }, + filetypes = { 'qmljs' }, + root_dir = util.root_pattern '*.qml', + }, + docs = { + description = [[ +https://invent.kde.org/sdk/qml-lsp + +LSP implementation for QML (autocompletion, live linting, etc. in editors) + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/qmlls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/qmlls.lua new file mode 100644 index 0000000..b045159 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/qmlls.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'qmlls' }, + filetypes = { 'qml', 'qmljs' }, + root_dir = function(fname) + return util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/qt/qtdeclarative + +LSP implementation for QML (autocompletion, live linting, etc. in editors), + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/quick_lint_js.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/quick_lint_js.lua new file mode 100644 index 0000000..762a816 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/quick_lint_js.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'quick-lint-js', '--lsp-server' }, + filetypes = { 'javascript', 'typescript' }, + root_dir = util.root_pattern('package.json', 'jsconfig.json', '.git'), + single_file_support = true, + }, + docs = { + description = [[ +https://quick-lint-js.com/ + +quick-lint-js finds bugs in JavaScript programs. + +See installation [instructions](https://quick-lint-js.com/install/) +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/r_language_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/r_language_server.lua new file mode 100644 index 0000000..bdbab84 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/r_language_server.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'R', '--slave', '-e', 'languageserver::run()' }, + filetypes = { 'r', 'rmd' }, + root_dir = function(fname) + return util.find_git_ancestor(fname) or vim.loop.os_homedir() + end, + log_level = vim.lsp.protocol.MessageType.Warning, + }, + docs = { + description = [[ +[languageserver](https://github.com/REditorSupport/languageserver) is an +implementation of the Microsoft's Language Server Protocol for the R +language. + +It is released on CRAN and can be easily installed by + +```r +install.packages("languageserver") +``` +]], + default_config = { + root_dir = [[root_pattern(".git") or os_homedir]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/racket_langserver.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/racket_langserver.lua new file mode 100644 index 0000000..25bd0ab --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/racket_langserver.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'racket', '--lib', 'racket-langserver' }, + filetypes = { 'racket', 'scheme' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +[https://github.com/jeapostrophe/racket-langserver](https://github.com/jeapostrophe/racket-langserver) + +The Racket language server. This project seeks to use +[DrRacket](https://github.com/racket/drracket)'s public API to provide +functionality that mimics DrRacket's code tools as closely as possible. + +Install via `raco`: `raco pkg install racket-langserver` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/raku_navigator.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/raku_navigator.lua new file mode 100644 index 0000000..26ff321 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/raku_navigator.lua @@ -0,0 +1,33 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = {}, + filetypes = { 'raku' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/bscan/RakuNavigator +A Raku language server +**By default, raku_navigator doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. +You have to install the language server manually. +Clone the RakuNavigator repo, install based on the [instructions](https://github.com/bscan/raku_Navigator#installation-for-other-editors), +and point `cmd` to `server.js` inside the `server/out` directory: +```lua +cmd = {'node', '<path_to_repo>/server/out/server.js', '--stdio'} +``` +At minimum, you will need `raku` in your path. If you want to use a non-standard `raku` you will need to set your configuration like so: +```lua +settings = { + raku_navigator = { + rakuPath = '/some/odd/location/my-raku' + } +} +``` +The `contributes.configuration.properties` section of `raku_navigator`'s `package.json` has all available configuration settings. All +settings have a reasonable default, but, at minimum, you may want to point `raku_navigator` at your `raku_tidy` and `raku_critic` configurations. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/reason_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/reason_ls.lua new file mode 100644 index 0000000..75028c7 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/reason_ls.lua @@ -0,0 +1,16 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'reason-language-server' }, + filetypes = { 'reason' }, + root_dir = util.root_pattern('bsconfig.json', '.git'), + }, + docs = { + description = [[ +Reason language server + +You can install reason language server from [reason-language-server](https://github.com/jaredly/reason-language-server) repository. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/regal.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/regal.lua new file mode 100644 index 0000000..24ec092 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/regal.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'regal', 'language-server' }, + filetypes = { 'rego' }, + root_dir = function(fname) + return util.root_pattern '*.rego'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/StyraInc/regal + +A linter for Rego, with support for running as an LSP server. + +`regal` can be installed by running: +```sh +go install github.com/StyraInc/regal@latest +``` + ]], + default_config = { + root_dir = [[root_pattern("*.rego", ".git")]], + single_file_support = true, + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/regols.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/regols.lua new file mode 100644 index 0000000..f872a52 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/regols.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'regols' }, + filetypes = { 'rego' }, + root_dir = function(fname) + return util.root_pattern '*.rego'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/kitagry/regols + +OPA Rego language server. + +`regols` can be installed by running: +```sh +go install github.com/kitagry/regols@latest +``` + ]], + default_config = { + root_dir = [[root_pattern("*.rego", ".git")]], + single_file_support = true, + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/relay_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/relay_lsp.lua new file mode 100644 index 0000000..acaa617 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/relay_lsp.lua @@ -0,0 +1,110 @@ +local util = require 'lspconfig.util' +local log = require 'vim.lsp.log' + +return { + default_config = { + -- (default: false) Whether or not we should automatically start the + -- Relay Compiler in watch mode when you open a project + auto_start_compiler = false, + + -- (default: nil) Path to a relay config relative to the `root_dir`. + -- Without this, the compiler will search for your config. This is + -- helpful if your relay project is in a nested directory. + path_to_config = nil, + + cmd = { 'relay-compiler', 'lsp' }, + filetypes = { + 'javascript', + 'javascriptreact', + 'javascript.jsx', + 'typescript', + 'typescriptreact', + 'typescript.tsx', + }, + root_dir = util.root_pattern('relay.config.*', 'package.json'), + on_new_config = function(config, root_dir) + local project_root = util.find_node_modules_ancestor(root_dir) + local node_bin_path = util.path.join(project_root, 'node_modules', '.bin') + local compiler_cmd = { util.path.join(node_bin_path, 'relay-compiler'), '--watch' } + local path = node_bin_path .. util.path.path_separator .. vim.env.PATH + if config.cmd_env then + config.cmd_env.PATH = path + else + config.cmd_env = { PATH = path } + end + + if config.path_to_config then + config.path_to_config = util.path.sanitize(config.path_to_config) + local path_to_config = util.path.join(root_dir, config.path_to_config) + if util.path.exists(path_to_config) then + vim.list_extend(config.cmd, { config.path_to_config }) + vim.list_extend(compiler_cmd, { config.path_to_config }) + else + log.error "[Relay LSP] Can't find Relay config file. Fallback to the default location..." + end + end + if config.auto_start_compiler then + vim.fn.jobstart(compiler_cmd, { + on_exit = function() + log.info '[Relay LSP] Relay Compiler exited' + end, + cwd = project_root, + }) + end + end, + handlers = { + ['window/showStatus'] = function(_, result) + if not result then + return {} + end + local log_message = string.format('[Relay LSP] %q', result.message) + if result.type == 1 then + log.error(log_message) + end + if result.type == 2 then + log.warn(log_message) + end + if result.type == 3 then + log.info(log_message) + end + return {} + end, + }, + }, + docs = { + description = [[ + https://github.com/facebook/relay + `Relay` is a JavaScript framework for building data-driven React applications + + Setup: + + - Make sure you have a Relay config file somewhere in your project. + - We support standard config file formats (`.yml`, `.js`, `.json`), and the the `relay` field in your `package.json` + - Make sure you have the `relay-compiler` installed in your project. The bare minimum is v13. + - Make sure you are able to run the `relay-compiler` command from the command line. If `yarn relay-compiler` works, it's very likely that the LSP will work. + - Remove / disable any conflicting GraphQL LSPs you have installed. + + Relay LSP is a part of the Relay Compiler binary and available when adding `relay-compiler` to your project's devDependencies. + + ```lua + require'lspconfig'.relay_lsp.setup { + -- (default: false) Whether or not we should automatically start + -- the Relay Compiler in watch mode when you open a project + auto_start_compiler = false, + + + -- (default: null) Path to a relay config relative to the + -- `root_dir`. Without this, the compiler will search for your + -- config. This is helpful if your relay project is in a nested + -- directory. + path_to_config = nil, + } + ``` + ]], + default_config = { + root_dir = [[root_pattern("relay.config.*", "package.json")]], + auto_start_compiler = false, + path_to_config = nil, + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/remark_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/remark_ls.lua new file mode 100644 index 0000000..54eabe7 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/remark_ls.lua @@ -0,0 +1,52 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'remark-language-server', '--stdio' }, + filetypes = { 'markdown' }, + root_dir = util.root_pattern( + '.remarkrc', + '.remarkrc.json', + '.remarkrc.js', + '.remarkrc.cjs', + '.remarkrc.mjs', + '.remarkrc.yml', + '.remarkrc.yaml', + '.remarkignore' + ), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/remarkjs/remark-language-server + +`remark-language-server` can be installed via `npm`: +```sh +npm install -g remark-language-server +``` + +`remark-language-server` uses the same +[configuration files](https://github.com/remarkjs/remark/tree/main/packages/remark-cli#example-config-files-json-yaml-js) +as `remark-cli`. + +This uses a plugin based system. Each plugin needs to be installed locally using `npm` or `yarn`. + +For example, given the following `.remarkrc.json`: + +```json +{ + "presets": [ + "remark-preset-lint-recommended" + ] +} +``` + +`remark-preset-lint-recommended` needs to be installed in the local project: + +```sh +npm install remark-preset-lint-recommended +``` + +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/rescriptls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/rescriptls.lua new file mode 100644 index 0000000..882a110 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/rescriptls.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'rescript-language-server', '--stdio' }, + filetypes = { 'rescript' }, + root_dir = util.root_pattern('bsconfig.json', 'rescript.json', '.git'), + settings = {}, + init_options = { + extensionConfiguration = { + askToStartBuild = false, + }, + }, + }, + docs = { + description = [[ +https://github.com/rescript-lang/rescript-vscode/tree/master/server + +ReScript Language Server can be installed via npm: +```sh +npm install -g @rescript/language-server +``` + +See the init_options supported (see https://github.com/rescript-lang/rescript-vscode/tree/master/server/config.md): +]], + root_dir = [[root_pattern('bsconfig.json', 'rescript.json', '.git')]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/rls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/rls.lua new file mode 100644 index 0000000..363b81d --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/rls.lua @@ -0,0 +1,42 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'rls' }, + filetypes = { 'rust' }, + root_dir = util.root_pattern 'Cargo.toml', + }, + docs = { + description = [[ +https://github.com/rust-lang/rls + +rls, a language server for Rust + +See https://github.com/rust-lang/rls#setup to setup rls itself. +See https://github.com/rust-lang/rls#configuration for rls-specific settings. +All settings listed on the rls configuration section of the readme +must be set under settings.rust as follows: + +```lua +nvim_lsp.rls.setup { + settings = { + rust = { + unstable_features = true, + build_on_save = false, + all_features = true, + }, + }, +} +``` + +If you want to use rls for a particular build, eg nightly, set cmd as follows: + +```lua +cmd = {"rustup", "run", "nightly", "rls"} +``` + ]], + default_config = { + root_dir = [[root_pattern("Cargo.toml")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/rnix.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/rnix.lua new file mode 100644 index 0000000..aa7f00e --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/rnix.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'rnix-lsp' }, + filetypes = { 'nix' }, + root_dir = function(fname) + return util.find_git_ancestor(fname) or vim.loop.os_homedir() + end, + settings = {}, + init_options = {}, + }, + docs = { + description = [[ +https://github.com/nix-community/rnix-lsp + +A language server for Nix providing basic completion and formatting via nixpkgs-fmt. + +To install manually, run `cargo install rnix-lsp`. If you are using nix, rnix-lsp is in nixpkgs. + +This server accepts configuration via the `settings` key. + + ]], + default_config = { + root_dir = "vim's starting directory", + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/robotframework_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/robotframework_ls.lua new file mode 100644 index 0000000..d1c25f5 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/robotframework_ls.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'robotframework_ls' }, + filetypes = { 'robot' }, + root_dir = function(fname) + return util.root_pattern('robotidy.toml', 'pyproject.toml', 'conda.yaml', 'robot.yaml')(fname) + or util.find_git_ancestor(fname) + end, + }, + docs = { + description = [[ +https://github.com/robocorp/robotframework-lsp + +Language Server Protocol implementation for Robot Framework. +]], + default_config = { + root_dir = "util.root_pattern('robotidy.toml', 'pyproject.toml', 'conda.yaml', 'robot.yaml')(fname)" + .. '\n or util.find_git_ancestor(fname)', + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/roc_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/roc_ls.lua new file mode 100644 index 0000000..6737736 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/roc_ls.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'roc_language_server' }, + filetypes = { 'roc' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/roc-lang/roc/tree/main/crates/language_server#roc_language_server + +The built-in language server for the Roc programming language. +[Installation](https://github.com/roc-lang/roc/tree/main/crates/language_server#installing) +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/rome.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/rome.lua new file mode 100644 index 0000000..ed23a18 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/rome.lua @@ -0,0 +1,37 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'rome', 'lsp-proxy' }, + filetypes = { + 'javascript', + 'javascriptreact', + 'json', + 'typescript', + 'typescript.tsx', + 'typescriptreact', + }, + root_dir = function(fname) + return util.find_package_json_ancestor(fname) + or util.find_node_modules_ancestor(fname) + or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://rome.tools + +Language server for the Rome Frontend Toolchain. + +(Unmaintained, use [Biome](https://biomejs.dev/blog/annoucing-biome) instead.) + +```sh +npm install [-g] rome +``` +]], + default_config = { + root_dir = [[root_pattern('package.json', 'node_modules', '.git')]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/rubocop.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/rubocop.lua new file mode 100644 index 0000000..0d2cd29 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/rubocop.lua @@ -0,0 +1,17 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'rubocop', '--lsp' }, + filetypes = { 'ruby' }, + root_dir = util.root_pattern('Gemfile', '.git'), + }, + docs = { + description = [[ +https://github.com/rubocop/rubocop + ]], + default_config = { + root_dir = [[root_pattern("Gemfile", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ruby_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ruby_lsp.lua new file mode 100644 index 0000000..dad56e6 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ruby_lsp.lua @@ -0,0 +1,33 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'ruby-lsp' }, + filetypes = { 'ruby' }, + root_dir = util.root_pattern('Gemfile', '.git'), + init_options = { + formatter = 'auto', + }, + single_file_support = true, + }, + docs = { + description = [[ +https://shopify.github.io/ruby-lsp/ + +This gem is an implementation of the language server protocol specification for +Ruby, used to improve editor features. + +Install the gem. There's no need to require it, since the server is used as a +standalone executable. + +```sh +group :development do + gem "ruby-lsp", require: false +end +``` + ]], + default_config = { + root_dir = [[root_pattern("Gemfile", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ruff.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ruff.lua new file mode 100644 index 0000000..09a494c --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ruff.lua @@ -0,0 +1,41 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'pyproject.toml', + 'ruff.toml', + '.ruff.toml', +} + +return { + default_config = { + cmd = { 'ruff', 'server', '--preview' }, + filetypes = { 'python' }, + root_dir = util.root_pattern(unpack(root_files)) or util.find_git_ancestor(), + single_file_support = true, + settings = {}, + }, + docs = { + 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. + +```sh +pip install ruff +``` + +_Requires Ruff v0.3.3 or later._ + +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: + +1. Diagnostics +2. Code actions +3. Formatting +4. Range Formatting + +Please note that the `ruff-lsp` server will continue to be maintained until further notice. + + ]], + root_dir = [[root_pattern("pyproject.toml", "ruff.toml", ".ruff.toml", ".git")]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ruff_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ruff_lsp.lua new file mode 100644 index 0000000..1a10285 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ruff_lsp.lua @@ -0,0 +1,42 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'pyproject.toml', + 'ruff.toml', +} + +return { + default_config = { + cmd = { 'ruff-lsp' }, + filetypes = { 'python' }, + root_dir = util.root_pattern(unpack(root_files)) or util.find_git_ancestor(), + single_file_support = true, + settings = {}, + }, + docs = { + description = [[ +https://github.com/astral-sh/ruff-lsp + +A Language Server Protocol implementation for Ruff, an extremely fast Python linter and code transformation tool, written in Rust. It can be installed via pip. + +```sh +pip install ruff-lsp +``` + +Extra CLI arguments for `ruff` can be provided via + +```lua +require'lspconfig'.ruff_lsp.setup{ + init_options = { + settings = { + -- Any extra CLI arguments for `ruff` go here. + args = {}, + } + } +} +``` + + ]], + root_dir = [[root_pattern("pyproject.toml", "ruff.toml", ".git")]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/rune_languageserver.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/rune_languageserver.lua new file mode 100644 index 0000000..7f51047 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/rune_languageserver.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'rune-languageserver' }, + filetypes = { 'rune' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://crates.io/crates/rune-languageserver + +A language server for the [Rune](https://rune-rs.github.io/) Language, +an embeddable dynamic programming language for Rust + ]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/rust_analyzer.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/rust_analyzer.lua new file mode 100644 index 0000000..61dfdc1 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/rust_analyzer.lua @@ -0,0 +1,117 @@ +local util = require 'lspconfig.util' +local async = require 'lspconfig.async' + +local function reload_workspace(bufnr) + bufnr = util.validate_bufnr(bufnr) + local clients = util.get_lsp_clients { bufnr = bufnr, name = 'rust_analyzer' } + for _, client in ipairs(clients) do + vim.notify 'Reloading Cargo Workspace' + client.request('rust-analyzer/reloadWorkspace', nil, function(err) + if err then + error(tostring(err)) + end + vim.notify 'Cargo workspace reloaded' + end, 0) + end +end + +local function is_library(fname) + local user_home = util.path.sanitize(vim.env.HOME) + local cargo_home = os.getenv 'CARGO_HOME' or util.path.join(user_home, '.cargo') + local registry = util.path.join(cargo_home, 'registry', 'src') + local git_registry = util.path.join(cargo_home, 'git', 'checkouts') + + local rustup_home = os.getenv 'RUSTUP_HOME' or util.path.join(user_home, '.rustup') + local toolchains = util.path.join(rustup_home, 'toolchains') + + for _, item in ipairs { toolchains, registry, git_registry } do + if util.path.is_descendant(item, fname) then + local clients = util.get_lsp_clients { name = 'rust_analyzer' } + return #clients > 0 and clients[#clients].config.root_dir or nil + end + end +end + +local function register_cap() + local capabilities = vim.lsp.protocol.make_client_capabilities() + capabilities.experimental = { + serverStatusNotification = true, + } + return capabilities +end + +return { + default_config = { + cmd = { 'rust-analyzer' }, + filetypes = { 'rust' }, + single_file_support = true, + root_dir = function(fname) + local reuse_active = is_library(fname) + if reuse_active then + return reuse_active + end + + local cargo_crate_dir = util.root_pattern 'Cargo.toml'(fname) + local cargo_workspace_root + + if cargo_crate_dir ~= nil then + local cmd = { + 'cargo', + 'metadata', + '--no-deps', + '--format-version', + '1', + '--manifest-path', + util.path.join(cargo_crate_dir, 'Cargo.toml'), + } + + local result = async.run_command(cmd) + + if result and result[1] then + result = vim.json.decode(table.concat(result, '')) + if result['workspace_root'] then + cargo_workspace_root = util.path.sanitize(result['workspace_root']) + end + end + end + + return cargo_workspace_root + or cargo_crate_dir + or util.root_pattern 'rust-project.json'(fname) + or util.find_git_ancestor(fname) + end, + capabilities = register_cap(), + }, + commands = { + CargoReload = { + function() + reload_workspace(0) + end, + description = 'Reload current cargo workspace', + }, + }, + docs = { + description = [[ +https://github.com/rust-lang/rust-analyzer + +rust-analyzer (aka rls 2.0), a language server for Rust + + +See [docs](https://github.com/rust-lang/rust-analyzer/blob/master/docs/user/generated_config.adoc) for extra settings. The settings can be used like this: +```lua +require'lspconfig'.rust_analyzer.setup{ + settings = { + ['rust-analyzer'] = { + diagnostics = { + enable = false; + } + } + } +} +``` + ]], + default_config = { + root_dir = [[root_pattern("Cargo.toml", "rust-project.json")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/salt_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/salt_ls.lua new file mode 100644 index 0000000..65d1d32 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/salt_ls.lua @@ -0,0 +1,24 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'salt_lsp_server' }, + filetypes = { 'sls' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +Language server for Salt configuration files. +https://github.com/dcermak/salt-lsp + +The language server can be installed with `pip`: +```sh +pip install salt-lsp +``` + ]], + default_config = { + root_dir = [[root_pattern('.git')]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/scheme_langserver.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/scheme_langserver.lua new file mode 100644 index 0000000..0eaaa28 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/scheme_langserver.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' +local bin_name = 'scheme-langserver' +local cmd = { bin_name } +local root_files = { + 'Akku.manifest', + '.git', +} + +return { + default_config = { + cmd = cmd, + filetypes = { 'scheme' }, + root_dir = util.root_pattern(unpack(root_files)), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/ufo5260987423/scheme-langserver +`scheme-langserver`, a language server protocol implementation for scheme. +And for nvim user, please add .sls to scheme file extension list. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/scry.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/scry.lua new file mode 100644 index 0000000..8350a43 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/scry.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'scry' }, + filetypes = { 'crystal' }, + root_dir = function(fname) + return util.root_pattern 'shard.yml'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/crystal-lang-tools/scry + +Crystal language server. +]], + default_config = { + root_dir = [[root_pattern('shard.yml', '.git')]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/serve_d.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/serve_d.lua new file mode 100644 index 0000000..09d1b10 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/serve_d.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'serve-d' }, + filetypes = { 'd' }, + root_dir = util.root_pattern('dub.json', 'dub.sdl', '.git'), + }, + docs = { + description = [[ + https://github.com/Pure-D/serve-d + + `Microsoft language server protocol implementation for D using workspace-d.` + Download a binary from https://github.com/Pure-D/serve-d/releases and put it in your $PATH. + ]], + default_config = { + root_dir = [[util.root_pattern("dub.json", "dub.sdl", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/shopify_theme_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/shopify_theme_ls.lua new file mode 100644 index 0000000..bf746a8 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/shopify_theme_ls.lua @@ -0,0 +1,36 @@ +local util = require 'lspconfig.util' + +local root_files = { + '.shopifyignore', + '.theme-check.yml', + '.theme-check.yaml', + 'shopify.theme.toml', +} + +return { + default_config = { + cmd = { + 'shopify', + 'theme', + 'language-server', + }, + filetypes = { 'liquid' }, + root_dir = util.root_pattern(unpack(root_files)), + settings = {}, + }, + docs = { + description = [[ +https://shopify.dev/docs/api/shopify-cli + +[Language Server](https://shopify.dev/docs/themes/tools/cli/language-server) and Theme Check (linter) for Shopify themes. + +`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. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sixtyfps.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sixtyfps.lua new file mode 100644 index 0000000..da90fe3 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sixtyfps.lua @@ -0,0 +1,28 @@ +return { + default_config = { + cmd = { 'sixtyfps-lsp' }, + filetypes = { 'sixtyfps' }, + single_file_support = true, + }, + docs = { + description = [=[ +https://github.com/sixtyfpsui/sixtyfps +`SixtyFPS`'s language server + +You can build and install `sixtyfps-lsp` binary with `cargo`: +```sh +cargo install sixtyfps-lsp +``` + +Vim does not have built-in syntax for the `sixtyfps` filetype currently. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.60 set filetype=sixtyfps ]] +``` + +or by installing a filetype plugin such as https://github.com/RustemB/sixtyfps-vim +]=], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/slangd.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/slangd.lua new file mode 100644 index 0000000..642b4dd --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/slangd.lua @@ -0,0 +1,44 @@ +local util = require 'lspconfig.util' +local bin_name = 'slangd' + +if vim.fn.has 'win32' == 1 then + bin_name = 'slangd.exe' +end + +return { + default_config = { + cmd = { bin_name }, + filetypes = { 'hlsl', 'shaderslang' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/shader-slang/slang + +The `slangd` binary can be downloaded as part of [slang releases](https://github.com/shader-slang/slang/releases) or +by [building `slang` from source](https://github.com/shader-slang/slang/blob/master/docs/building.md). + +The server can be configured by passing a "settings" object to `slangd.setup{}`: + +```lua +require('lspconfig').slangd.setup{ + settings = { + slang = { + predefinedMacros = {"MY_VALUE_MACRO=1"}, + inlayHints = { + deducedTypes = true, + parameterNames = true, + } + } + } +} +``` +Available options are documented [here](https://github.com/shader-slang/slang-vscode-extension/tree/main?tab=readme-ov-file#configurations) +or in more detail [here](https://github.com/shader-slang/slang-vscode-extension/blob/main/package.json#L70). +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/slint_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/slint_lsp.lua new file mode 100644 index 0000000..e921cb6 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/slint_lsp.lua @@ -0,0 +1,26 @@ +return { + default_config = { + cmd = { 'slint-lsp' }, + filetypes = { 'slint' }, + single_file_support = true, + }, + docs = { + description = [=[ +https://github.com/slint-ui/slint +`Slint`'s language server + +You can build and install `slint-lsp` binary with `cargo`: +```sh +cargo install slint-lsp +``` + +Vim does not have built-in syntax for the `slint` filetype at this time. + +This can be added via an autocmd: + +```lua +vim.cmd [[ autocmd BufRead,BufNewFile *.slint set filetype=slint ]] +``` +]=], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/smarty_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/smarty_ls.lua new file mode 100644 index 0000000..fd6c212 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/smarty_ls.lua @@ -0,0 +1,39 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'smarty-language-server', '--stdio' }, + filetypes = { 'smarty' }, + root_dir = function(pattern) + local cwd = vim.loop.cwd() + local root = util.root_pattern('composer.json', '.git')(pattern) + + -- prefer cwd if root is a descendant + return util.path.is_descendant(cwd, root) and cwd or root + end, + settings = { + smarty = { + pluginDirs = {}, + }, + css = { + validate = true, + }, + }, + init_options = { + storageDir = nil, + }, + }, + docs = { + description = [[ +https://github.com/landeaux/vscode-smarty-langserver-extracted + +Language server for Smarty. + +`smarty-language-server` can be installed via `npm`: + +```sh +npm i -g vscode-smarty-langserver-extracted +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/smithy_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/smithy_ls.lua new file mode 100644 index 0000000..ef6f010 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/smithy_ls.lua @@ -0,0 +1,30 @@ +local util = require 'lspconfig.util' + +-- pass 0 as the first argument to use STDIN/STDOUT for communication +local cmd = { 'smithy-language-server', '0' } + +local root_files = { + 'smithy-build.json', + 'build.gradle', + 'build.gradle.kts', + '.git', +} + +return { + default_config = { + cmd = cmd, + filetypes = { 'smithy' }, + single_file_support = true, + root_dir = util.root_pattern(unpack(root_files)), + }, + docs = { + description = [[ +https://github.com/awslabs/smithy-language-server + +`Smithy Language Server`, A Language Server Protocol implementation for the Smithy IDL +]], + default_config = { + root_dir = [[root_pattern("smithy-build.json", "build.gradle", "build.gradle.kts", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/snyk_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/snyk_ls.lua new file mode 100644 index 0000000..50faa0d --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/snyk_ls.lua @@ -0,0 +1,37 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'snyk-ls' }, + root_dir = util.root_pattern('.git', '.snyk'), + filetypes = { + 'go', + 'gomod', + 'javascript', + 'typescript', + 'json', + 'python', + 'requirements', + 'helm', + 'yaml', + 'terraform', + 'terraform-vars', + }, + single_file_support = true, + settings = {}, + init_options = { + activateSnykCode = 'true', + }, + }, + docs = { + description = [[ +https://github.com/snyk/snyk-ls + +LSP for Snyk Open Source, Snyk Infrastructure as Code, and Snyk Code. +]], + default_config = { + root_dir = [[root_pattern(".git", ".snyk")]], + init_options = 'Configuration from https://github.com/snyk/snyk-ls#configuration-1', + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/solang.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/solang.lua new file mode 100644 index 0000000..cef5321 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/solang.lua @@ -0,0 +1,27 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'solang', 'language-server', '--target', 'evm' }, + filetypes = { 'solidity' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +A language server for Solidity + +See the [documentation](https://solang.readthedocs.io/en/latest/installing.html) for installation instructions. + +The language server only provides the following capabilities: +* Syntax highlighting +* Diagnostics +* Hover + +There is currently no support for completion, goto definition, references, or other functionality. + +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/solargraph.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/solargraph.lua new file mode 100644 index 0000000..c33c34b --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/solargraph.lua @@ -0,0 +1,31 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'solargraph', 'stdio' }, + settings = { + solargraph = { + diagnostics = true, + }, + }, + init_options = { formatting = true }, + filetypes = { 'ruby' }, + root_dir = util.root_pattern('Gemfile', '.git'), + }, + docs = { + description = [[ +https://solargraph.org/ + +solargraph, a language server for Ruby + +You can install solargraph via gem install. + +```sh +gem install --user-install solargraph +``` + ]], + default_config = { + root_dir = [[root_pattern("Gemfile", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/solc.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/solc.lua new file mode 100644 index 0000000..9ae3948 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/solc.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'solc', '--lsp' }, + filetypes = { 'solidity' }, + root_dir = util.root_pattern('hardhat.config.*', '.git'), + }, + docs = { + description = [[ +https://docs.soliditylang.org/en/latest/installing-solidity.html + +solc is the native language server for the Solidity language. +]], + default_config = { + root_dir = [[root_pattern('hardhat.config.*', '.git')]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/solidity.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/solidity.lua new file mode 100644 index 0000000..4e254bd --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/solidity.lua @@ -0,0 +1,49 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'solidity-ls', '--stdio' }, + filetypes = { 'solidity' }, + root_dir = util.root_pattern('.git', 'package.json'), + settings = { solidity = { includePath = '', remapping = {} } }, + }, + docs = { + description = [[ +https://github.com/qiuxiang/solidity-ls + +npm i solidity-ls -g + +Make sure that solc is installed and it's the same version of the file. solc-select is recommended. + +Solidity language server is a LSP with autocomplete, go to definition and diagnostics. + +If you use brownie, use this root_dir: +root_dir = util.root_pattern('brownie-config.yaml', '.git') + +on includePath, you can add an extra path to search for external libs, on remapping you can remap lib <> path, like: + +```lua +{ solidity = { includePath = '/Users/your_user/.brownie/packages/', remapping = { ["@OpenZeppelin/"] = 'OpenZeppelin/openzeppelin-contracts@4.6.0/' } } } +``` + +**For brownie users** +Change the root_dir to: + +```lua +root_pattern("brownie-config.yaml", ".git") +``` + +The best way of using it is to have a package.json in your project folder with the packages that you will use. +After installing with package.json, just create a `remappings.txt` with: + +``` +@OpenZeppelin/=node_modules/OpenZeppelin/openzeppelin-contracts@4.6.0/ +``` + +You can omit the node_modules as well. +]], + default_config = { + root_dir = [[root_pattern("package.json", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/solidity_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/solidity_ls.lua new file mode 100644 index 0000000..1183a9c --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/solidity_ls.lua @@ -0,0 +1,36 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'hardhat.config.js', + 'hardhat.config.ts', + 'foundry.toml', + 'remappings.txt', + 'truffle.js', + 'truffle-config.js', + 'ape-config.yaml', +} + +return { + default_config = { + cmd = { 'vscode-solidity-server', '--stdio' }, + filetypes = { 'solidity' }, + root_dir = util.root_pattern(unpack(root_files)) or util.root_pattern('.git', 'package.json'), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/juanfranblanco/vscode-solidity + +`vscode-solidity-server` can be installed via `npm`: + +```sh +npm install -g vscode-solidity-server +``` + +`vscode-solidity-server` is a language server for the Solidity language ported from the VSCode "solidity" extension. +]], + default_config = { + root_dir = [[root_pattern("]] .. table.concat(root_files, '", "') .. [[", ".git", "package.json")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/solidity_ls_nomicfoundation.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/solidity_ls_nomicfoundation.lua new file mode 100644 index 0000000..cab836c --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/solidity_ls_nomicfoundation.lua @@ -0,0 +1,36 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'hardhat.config.js', + 'hardhat.config.ts', + 'foundry.toml', + 'remappings.txt', + 'truffle.js', + 'truffle-config.js', + 'ape-config.yaml', +} + +return { + default_config = { + cmd = { 'nomicfoundation-solidity-language-server', '--stdio' }, + filetypes = { 'solidity' }, + root_dir = util.root_pattern(unpack(root_files)) or util.root_pattern('.git', 'package.json'), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/NomicFoundation/hardhat-vscode/blob/development/server/README.md + +`nomicfoundation-solidity-language-server` can be installed via `npm`: + +```sh +npm install -g @nomicfoundation/solidity-language-server +``` + +A language server for the Solidity programming language, built by the Nomic Foundation for the Ethereum community. +]], + default_config = { + root_dir = [[root_pattern("]] .. table.concat(root_files, '", "') .. [[", ".git", "package.json")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/somesass_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/somesass_ls.lua new file mode 100644 index 0000000..710d562 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/somesass_ls.lua @@ -0,0 +1,40 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + name = 'somesass_ls', + cmd = { 'some-sass-language-server', '--stdio' }, + filetypes = { 'scss', 'sass' }, + root_dir = util.root_pattern('.git', '.package.json'), + single_file_support = true, + settings = { + somesass = { + suggestAllFromOpenDocument = true, + }, + }, + }, + docs = { + description = [[ + +https://github.com/wkillerud/some-sass/tree/main/packages/language-server + +`some-sass-language-server` can be installed via `npm`: + +```sh +npm i -g some-sass-language-server +``` + +The language server provides: + +- Full support for @use and @forward, including aliases, prefixes and hiding. +- Workspace-wide code navigation and refactoring, such as Rename Symbol. +- Rich documentation through SassDoc. +- Language features for %placeholder-selectors, both when using them and writing them. +- Suggestions and hover info for built-in Sass modules, when used with @use. + +]], + default_config = { + root_dir = [[root_pattern("package.json", ".git") or bufdir]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sorbet.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sorbet.lua new file mode 100644 index 0000000..86d3443 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sorbet.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'srb', 'tc', '--lsp' }, + filetypes = { 'ruby' }, + root_dir = util.root_pattern('Gemfile', '.git'), + }, + docs = { + description = [[ +https://sorbet.org + +Sorbet is a fast, powerful type checker designed for Ruby. + +You can install Sorbet via gem install. You might also be interested in how to set +Sorbet up for new projects: https://sorbet.org/docs/adopting. + +```sh +gem install sorbet +``` + ]], + default_config = { + root_dir = [[root_pattern("Gemfile", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sourcekit.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sourcekit.lua new file mode 100644 index 0000000..f5ce413 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sourcekit.lua @@ -0,0 +1,25 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'sourcekit-lsp' }, + filetypes = { 'swift', 'c', 'cpp', 'objective-c', 'objective-cpp' }, + root_dir = function(filename, _) + return util.root_pattern 'buildServer.json'(filename) + or util.root_pattern('*.xcodeproj', '*.xcworkspace')(filename) + or util.find_git_ancestor(filename) + -- better to keep it at the end, because some modularized apps contain multiple Package.swift files + or util.root_pattern('compile_commands.json', 'Package.swift')(filename) + end, + }, + docs = { + description = [[ +https://github.com/apple/sourcekit-lsp + +Language server for Swift and C/C++/Objective-C. + ]], + default_config = { + root_dir = [[root_pattern("buildServer.json", "*.xcodeproj", "*.xcworkspace", ".git", "compile_commands.json", "Package.swift")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sourcery.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sourcery.lua new file mode 100644 index 0000000..44340f1 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sourcery.lua @@ -0,0 +1,83 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'pyproject.toml', + 'setup.py', + 'setup.cfg', + 'requirements.txt', + 'Pipfile', + 'pyrightconfig.json', +} + +local token_in_auth_file = function() + local is_windows = vim.fn.has 'win32' == 1 + local path_sep = is_windows and '\\' or '/' + + local config_home = is_windows and vim.fn.getenv 'APPDATA' or vim.fn.expand '~/.config' + local auth_file_path = config_home .. path_sep .. 'sourcery' .. path_sep .. 'auth.yaml' + + if vim.fn.filereadable(auth_file_path) == 1 then + local content = vim.fn.readfile(auth_file_path) + for _, line in ipairs(content) do + if line:match 'sourcery_token: (.+)' then + return true + end + end + end + + return false +end + +return { + default_config = { + cmd = { 'sourcery', 'lsp' }, + filetypes = { 'javascript', 'javascriptreact', 'python', 'typescript', 'typescriptreact' }, + init_options = { + editor_version = 'vim', + extension_version = 'vim.lsp', + token = nil, + }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + on_new_config = function(new_config, _) + if not new_config.init_options.token and not token_in_auth_file() then + local notify = vim.notify_once or vim.notify + notify( + '[lspconfig] The authentication token must be provided in config.init_options or configured via "sourcery login"', + vim.log.levels.ERROR + ) + end + end, + docs = { + description = [[ +https://github.com/sourcery-ai/sourcery + +Refactor Python instantly using the power of AI. + +It requires the init_options param to be populated as shown below and will respond with the list of ServerCapabilities that it supports: + +```lua +require'lspconfig'.sourcery.setup { + init_options = { + --- The Sourcery token for authenticating the user. + --- This is retrieved from the Sourcery website and must be + --- provided by each user. The extension must provide a + --- configuration option for the user to provide this value. + token = <YOUR_TOKEN>, + + --- The extension's name and version as defined by the extension. + extension_version = 'vim.lsp', + + --- The editor's name and version as defined by the editor. + editor_version = 'vim', + }, +} +``` + +Alternatively, you can login to sourcery by running `sourcery login` with sourcery-cli. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/spectral.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/spectral.lua new file mode 100644 index 0000000..e21b6cb --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/spectral.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +local bin_name = 'spectral-language-server' + +return { + default_config = { + cmd = { bin_name, '--stdio' }, + filetypes = { 'yaml', 'json', 'yml' }, + root_dir = util.root_pattern('.spectral.yaml', '.spectral.yml', '.spectral.json', '.spectral.js'), + single_file_support = true, + settings = { + enable = true, + run = 'onType', + validateLanguages = { 'yaml', 'json', 'yml' }, + }, + }, + docs = { + description = [[ +https://github.com/luizcorreia/spectral-language-server + `A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v2 & v3.` + +`spectral-language-server` can be installed via `npm`: +```sh +npm i -g spectral-language-server +``` +See [vscode-spectral](https://github.com/stoplightio/vscode-spectral#extension-settings) for configuration options. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/spyglassmc_language_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/spyglassmc_language_server.lua new file mode 100644 index 0000000..54d3fad --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/spyglassmc_language_server.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'spyglassmc-language-server', '--stdio' }, + filetypes = { 'mcfunction' }, + root_dir = util.root_pattern 'pack.mcmeta', + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/SpyglassMC/Spyglass/tree/main/packages/language-server + +Language server for Minecraft datapacks. + +`spyglassmc-language-server` can be installed via `npm`: + +```sh +npm i -g @spyglassmc/language-server +``` + +You may also need to configure the filetype: + +`autocmd BufNewFile,BufRead *.mcfunction set filetype=mcfunction` + +This is automatically done by [CrystalAlpha358/vim-mcfunction](https://github.com/CrystalAlpha358/vim-mcfunction), which also provide syntax highlight. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sqlls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sqlls.lua new file mode 100644 index 0000000..434a7ce --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sqlls.lua @@ -0,0 +1,18 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'sql-language-server', 'up', '--method', 'stdio' }, + filetypes = { 'sql', 'mysql' }, + root_dir = util.root_pattern '.sqllsrc.json', + settings = {}, + }, + docs = { + description = [[ +https://github.com/joe-re/sql-language-server + +This LSP can be installed via `npm`. Find further instructions on manual installation of the sql-language-server at [joe-re/sql-language-server](https://github.com/joe-re/sql-language-server). +<br> + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sqls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sqls.lua new file mode 100644 index 0000000..66ac76c --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sqls.lua @@ -0,0 +1,25 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'sqls' }, + filetypes = { 'sql', 'mysql' }, + root_dir = util.root_pattern 'config.yml', + single_file_support = true, + settings = {}, + }, + docs = { + description = [[ +https://github.com/sqls-server/sqls + +```lua +require'lspconfig'.sqls.setup{ + cmd = {"path/to/command", "-config", "path/to/config.yml"}; + ... +} +``` +Sqls can be installed via `go get github.com/sqls-server/sqls`. Instructions for compiling Sqls from the source can be found at [sqls-server/sqls](https://github.com/sqls-server/sqls). + + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/standardrb.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/standardrb.lua new file mode 100644 index 0000000..70608bf --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/standardrb.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'standardrb', '--lsp' }, + filetypes = { 'ruby' }, + root_dir = util.root_pattern('Gemfile', '.git'), + }, + docs = { + description = [[ +https://github.com/testdouble/standard + +Ruby Style Guide, with linter & automatic code fixer. + ]], + default_config = { + root_dir = [[root_pattern("Gemfile", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/starlark_rust.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/starlark_rust.lua new file mode 100644 index 0000000..36b828f --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/starlark_rust.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig/util' + +return { + default_config = { + cmd = { 'starlark', '--lsp' }, + filetypes = { 'star', 'bzl', 'BUILD.bazel' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/facebookexperimental/starlark-rust/ +The LSP part of `starlark-rust` is not currently documented, + but the implementation works well for linting. +This gives valuable warnings for potential issues in the code, +but does not support refactorings. + +It can be installed with cargo: https://crates.io/crates/starlark +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/starpls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/starpls.lua new file mode 100644 index 0000000..2699e7e --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/starpls.lua @@ -0,0 +1,16 @@ +local util = require 'lspconfig/util' + +return { + default_config = { + cmd = { 'starpls' }, + filetypes = { 'bzl' }, + root_dir = util.root_pattern('WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel'), + }, + docs = { + description = [[ +https://github.com/withered-magic/starpls + +`starpls` is an LSP implementation for Starlark. Installation instructions can be found in the project's README. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/statix.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/statix.lua new file mode 100644 index 0000000..050c0b5 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/statix.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'statix' }, + filetypes = { 'nix' }, + single_file_support = true, + root_dir = util.root_pattern('flake.nix', '.git'), + }, + docs = { + description = [[ +https://github.com/nerdypepper/statix + +lints and suggestions for the nix programming language + ]], + default_config = { + root_dir = [[root_pattern("flake.nix", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/steep.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/steep.lua new file mode 100644 index 0000000..367c780 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/steep.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'steep', 'langserver' }, + filetypes = { 'ruby', 'eruby' }, + root_dir = util.root_pattern('Steepfile', '.git'), + }, + docs = { + description = [[ +https://github.com/soutaro/steep + +`steep` is a static type checker for Ruby. + +You need `Steepfile` to make it work. Generate it with `steep init`. +]], + default_config = { + root_dir = [[root_pattern("Steepfile", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/stimulus_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/stimulus_ls.lua new file mode 100644 index 0000000..7d11b4c --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/stimulus_ls.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'stimulus-language-server', '--stdio' }, + filetypes = { 'html', 'ruby', 'eruby', 'blade', 'php' }, + root_dir = util.root_pattern('Gemfile', '.git'), + }, + docs = { + description = [[ +https://www.npmjs.com/package/stimulus-language-server + +`stimulus-lsp` can be installed via `npm`: + +```sh +npm install -g stimulus-language-server +``` + +or via `yarn`: + +```sh +yarn global add stimulus-language-server +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/stylelint_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/stylelint_lsp.lua new file mode 100644 index 0000000..fedc1a7 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/stylelint_lsp.lua @@ -0,0 +1,57 @@ +local util = require 'lspconfig.util' + +local root_file = { + '.stylelintrc', + '.stylelintrc.cjs', + '.stylelintrc.js', + '.stylelintrc.json', + '.stylelintrc.yaml', + '.stylelintrc.yml', + 'stylelint.config.cjs', + 'stylelint.config.js', +} + +root_file = util.insert_package_json(root_file, 'stylelint') + +return { + default_config = { + cmd = { 'stylelint-lsp', '--stdio' }, + filetypes = { + 'css', + 'less', + 'scss', + 'sugarss', + 'vue', + 'wxss', + 'javascript', + 'javascriptreact', + 'typescript', + 'typescriptreact', + }, + root_dir = util.root_pattern(unpack(root_file)), + settings = {}, + }, + docs = { + description = [[ +https://github.com/bmatcuk/stylelint-lsp + +`stylelint-lsp` can be installed via `npm`: + +```sh +npm i -g stylelint-lsp +``` + +Can be configured by passing a `settings.stylelintplus` object to `stylelint_lsp.setup`: + +```lua +require'lspconfig'.stylelint_lsp.setup{ + settings = { + stylelintplus = { + -- see available options in stylelint-lsp documentation + } + } +} +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/svelte.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/svelte.lua new file mode 100644 index 0000000..a08bb95 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/svelte.lua @@ -0,0 +1,24 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'svelteserver', '--stdio' }, + filetypes = { 'svelte' }, + root_dir = util.root_pattern('package.json', '.git'), + }, + docs = { + description = [[ +https://github.com/sveltejs/language-tools/tree/master/packages/language-server + +Note: assuming that [tsserver](#tsserver) is setup, full JavaScript/TypeScript support (find references, rename, etc of symbols in Svelte files when working in JS/TS files) requires per-project installation and configuration of [typescript-svelte-plugin](https://github.com/sveltejs/language-tools/tree/master/packages/typescript-plugin#usage). + +`svelte-language-server` can be installed via `npm`: +```sh +npm install -g svelte-language-server +``` +]], + default_config = { + root_dir = [[root_pattern("package.json", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/svlangserver.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/svlangserver.lua new file mode 100644 index 0000000..bc3591a --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/svlangserver.lua @@ -0,0 +1,58 @@ +local util = require 'lspconfig.util' + +local function build_index() + local params = { + command = 'systemverilog.build_index', + } + vim.lsp.buf.execute_command(params) +end + +local function report_hierarchy() + local params = { + command = 'systemverilog.report_hierarchy', + arguments = { vim.fn.expand '<cword>' }, + } + vim.lsp.buf.execute_command(params) +end + +return { + default_config = { + cmd = { 'svlangserver' }, + filetypes = { 'verilog', 'systemverilog' }, + root_dir = function(fname) + return util.root_pattern '.svlangserver'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + settings = { + systemverilog = { + includeIndexing = { '*.{v,vh,sv,svh}', '**/*.{v,vh,sv,svh}' }, + }, + }, + }, + commands = { + SvlangserverBuildIndex = { + build_index, + description = 'Instructs language server to rerun indexing', + }, + SvlangserverReportHierarchy = { + report_hierarchy, + description = 'Generates hierarchy for the given module', + }, + }, + docs = { + description = [[ +https://github.com/imc-trading/svlangserver + +Language server for SystemVerilog. + +`svlangserver` can be installed via `npm`: + +```sh +$ npm install -g @imc-trading/svlangserver +``` +]], + default_config = { + root_dir = [[root_pattern(".svlangserver", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/svls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/svls.lua new file mode 100644 index 0000000..ff4d810 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/svls.lua @@ -0,0 +1,24 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'svls' }, + filetypes = { 'verilog', 'systemverilog' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/dalance/svls + +Language server for verilog and SystemVerilog + +`svls` can be installed via `cargo`: + ```sh + cargo install svls + ``` + ]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/swift_mesonls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/swift_mesonls.lua new file mode 100644 index 0000000..5197f73 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/swift_mesonls.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'Swift-MesonLSP', '--lsp' }, + filetypes = { 'meson' }, + root_dir = util.root_pattern('meson_options.txt', 'meson.options', '.git'), + }, + docs = { + description = [[ +https://github.com/JCWasmx86/Swift-MesonLSP + +Meson language server written in Swift +]], + default_config = { + root_dir = [[util.root_pattern("meson_options.txt", "meson.options", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/syntax_tree.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/syntax_tree.lua new file mode 100644 index 0000000..9b47ee5 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/syntax_tree.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'stree', 'lsp' }, + filetypes = { 'ruby' }, + root_dir = util.root_pattern('.streerc', 'Gemfile', '.git'), + }, + docs = { + description = [[ +https://ruby-syntax-tree.github.io/syntax_tree/ + +A fast Ruby parser and formatter. + +Syntax Tree is a suite of tools built on top of the internal CRuby parser. It +provides the ability to generate a syntax tree from source, as well as the +tools necessary to inspect and manipulate that syntax tree. It can be used to +build formatters, linters, language servers, and more. + +```sh +gem install syntax_tree +``` + ]], + default_config = { + root_dir = [[root_pattern(".streerc", "Gemfile", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tabby_ml.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tabby_ml.lua new file mode 100644 index 0000000..f56a829 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tabby_ml.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'tabby-agent', '--lsp', '--stdio' }, + filetypes = {}, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://tabby.tabbyml.com/blog/running-tabby-as-a-language-server + +Language server for Tabby, an opensource, self-hosted AI coding assistant. + +`tabby-agent` can be installed via `npm`: + +```sh +npm install --global tabby-agent +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tailwindcss.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tailwindcss.lua new file mode 100644 index 0000000..88c95ba --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tailwindcss.lua @@ -0,0 +1,132 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'tailwindcss-language-server', '--stdio' }, + -- filetypes copied and adjusted from tailwindcss-intellisense + filetypes = { + -- html + 'aspnetcorerazor', + 'astro', + 'astro-markdown', + 'blade', + 'clojure', + 'django-html', + 'htmldjango', + 'edge', + 'eelixir', -- vim ft + 'elixir', + 'ejs', + 'erb', + 'eruby', -- vim ft + 'gohtml', + 'gohtmltmpl', + 'haml', + 'handlebars', + 'hbs', + 'html', + -- 'HTML (Eex)', + -- 'HTML (EEx)', + 'html-eex', + 'heex', + 'jade', + 'leaf', + 'liquid', + 'markdown', + 'mdx', + 'mustache', + 'njk', + 'nunjucks', + 'php', + 'razor', + 'slim', + 'twig', + -- css + 'css', + 'less', + 'postcss', + 'sass', + 'scss', + 'stylus', + 'sugarss', + -- js + 'javascript', + 'javascriptreact', + 'reason', + 'rescript', + 'typescript', + 'typescriptreact', + -- mixed + 'vue', + 'svelte', + 'templ', + }, + init_options = { + userLanguages = { + eelixir = 'html-eex', + eruby = 'erb', + templ = 'html', + }, + }, + settings = { + tailwindCSS = { + validate = true, + lint = { + cssConflict = 'warning', + invalidApply = 'error', + invalidScreen = 'error', + invalidVariant = 'error', + invalidConfigPath = 'error', + invalidTailwindDirective = 'error', + recommendedVariantOrder = 'warning', + }, + classAttributes = { + 'class', + 'className', + 'class:list', + 'classList', + 'ngClass', + }, + }, + }, + on_new_config = function(new_config) + if not new_config.settings then + new_config.settings = {} + end + if not new_config.settings.editor then + new_config.settings.editor = {} + end + if not new_config.settings.editor.tabSize then + -- set tab size for hover + new_config.settings.editor.tabSize = vim.lsp.util.get_effective_tabstop() + end + end, + root_dir = function(fname) + return util.root_pattern( + 'tailwind.config.js', + 'tailwind.config.cjs', + 'tailwind.config.mjs', + 'tailwind.config.ts', + 'postcss.config.js', + 'postcss.config.cjs', + 'postcss.config.mjs', + 'postcss.config.ts' + )(fname) or util.find_package_json_ancestor(fname) or util.find_node_modules_ancestor(fname) or util.find_git_ancestor( + fname + ) + end, + }, + docs = { + description = [[ +https://github.com/tailwindlabs/tailwindcss-intellisense + +Tailwind CSS Language Server can be installed via npm: +```sh +npm install -g @tailwindcss/language-server +``` +]], + default_config = { + root_dir = [[root_pattern('tailwind.config.js', 'tailwind.config.cjs', 'tailwind.config.mjs', 'tailwind.config.ts', 'postcss.config.js', 'postcss.config.cjs', 'postcss.config.mjs', 'postcss.config.ts', 'package.json', 'node_modules', '.git')]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/taplo.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/taplo.lua new file mode 100644 index 0000000..e1a9353 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/taplo.lua @@ -0,0 +1,27 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'taplo', 'lsp', 'stdio' }, + filetypes = { 'toml' }, + root_dir = function(fname) + return util.root_pattern '*.toml'(fname) or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://taplo.tamasfe.dev/cli/usage/language-server.html + +Language server for Taplo, a TOML toolkit. + +`taplo-cli` can be installed via `cargo`: +```sh +cargo install --features lsp --locked taplo-cli +``` + ]], + default_config = { + root_dir = [[root_pattern("*.toml", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tblgen_lsp_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tblgen_lsp_server.lua new file mode 100644 index 0000000..73022d4 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tblgen_lsp_server.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'tblgen-lsp-server' }, + filetypes = { 'tablegen' }, + root_dir = function(fname) + return util.root_pattern 'tablegen_compile_commands.yml'(fname) or util.find_git_ancestor(fname) + end, + }, + docs = { + description = [[ +https://mlir.llvm.org/docs/Tools/MLIRLSP/#tablegen-lsp-language-server--tblgen-lsp-server + +The Language Server for the LLVM TableGen language + +`tblgen-lsp-server` can be installed at the llvm-project repository (https://github.com/llvm/llvm-project) +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/teal_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/teal_ls.lua new file mode 100644 index 0000000..b554add --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/teal_ls.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { + 'teal-language-server', + -- use this to enable logging in /tmp/teal-language-server.log + -- "logging=on", + }, + filetypes = { + 'teal', + -- "lua", -- Also works for lua, but you may get type errors that cannot be resolved within lua itself + }, + root_dir = util.root_pattern('tlconfig.lua', '.git'), + }, + docs = { + description = [[ +https://github.com/teal-language/teal-language-server + +Install with: +``` +luarocks install --dev teal-language-server +``` +]], + default_config = { + root_dir = [[root_pattern("tlconfig.lua", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/templ.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/templ.lua new file mode 100644 index 0000000..99a4ada --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/templ.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'templ', 'lsp' }, + filetypes = { 'templ' }, + root_dir = function(fname) + return util.root_pattern('go.work', 'go.mod', '.git')(fname) + end, + }, + docs = { + description = [[ +https://templ.guide + +The official language server for the templ HTML templating language. +]], + default_config = { + root_dir = [[root_pattern('go.work', 'go.mod', '.git')]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/terraform_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/terraform_lsp.lua new file mode 100644 index 0000000..48a6fc5 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/terraform_lsp.lua @@ -0,0 +1,43 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'terraform-lsp' }, + filetypes = { 'terraform', 'hcl' }, + root_dir = util.root_pattern('.terraform', '.git'), + }, + docs = { + description = [[ +https://github.com/juliosueiras/terraform-lsp + +Terraform language server +Download a released binary from +https://github.com/juliosueiras/terraform-lsp/releases. + +From https://github.com/hashicorp/terraform-ls#terraform-ls-vs-terraform-lsp: + +Both HashiCorp and the maintainer of terraform-lsp expressed interest in +collaborating on a language server and are working towards a _long-term_ +goal of a single stable and feature-complete implementation. + +For the time being both projects continue to exist, giving users the +choice: + +- `terraform-ls` providing + - overall stability (by relying only on public APIs) + - compatibility with any provider and any Terraform >=0.12.0 currently + less features + - due to project being younger and relying on public APIs which may + not offer the same functionality yet + +- `terraform-lsp` providing + - currently more features + - compatibility with a single particular Terraform (0.12.20 at time of writing) + - configs designed for other 0.12 versions may work, but interpretation may be inaccurate + - less stability (due to reliance on Terraform's own internal packages) +]], + default_config = { + root_dir = [[root_pattern(".terraform", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/terraformls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/terraformls.lua new file mode 100644 index 0000000..9326b9b --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/terraformls.lua @@ -0,0 +1,47 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'terraform-ls', 'serve' }, + filetypes = { 'terraform', 'terraform-vars' }, + root_dir = util.root_pattern('.terraform', '.git'), + }, + docs = { + description = [[ +https://github.com/hashicorp/terraform-ls + +Terraform language server +Download a released binary from https://github.com/hashicorp/terraform-ls/releases. + +From https://github.com/hashicorp/terraform-ls#terraform-ls-vs-terraform-lsp: + +Both HashiCorp and the maintainer of terraform-lsp expressed interest in +collaborating on a language server and are working towards a _long-term_ +goal of a single stable and feature-complete implementation. + +For the time being both projects continue to exist, giving users the +choice: + +- `terraform-ls` providing + - overall stability (by relying only on public APIs) + - compatibility with any provider and any Terraform >=0.12.0 currently + less features + - due to project being younger and relying on public APIs which may + not offer the same functionality yet + +- `terraform-lsp` providing + - currently more features + - compatibility with a single particular Terraform (0.12.20 at time of writing) + - configs designed for other 0.12 versions may work, but interpretation may be inaccurate + - less stability (due to reliance on Terraform's own internal packages) + +Note, that the `settings` configuration option uses the `workspace/didChangeConfiguration` event, +[which is not supported by terraform-ls](https://github.com/hashicorp/terraform-ls/blob/main/docs/features.md). +Instead you should use `init_options` which passes the settings as part of the LSP initialize call +[as is required by terraform-ls](https://github.com/hashicorp/terraform-ls/blob/main/docs/SETTINGS.md#how-to-pass-settings). +]], + default_config = { + root_dir = [[root_pattern(".terraform", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/texlab.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/texlab.lua new file mode 100644 index 0000000..36198d0 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/texlab.lua @@ -0,0 +1,127 @@ +local util = require 'lspconfig.util' + +local texlab_build_status = { + [0] = 'Success', + [1] = 'Error', + [2] = 'Failure', + [3] = 'Cancelled', +} + +local texlab_forward_status = { + [0] = 'Success', + [1] = 'Error', + [2] = 'Failure', + [3] = 'Unconfigured', +} + +local function buf_build(bufnr) + bufnr = util.validate_bufnr(bufnr) + local texlab_client = util.get_active_client_by_name(bufnr, 'texlab') + local pos = vim.api.nvim_win_get_cursor(0) + local params = { + textDocument = { uri = vim.uri_from_bufnr(bufnr) }, + position = { line = pos[1] - 1, character = pos[2] }, + } + if texlab_client then + texlab_client.request('textDocument/build', params, function(err, result) + if err then + error(tostring(err)) + end + print('Build ' .. texlab_build_status[result.status]) + end, bufnr) + else + print 'method textDocument/build is not supported by any servers active on the current buffer' + end +end + +local function buf_search(bufnr) + bufnr = util.validate_bufnr(bufnr) + local texlab_client = util.get_active_client_by_name(bufnr, 'texlab') + local pos = vim.api.nvim_win_get_cursor(0) + local params = { + textDocument = { uri = vim.uri_from_bufnr(bufnr) }, + position = { line = pos[1] - 1, character = pos[2] }, + } + if texlab_client then + texlab_client.request('textDocument/forwardSearch', params, function(err, result) + if err then + error(tostring(err)) + end + print('Search ' .. texlab_forward_status[result.status]) + end, bufnr) + else + print 'method textDocument/forwardSearch is not supported by any servers active on the current buffer' + end +end + +-- bufnr isn't actually required here, but we need a valid buffer in order to +-- be able to find the client for buf_request. +-- TODO find a client by looking through buffers for a valid client? +-- local function build_cancel_all(bufnr) +-- bufnr = util.validate_bufnr(bufnr) +-- local params = { token = "texlab-build-*" } +-- lsp.buf_request(bufnr, 'window/progress/cancel', params, function(err, method, result, client_id) +-- if err then error(tostring(err)) end +-- print("Cancel result", vim.inspect(result)) +-- end) +-- end + +return { + default_config = { + cmd = { 'texlab' }, + filetypes = { 'tex', 'plaintex', 'bib' }, + root_dir = util.root_pattern('.git', '.latexmkrc', '.texlabroot', 'texlabroot', 'Tectonic.toml'), + single_file_support = true, + settings = { + texlab = { + rootDirectory = nil, + build = { + executable = 'latexmk', + args = { '-pdf', '-interaction=nonstopmode', '-synctex=1', '%f' }, + onSave = false, + forwardSearchAfter = false, + }, + auxDirectory = '.', + forwardSearch = { + executable = nil, + args = {}, + }, + chktex = { + onOpenAndSave = false, + onEdit = false, + }, + diagnosticsDelay = 300, + latexFormatter = 'latexindent', + latexindent = { + ['local'] = nil, -- local is a reserved keyword + modifyLineBreaks = false, + }, + bibtexFormatter = 'texlab', + formatterLineLength = 80, + }, + }, + }, + commands = { + TexlabBuild = { + function() + buf_build(0) + end, + description = 'Build the current buffer', + }, + TexlabForward = { + function() + buf_search(0) + end, + description = 'Forward search from current position', + }, + }, + docs = { + description = [[ +https://github.com/latex-lsp/texlab + +A completion engine built from scratch for (La)TeX. + +See https://github.com/latex-lsp/texlab/wiki/Configuration for configuration options. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/textlsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/textlsp.lua new file mode 100644 index 0000000..e4f7a91 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/textlsp.lua @@ -0,0 +1,50 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'textlsp' }, + filetypes = { 'text', 'tex', 'org' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + settings = { + textLSP = { + analysers = { + -- by default all analysers are disabled in textLSP, since many of them + -- need custom settings. See github page. LanguageTool is enaled here + -- only for a quick test. + languagetool = { + enabled = true, + check_text = { + on_open = true, + on_save = true, + on_change = false, + }, + }, + }, + documents = { + org = { + org_todo_keywords = { + 'TODO', + 'IN_PROGRESS', + 'DONE', + }, + }, + }, + }, + }, + }, + docs = { + description = [[ +https://github.com/hangyav/textLSP + +`textLSP` is an LSP server for text spell and grammar checking with various AI tools. +It supports multiple text file formats, such as LaTeX, Org or txt. + +For the available text analyzer tools and their configuration, see the [GitHub](https://github.com/hangyav/textLSP) page. +By default, all analyzers are disabled in textLSP, since most of them need special settings. +For quick testing, LanguageTool is enabled in the default `nvim-lspconfig` configuration. + +To install run: `pip install textLSP` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tflint.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tflint.lua new file mode 100644 index 0000000..de2a1d8 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tflint.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'tflint', '--langserver' }, + filetypes = { 'terraform' }, + root_dir = util.root_pattern('.terraform', '.git', '.tflint.hcl'), + }, + docs = { + description = [[ +https://github.com/terraform-linters/tflint + +A pluggable Terraform linter that can act as lsp server. +Installation instructions can be found in https://github.com/terraform-linters/tflint#installation. +]], + default_config = { + root_dir = [[root_pattern(".terraform", ".git", ".tflint.hcl")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/theme_check.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/theme_check.lua new file mode 100644 index 0000000..94d6774 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/theme_check.lua @@ -0,0 +1,31 @@ +local util = require 'lspconfig.util' + +local bin_name = 'theme-check-language-server' + +return { + default_config = { + cmd = { bin_name, '--stdio' }, + filetypes = { 'liquid' }, + root_dir = util.root_pattern '.theme-check.yml', + settings = {}, + }, + docs = { + description = [[ +https://github.com/Shopify/shopify-cli + +`theme-check-language-server` is bundled with `shopify-cli` or it can also be installed via + +https://github.com/Shopify/theme-check#installation + +**NOTE:** +If installed via Homebrew, `cmd` must be set to 'theme-check-liquid-server' + +```lua +require lspconfig.theme_check.setup { + cmd = { 'theme-check-liquid-server' } +} +``` + +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/thriftls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/thriftls.lua new file mode 100644 index 0000000..eaf807a --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/thriftls.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'thriftls' }, + filetypes = { 'thrift' }, + root_dir = util.root_pattern '.thrift', + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/joyme123/thrift-ls + +you can install thriftls by mason or download binary here: https://github.com/joyme123/thrift-ls/releases +]], + default_config = { + root_dir = [[root_pattern(".thrift")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tilt_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tilt_ls.lua new file mode 100644 index 0000000..c665651 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tilt_ls.lua @@ -0,0 +1,26 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'tilt', 'lsp', 'start' }, + filetypes = { 'tiltfile' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/tilt-dev/tilt + +Tilt language server. + +You might need to add filetype detection manually: + +```vim +autocmd BufRead Tiltfile setf=tiltfile +``` +]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tinymist.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tinymist.lua new file mode 100644 index 0000000..c255972 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tinymist.lua @@ -0,0 +1,16 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'tinymist' }, + filetypes = { 'typst' }, + root_dir = util.find_git_ancestor, + single_file_support = false, + }, + docs = { + description = [[ +https://github.com/Myriad-Dreamin/tinymist +An integrated language service for Typst [taɪpst]. You can also call it "微霭" [wēi ǎi] in Chinese. + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tsp_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tsp_server.lua new file mode 100644 index 0000000..3cb7e42 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tsp_server.lua @@ -0,0 +1,24 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'tsp-server', '--stdio' }, + filetypes = { 'typespec' }, + root_dir = util.root_pattern('tspconfig.yaml', '.git'), + }, + docs = { + description = [[ +https://github.com/microsoft/typespec + +The language server for TypeSpec, a language for defining cloud service APIs and shapes. + +`tsp-server` can be installed together with the typespec compiler via `npm`: +```sh +npm install -g @typespec/compiler +``` +]], + default_config = { + root_dir = [[util.root_pattern("tspconfig.yaml", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tsserver.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tsserver.lua new file mode 100644 index 0000000..b5fa5a4 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/tsserver.lua @@ -0,0 +1,88 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + init_options = { hostInfo = 'neovim' }, + cmd = { 'typescript-language-server', '--stdio' }, + filetypes = { + 'javascript', + 'javascriptreact', + 'javascript.jsx', + 'typescript', + 'typescriptreact', + 'typescript.tsx', + }, + root_dir = util.root_pattern('tsconfig.json', 'package.json', 'jsconfig.json', '.git'), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/typescript-language-server/typescript-language-server + +`typescript-language-server` depends on `typescript`. Both packages can be installed via `npm`: +```sh +npm install -g typescript typescript-language-server +``` + +To configure typescript language server, add a +[`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or +[`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to the root of your +project. + +Here's an example that disables type checking in JavaScript files. + +```json +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "checkJs": false + }, + "exclude": [ + "node_modules" + ] +} +``` + +### Vue support + +As of 2.0.0, Volar no longer supports TypeScript itself. Instead, a plugin +adds Vue support to this language server. + +*IMPORTANT*: It is crucial to ensure that `@vue/typescript-plugin` and `volar `are of identical versions. + +```lua +require'lspconfig'.tsserver.setup{ + init_options = { + plugins = { + { + name = "@vue/typescript-plugin", + location = "/usr/local/lib/node_modules/@vue/typescript-plugin", + languages = {"javascript", "typescript", "vue"}, + }, + }, + }, + filetypes = { + "javascript", + "typescript", + "vue", + }, +} + +-- You must make sure volar is setup +-- e.g. require'lspconfig'.volar.setup{} +-- See volar's section for more information +``` + +`location` MUST be defined. If the plugin is installed in `node_modules`, +`location` can have any value. + +`languages` must include `vue` even if it is listed in `filetypes`. + +`filetypes` is extended here to include Vue SFC. +]], + default_config = { + root_dir = [[root_pattern("tsconfig.json", "package.json", "jsconfig.json", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ttags.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ttags.lua new file mode 100644 index 0000000..d57a796 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/ttags.lua @@ -0,0 +1,17 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'ttags', 'lsp' }, + filetypes = { 'ruby', 'rust', 'javascript', 'haskell' }, + root_dir = util.root_pattern '.git', + }, + docs = { + description = [[ +https://github.com/npezza93/ttags + ]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/turtle_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/turtle_ls.lua new file mode 100644 index 0000000..21624a8 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/turtle_ls.lua @@ -0,0 +1,45 @@ +local util = require 'lspconfig.util' + +local bin_name = 'turtle-language-server' +local bin_path = os.getenv 'NVM_BIN' +local full_path +if bin_path == nil then + local paths = {} + local sep = ':' + if vim.fn.has 'win32' == 1 then + sep = ';' + end + local path = os.getenv 'PATH' + if path ~= nil then + for str in string.gmatch(path, '([^' .. sep .. ']+)') do + paths[#paths + 1] = str + end + end + for _, p in ipairs(paths) do + local candidate = util.path.join(p, bin_name) + if util.path.is_file(candidate) then + full_path = candidate + break + end + end +else + full_path = util.path.join(bin_path, bin_name) +end + +return { + default_config = { + cmd = { 'node', full_path, '--stdio' }, + filetypes = { 'turtle', 'ttl' }, + root_dir = function(fname) + return util.find_git_ancestor(fname) + end, + }, + docs = { + description = [[ +https://github.com/stardog-union/stardog-language-servers/tree/master/packages/turtle-language-server +`turtle-language-server`, An editor-agnostic server providing language intelligence (diagnostics, hover tooltips, etc.) for the W3C standard Turtle RDF syntax via the Language Server Protocol. +installable via npm install -g turtle-language-server or yarn global add turtle-language-server. +requires node. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/twiggy_language_server.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/twiggy_language_server.lua new file mode 100644 index 0000000..3c949dd --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/twiggy_language_server.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'twiggy-language-server', '--stdio' }, + filetypes = { 'twig' }, + root_dir = util.root_pattern('composer.json', '.git'), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/moetelo/twiggy + +`twiggy-language-server` can be installed via `npm`: +```sh +npm install -g twiggy-language-server +``` +]], + default_config = { + root_dir = [[root_pattern("composer.json", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/typeprof.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/typeprof.lua new file mode 100644 index 0000000..ab9dc8e --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/typeprof.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'typeprof', '--lsp', '--stdio' }, + filetypes = { 'ruby', 'eruby' }, + root_dir = util.root_pattern('Gemfile', '.git'), + }, + docs = { + description = [[ +https://github.com/ruby/typeprof + +`typeprof` is the built-in analysis and LSP tool for Ruby 3.1+. + ]], + default_config = { + root_dir = [[root_pattern("Gemfile", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/typos_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/typos_lsp.lua new file mode 100644 index 0000000..e5cca49 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/typos_lsp.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'typos-lsp' }, + filetypes = { '*' }, + root_dir = util.root_pattern('typos.toml', '_typos.toml', '.typos.toml'), + single_file_support = true, + settings = {}, + }, + docs = { + description = [[ +https://github.com/crate-ci/typos +https://github.com/tekumara/typos-lsp + +A Language Server Protocol implementation for Typos, a low false-positive +source code spell checker, written in Rust. Download it from the releases page +on GitHub: https://github.com/tekumara/typos-lsp/releases + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/typst_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/typst_lsp.lua new file mode 100644 index 0000000..4d8ec17 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/typst_lsp.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'typst-lsp' }, + filetypes = { 'typst' }, + single_file_support = true, + root_dir = function(fname) + return util.find_git_ancestor(fname) + end, + }, + docs = { + description = [[ +https://github.com/nvarner/typst-lsp + +Language server for Typst. + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/uiua.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/uiua.lua new file mode 100644 index 0000000..b102f8c --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/uiua.lua @@ -0,0 +1,31 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'uiua', 'lsp' }, + filetypes = { 'uiua' }, + root_dir = function(fname) + return util.root_pattern('main.ua', '.fmt.ua')(fname) or util.find_git_ancestor(fname) + end, + }, + docs = { + description = [[ +https://github.com/uiua-lang/uiua/ + +The builtin language server of the Uiua interpreter. + +The Uiua interpreter can be installed with `cargo install uiua` +]], + default_config = { + cmd = { 'uiua', 'lsp' }, + filetypes = { 'uiua' }, + root_dir = [[ + root_pattern( + 'main.ua', + 'fmt.ua', + '.git' + ) + ]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/unison.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/unison.lua new file mode 100644 index 0000000..7cc655f --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/unison.lua @@ -0,0 +1,17 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'nc', 'localhost', os.getenv 'UNISON_LSP_PORT' or '5757' }, + filetypes = { 'unison' }, + root_dir = util.root_pattern '*.u', + settings = {}, + }, + docs = { + description = [[ +https://github.com/unisonweb/unison/blob/trunk/docs/language-server.markdown + + + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/unocss.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/unocss.lua new file mode 100644 index 0000000..4b15513 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/unocss.lua @@ -0,0 +1,31 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'unocss-language-server', '--stdio' }, + filetypes = { + 'html', + 'javascriptreact', + 'rescript', + 'typescriptreact', + 'vue', + 'svelte', + }, + root_dir = function(fname) + return util.root_pattern('unocss.config.js', 'unocss.config.ts', 'uno.config.js', 'uno.config.ts')(fname) + end, + }, + docs = { + description = [[ +https://github.com/xna00/unocss-language-server + +UnoCSS Language Server can be installed via npm: +```sh +npm i unocss-language-server -g +``` +]], + default_config = { + root_dir = [[root_pattern('unocss.config.js', 'unocss.config.ts', 'uno.config.js', 'uno.config.ts')]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/uvls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/uvls.lua new file mode 100644 index 0000000..c8d75b1 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/uvls.lua @@ -0,0 +1,29 @@ +local util = require 'lspconfig.util' +return { + default_config = { + cmd = { 'uvls' }, + filetypes = { 'uvl' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://codeberg.org/caradhras/uvls +Language server for UVL, written using tree sitter and rust. +You can install the server easily using cargo: +```sh +git clone https://codeberg.org/caradhras/uvls +cd uvls +cargo install --path . +``` +Note: To activate properly nvim needs to know the uvl filetype. +You can add it via: +```lua +vim.cmd(\[\[au BufRead,BufNewFile *.uvl setfiletype uvl\]\]) +``` +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/v_analyzer.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/v_analyzer.lua new file mode 100644 index 0000000..d389259 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/v_analyzer.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'v-analyzer' }, + filetypes = { 'v', 'vsh', 'vv' }, + root_dir = util.root_pattern('v.mod', '.git'), + }, + docs = { + description = [[ +https://github.com/v-analyzer/v-analyzer + +V language server. + +`v-analyzer` can be installed by following the instructions [here](https://github.com/v-analyzer/v-analyzer#installation). +]], + default_config = { + root_dir = [[root_pattern("v.mod", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vacuum.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vacuum.lua new file mode 100644 index 0000000..d0a6afc --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vacuum.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'vacuum', 'language-server' }, + filetypes = { 'yaml.openapi', 'json.openapi' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +Vacuum is the worlds fastest OpenAPI 3, OpenAPI 2 / Swagger linter and quality analysis tool. + +You can install vacuum using mason or follow the instructions here: https://github.com/daveshanley/vacuum + +The file types are not detected automatically, you can register them manually (see below) or override the filetypes: + +```lua +vim.filetype.add { + pattern = { + ['openapi.*%.ya?ml'] = 'yaml.openapi', + ['openapi.*%.json'] = 'json.openapi', + }, +} +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vala_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vala_ls.lua new file mode 100644 index 0000000..842c561 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vala_ls.lua @@ -0,0 +1,40 @@ +local util = require 'lspconfig.util' + +local meson_matcher = function(path) + local pattern = 'meson.build' + local f = vim.fn.glob(util.path.join(path, pattern)) + if f == '' then + return nil + end + for line in io.lines(f) do + -- skip meson comments + if not line:match '^%s*#.*' then + local str = line:gsub('%s+', '') + if str ~= '' then + if str:match '^project%(' then + return path + else + break + end + end + end + end +end + +return { + default_config = { + cmd = { 'vala-language-server' }, + filetypes = { 'vala', 'genie' }, + root_dir = function(fname) + local root = util.search_ancestors(fname, meson_matcher) + return root or util.find_git_ancestor(fname) + end, + single_file_support = true, + }, + docs = { + description = 'https://github.com/Prince781/vala-language-server', + default_config = { + root_dir = [[root_pattern("meson.build", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vale_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vale_ls.lua new file mode 100644 index 0000000..615b18b --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vale_ls.lua @@ -0,0 +1,17 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'vale-ls' }, + filetypes = { 'markdown', 'text', 'tex' }, + root_dir = util.root_pattern '.vale.ini', + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/errata-ai/vale-ls + +An implementation of the Language Server Protocol (LSP) for the Vale command-line tool. +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vdmj.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vdmj.lua new file mode 100644 index 0000000..865e263 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vdmj.lua @@ -0,0 +1,134 @@ +local util = require 'lspconfig.util' + +local function get_default_mavenrepo() + local repo = util.path.join(vim.env.HOME, '.m2', 'repository', 'dk', 'au', 'ece', 'vdmj') + if util.path.exists(repo) then + return repo + else + return util.path.join(vim.env.HOME, '.m2', 'repository', 'com', 'fujitsu') + end +end + +local function get_jar_path(config, package, version) + return util.path.join(config.options.mavenrepo, package, version, package .. '-' .. version .. '.jar') +end + +local function with_precision(version, is_high_precision) + return is_high_precision and version:gsub('([%d.]+)', '%1-P') or version +end + +local function get_latest_installed_version(repo) + local path = util.path.join(repo, 'lsp') + local sort = vim.fn.sort + + local subdirs = function(file) + local stat = vim.loop.fs_stat(util.path.join(path, file)) + return stat.type == 'directory' and 1 or 0 + end + + local candidates = vim.fn.readdir(path, subdirs) + local sorted = sort(sort(candidates, 'l'), 'N') + return sorted[#sorted] +end + +-- Special case, as vdmj store particular settings under root_dir/.vscode +local function find_vscode_ancestor(startpath) + return util.search_ancestors(startpath, function(path) + if util.path.is_dir(util.path.join(path, '.vscode')) then + return path + end + end) +end + +return { + default_config = { + cmd = { 'java' }, + filetypes = { 'vdmsl', 'vdmpp', 'vdmrt' }, + root_dir = function(fname) + return util.find_git_ancestor(fname) or find_vscode_ancestor(fname) + end, + options = { + java = vim.env.JAVA_HOME and util.path.join(vim.env.JAVA_HOME, 'bin', 'java') or 'java', + java_opts = { '-Xmx3000m', '-Xss1m' }, + annotation_paths = {}, + mavenrepo = get_default_mavenrepo(), + logfile = util.path.join(vim.fn.stdpath 'cache', 'vdm-lsp.log'), + debugger_port = -1, + high_precision = false, + }, + }, + docs = { + description = [[ +https://github.com/nickbattle/vdmj + +The VDMJ language server can be installed by cloning the VDMJ repository and +running `mvn clean install`. + +Various options are provided to configure the language server (see below). In +particular: +- `annotation_paths` is a list of folders and/or jar file paths for annotations +that should be used with the language server; +- any value of `debugger_port` less than zero will disable the debugger; note +that if a non-zero value is used, only one instance of the server can be active +at a time. + +More settings for VDMJ can be changed in a file called `vdmj.properties` under +`root_dir/.vscode`. For a description of the available settings, see +[Section 7 of the VDMJ User Guide](https://raw.githubusercontent.com/nickbattle/vdmj/master/vdmj/documentation/UserGuide.pdf). + +Note: proof obligations and combinatorial testing are not currently supported +by neovim. +]], + default_config = { + cmd = 'Generated from the options given', + root_dir = 'util.find_git_ancestor(fname) or find_vscode_ancestor(fname)', + options = { + java = '$JAVA_HOME/bin/java', + java_opts = { '-Xmx3000m', '-Xss1m' }, + annotation_paths = {}, + mavenrepo = '$HOME/.m2/repository/dk/au/ece/vdmj', + version = 'The latest version installed in `mavenrepo`', + logfile = "path.join(vim.fn.stdpath 'cache', 'vdm-lsp.log')", + debugger_port = -1, + high_precision = false, + }, + }, + }, + on_new_config = function(config, root_dir) + local version = with_precision( + config.options.version or get_latest_installed_version(config.options.mavenrepo), + config.options.high_precision + ) + + local classpath = table.concat({ + get_jar_path(config, 'vdmj', version), + get_jar_path(config, 'annotations', version), + get_jar_path(config, 'lsp', version), + util.path.join(root_dir, '.vscode'), + unpack(config.options.annotation_paths), + }, ':') + + local java_cmd = { + config.options.java, + config.options.java_opts, + '-Dlsp.log.filename=' .. config.options.logfile, + '-cp', + classpath, + } + + local dap = {} + + if config.options.debugger_port >= 0 then + -- TODO: LS will fail to start if port is already in use + dap = { '-dap', tostring(config.options.debugger_port) } + end + + local vdmj_cmd = { + 'lsp.LSPServerStdio', + '-' .. vim.bo.filetype, + dap, + } + + config.cmd = util.tbl_flatten { java_cmd, vdmj_cmd } + end, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/verible.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/verible.lua new file mode 100644 index 0000000..3c4823a --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/verible.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'verible-verilog-ls' }, + filetypes = { 'systemverilog', 'verilog' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/chipsalliance/verible + +A linter and formatter for verilog and SystemVerilog files. + +Release binaries can be downloaded from [here](https://github.com/chipsalliance/verible/releases) +and placed in a directory on PATH. + +See https://github.com/chipsalliance/verible/tree/master/verilog/tools/ls/README.md for options. + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/veridian.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/veridian.lua new file mode 100644 index 0000000..231d0c0 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/veridian.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'veridian' }, + filetypes = { 'systemverilog', 'verilog' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/vivekmalneedi/veridian + +A SystemVerilog LanguageServer. + +Download the latest release for your OS from the releases page + +# install with slang feature, if C++17 compiler is available +cargo install --git https://github.com/vivekmalneedi/veridian.git --all-features +# install if C++17 compiler is not available +cargo install --git https://github.com/vivekmalneedi/veridian.git + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/veryl_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/veryl_ls.lua new file mode 100644 index 0000000..588e36e --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/veryl_ls.lua @@ -0,0 +1,24 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'veryl-ls' }, + filetypes = { 'veryl' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/veryl-lang/veryl + +Language server for Veryl + +`veryl-ls` can be installed via `cargo`: + ```sh + cargo install veryl-ls + ``` + ]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vhdl_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vhdl_ls.lua new file mode 100644 index 0000000..46db3c8 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vhdl_ls.lua @@ -0,0 +1,45 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'vhdl_ls.toml', + '.vhdl_ls.toml', +} + +return { + default_config = { + cmd = { 'vhdl_ls' }, + filetypes = { 'vhd', 'vhdl' }, + root_dir = util.root_pattern(unpack(root_files)), + single_file_support = true, + }, + docs = { + description = [[ +Install vhdl_ls from https://github.com/VHDL-LS/rust_hdl and add it to path + +Configuration + +The language server needs to know your library mapping to perform full analysis of the code. For this it uses a configuration file in the TOML format named vhdl_ls.toml. + +vhdl_ls will load configuration files in the following order of priority (first to last): + + A file named .vhdl_ls.toml in the user home folder. + A file name from the VHDL_LS_CONFIG environment variable. + A file named vhdl_ls.toml in the workspace root. + +Settings in a later files overwrites those from previously loaded files. + +Example vhdl_ls.toml +``` +# File names are either absolute or relative to the parent folder of the vhdl_ls.toml file +[libraries] +lib2.files = [ + 'pkg2.vhd', +] +lib1.files = [ + 'pkg1.vhd', + 'tb_ent.vhd' +] +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vimls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vimls.lua new file mode 100644 index 0000000..bcee4cc --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vimls.lua @@ -0,0 +1,34 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'vim-language-server', '--stdio' }, + filetypes = { 'vim' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + init_options = { + isNeovim = true, + iskeyword = '@,48-57,_,192-255,-#', + vimruntime = '', + runtimepath = '', + diagnostic = { enable = true }, + indexes = { + runtimepath = true, + gap = 100, + count = 3, + projectRootPatterns = { 'runtime', 'nvim', '.git', 'autoload', 'plugin' }, + }, + suggest = { fromVimruntime = true, fromRuntimepath = true }, + }, + }, + docs = { + description = [[ +https://github.com/iamcco/vim-language-server + +You can install vim-language-server via npm: +```sh +npm install -g vim-language-server +``` +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/visualforce_ls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/visualforce_ls.lua new file mode 100644 index 0000000..c48bcaa --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/visualforce_ls.lua @@ -0,0 +1,38 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + filetypes = { 'visualforce' }, + root_dir = util.root_pattern 'sfdx-project.json', + init_options = { + embeddedLanguages = { + css = true, + javascript = true, + }, + }, + }, + docs = { + description = [[ +https://github.com/forcedotcom/salesforcedx-vscode + +Language server for Visualforce. + +For manual installation, download the .vsix archive file from the +[forcedotcom/salesforcedx-vscode](https://github.com/forcedotcom/salesforcedx-vscode) +GitHub releases. Then, configure `cmd` to run the Node script at the unpacked location: + +```lua +require'lspconfig'.visualforce_ls.setup { + cmd = { + 'node', + '/path/to/unpacked/archive/extension/node_modules/@salesforce/salesforcedx-visualforce-language-server/out/src/visualforceServer.js', + '--stdio' + } +} +``` +]], + default_config = { + root_dir = [[root_pattern('sfdx-project.json')]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vls.lua new file mode 100644 index 0000000..a6a5ac4 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vls.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'v', 'ls' }, + filetypes = { 'v', 'vlang' }, + root_dir = util.root_pattern('v.mod', '.git'), + }, + docs = { + description = [[ +https://github.com/vlang/vls + +V language server. + +`v-language-server` can be installed by following the instructions [here](https://github.com/vlang/vls#installation). +]], + default_config = { + root_dir = [[root_pattern("v.mod", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/volar.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/volar.lua new file mode 100644 index 0000000..4875b1f --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/volar.lua @@ -0,0 +1,113 @@ +local util = require 'lspconfig.util' + +local function get_typescript_server_path(root_dir) + local project_root = util.find_node_modules_ancestor(root_dir) + return project_root and (util.path.join(project_root, 'node_modules', 'typescript', 'lib')) or '' +end + +-- https://github.com/johnsoncodehk/volar/blob/20d713b/packages/shared/src/types.ts +local volar_init_options = { + typescript = { + tsdk = '', + }, +} + +return { + default_config = { + cmd = { 'vue-language-server', '--stdio' }, + filetypes = { 'vue' }, + root_dir = util.root_pattern 'package.json', + init_options = volar_init_options, + on_new_config = function(new_config, new_root_dir) + if + new_config.init_options + and new_config.init_options.typescript + and new_config.init_options.typescript.tsdk == '' + then + new_config.init_options.typescript.tsdk = get_typescript_server_path(new_root_dir) + end + end, + }, + docs = { + description = [[ +https://github.com/johnsoncodehk/volar/tree/20d713b/packages/vue-language-server + +Volar language server for Vue + +Volar can be installed via npm: + +```sh +npm install -g @vue/language-server +``` + +Volar by default supports Vue 3 projects. Vue 2 projects need +[additional configuration](https://github.com/vuejs/language-tools/tree/master/packages/vscode-vue#usage). + +**TypeScript support** +As of release 2.0.0, Volar no longer wraps around tsserver. For typescript +support, `tsserver` needs to be configured with the `@vue/typescript-plugin` +plugin. + +**Take Over Mode** + +Volar (prior to 2.0.0), can serve as a language server for both Vue and TypeScript via [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471). + +To enable Take Over Mode, override the default filetypes in `setup{}` as follows: + +```lua +require'lspconfig'.volar.setup{ + filetypes = {'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue', 'json'} +} +``` + +**Overriding the default TypeScript Server used by Volar** + +The default config looks for TS in the local `node_modules`. This can lead to issues +e.g. when working on a [monorepo](https://monorepo.tools/). The alternatives are: + +- use a global TypeScript Server installation + +```lua +require'lspconfig'.volar.setup{ + init_options = { + typescript = { + tsdk = '/path/to/.npm/lib/node_modules/typescript/lib' + -- Alternative location if installed as root: + -- tsdk = '/usr/local/lib/node_modules/typescript/lib' + } + } +} +``` + +- use a local server and fall back to a global TypeScript Server installation + +```lua +local util = require 'lspconfig.util' +local function get_typescript_server_path(root_dir) + + local global_ts = '/home/[yourusernamehere]/.npm/lib/node_modules/typescript/lib' + -- Alternative location if installed as root: + -- local global_ts = '/usr/local/lib/node_modules/typescript/lib' + local found_ts = '' + local function check_dir(path) + found_ts = util.path.join(path, 'node_modules', 'typescript', 'lib') + if util.path.exists(found_ts) then + return path + end + end + if util.search_ancestors(root_dir, check_dir) then + return found_ts + else + return global_ts + end +end + +require'lspconfig'.volar.setup{ + on_new_config = function(new_config, new_root_dir) + new_config.init_options.typescript.tsdk = get_typescript_server_path(new_root_dir) + end, +} +``` + ]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vtsls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vtsls.lua new file mode 100644 index 0000000..050052f --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vtsls.lua @@ -0,0 +1,35 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'vtsls', '--stdio' }, + filetypes = { + 'javascript', + 'javascriptreact', + 'javascript.jsx', + 'typescript', + 'typescriptreact', + 'typescript.tsx', + }, + root_dir = util.root_pattern('tsconfig.json', 'package.json', 'jsconfig.json', '.git'), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/yioneko/vtsls + +`vtsls` can be installed with npm: +```sh +npm install -g @vtsls/language-server +``` + +To configure a TypeScript project, add a +[`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) +or [`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to +the root of your project. +]], + default_config = { + root_dir = [[root_pattern("tsconfig.json", "package.json", "jsconfig.json", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vuels.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vuels.lua new file mode 100644 index 0000000..34d0f28 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/vuels.lua @@ -0,0 +1,61 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'vls' }, + filetypes = { 'vue' }, + root_dir = util.root_pattern('package.json', 'vue.config.js'), + init_options = { + config = { + vetur = { + useWorkspaceDependencies = false, + validation = { + template = true, + style = true, + script = true, + }, + completion = { + autoImport = false, + useScaffoldSnippets = false, + tagCasing = 'kebab', + }, + format = { + defaultFormatter = { + js = 'none', + ts = 'none', + }, + defaultFormatterOptions = {}, + scriptInitialIndent = false, + styleInitialIndent = false, + }, + }, + css = {}, + html = { + suggest = {}, + }, + javascript = { + format = {}, + }, + typescript = { + format = {}, + }, + emmet = {}, + stylusSupremacy = {}, + }, + }, + }, + docs = { + description = [[ +https://github.com/vuejs/vetur/tree/master/server + +Vue language server(vls) +`vue-language-server` can be installed via `npm`: +```sh +npm install -g vls +``` +]], + default_config = { + root_dir = [[root_pattern("package.json", "vue.config.js")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/wgsl_analyzer.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/wgsl_analyzer.lua new file mode 100644 index 0000000..cf8913d --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/wgsl_analyzer.lua @@ -0,0 +1,23 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'wgsl_analyzer' }, + filetypes = { 'wgsl' }, + root_dir = util.root_pattern '.git', + settings = {}, + }, + docs = { + description = [[ +https://github.com/wgsl-analyzer/wgsl-analyzer + +`wgsl_analyzer` can be installed via `cargo`: +```sh +cargo install --git https://github.com/wgsl-analyzer/wgsl-analyzer wgsl_analyzer +``` +]], + default_config = { + root_dir = [[root_pattern(".git"]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/yamlls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/yamlls.lua new file mode 100644 index 0000000..3756e62 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/yamlls.lua @@ -0,0 +1,80 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'yaml-language-server', '--stdio' }, + filetypes = { 'yaml', 'yaml.docker-compose', 'yaml.gitlab' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + settings = { + -- https://github.com/redhat-developer/vscode-redhat-telemetry#how-to-disable-telemetry-reporting + redhat = { telemetry = { enabled = false } }, + }, + }, + docs = { + description = [[ +https://github.com/redhat-developer/yaml-language-server + +`yaml-language-server` can be installed via `yarn`: +```sh +yarn global add yaml-language-server +``` + +To use a schema for validation, there are two options: + +1. Add a modeline to the file. A modeline is a comment of the form: + +``` +# yaml-language-server: $schema=<urlToTheSchema|relativeFilePath|absoluteFilePath}> +``` + +where the relative filepath is the path relative to the open yaml file, and the absolute filepath +is the filepath relative to the filesystem root ('/' on unix systems) + +2. Associated a schema url, relative , or absolute (to root of project, not to filesystem root) path to +the a glob pattern relative to the detected project root. Check `:LspInfo` to determine the resolved project +root. + +```lua +require('lspconfig').yamlls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + ... -- other settings. note this overrides the lspconfig defaults. + schemas = { + ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*", + ["../path/relative/to/file.yml"] = "/.github/workflows/*", + ["/path/from/root/of/project"] = "/.github/workflows/*", + }, + }, + } +} +``` + +Currently, kubernetes is special-cased in yammls, see the following upstream issues: +* [#211](https://github.com/redhat-developer/yaml-language-server/issues/211). +* [#307](https://github.com/redhat-developer/yaml-language-server/issues/307). + +To override a schema to use a specific k8s schema version (for example, to use 1.18): + +```lua +require('lspconfig').yamlls.setup { + ... -- other configuration for setup {} + settings = { + yaml = { + ... -- other settings. note this overrides the lspconfig defaults. + schemas = { + ["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.18.0-standalone-strict/all.json"] = "/*.k8s.yaml", + ... -- other schemas + }, + }, + } +} +``` + +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/yang_lsp.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/yang_lsp.lua new file mode 100644 index 0000000..d4c9b8b --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/yang_lsp.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'yang-language-server' }, + filetypes = { 'yang' }, + root_dir = util.find_git_ancestor, + }, + docs = { + description = [[ +https://github.com/TypeFox/yang-lsp + +A Language Server for the YANG data modeling language. +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/yls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/yls.lua new file mode 100644 index 0000000..86cb337 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/yls.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'yls', '-vv' }, + filetypes = { 'yar', 'yara' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://pypi.org/project/yls-yara/ + +An YLS plugin adding YARA linting capabilities. + +This plugin runs yara.compile on every save, parses the errors, and returns list of diagnostic messages. + +Language Server: https://github.com/avast/yls +]], + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/zk.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/zk.lua new file mode 100644 index 0000000..e706528 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/zk.lua @@ -0,0 +1,48 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'zk', 'lsp' }, + filetypes = { 'markdown' }, + root_dir = util.root_pattern '.zk', + }, + commands = { + ZkIndex = { + function() + vim.lsp.buf.execute_command { + command = 'zk.index', + arguments = { vim.api.nvim_buf_get_name(0) }, + } + end, + description = 'ZkIndex', + }, + ZkNew = { + function(...) + vim.lsp.buf_request(0, 'workspace/executeCommand', { + command = 'zk.new', + arguments = { + vim.api.nvim_buf_get_name(0), + ..., + }, + }, function(_, result, _, _) + if not (result and result.path) then + return + end + vim.cmd('edit ' .. result.path) + end) + end, + + description = 'ZkNew', + }, + }, + docs = { + description = [[ +https://github.com/mickael-menu/zk + +A plain text note-taking assistant +]], + default_config = { + root_dir = [[root_pattern(".zk")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/zls.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/zls.lua new file mode 100644 index 0000000..d92a797 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/zls.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'zls' }, + filetypes = { 'zig', 'zir' }, + root_dir = util.root_pattern('zls.json', 'build.zig', '.git'), + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/zigtools/zls + +Zig LSP implementation + Zig Language Server + ]], + default_config = { + root_dir = [[util.root_pattern("zls.json", "build.zig", ".git")]], + }, + }, +} diff --git a/start/lspconfig-0.1.8/lua/lspconfig/ui/lspinfo.lua b/start/lspconfig-0.1.8/lua/lspconfig/ui/lspinfo.lua new file mode 100644 index 0000000..886014a --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/ui/lspinfo.lua @@ -0,0 +1,369 @@ +local api, fn = vim.api, vim.fn +local windows = require 'lspconfig.ui.windows' +local util = require 'lspconfig.util' + +local error_messages = { + cmd_not_found = 'Unable to find executable. Please check your path and ensure the server is installed', + no_filetype_defined = 'No filetypes defined, Please define filetypes in setup()', + root_dir_not_found = 'Not found.', + async_root_dir_function = 'Asynchronous root_dir functions are not supported in :LspInfo', +} + +local helptags = { + [error_messages.no_filetype_defined] = { 'lspconfig-setup' }, + [error_messages.root_dir_not_found] = { 'lspconfig-root-detection' }, +} + +local function trim_blankspace(cmd) + local trimmed_cmd = {} + for _, str in ipairs(cmd) do + trimmed_cmd[#trimmed_cmd + 1] = str:match '^%s*(.*)' + end + return trimmed_cmd +end + +local function indent_lines(lines, offset) + return vim.tbl_map(function(val) + return offset .. val + end, lines) +end + +local function remove_newlines(cmd) + cmd = trim_blankspace(cmd) + cmd = table.concat(cmd, ' ') + cmd = vim.split(cmd, '\n') + cmd = trim_blankspace(cmd) + cmd = table.concat(cmd, ' ') + return cmd +end + +local cmd_type = { + ['function'] = function(_) + return '<function>', 'NA' + end, + ['table'] = function(config) + local cmd = remove_newlines(config.cmd) + if vim.fn.executable(config.cmd[1]) == 1 then + return cmd, 'true' + end + return cmd, error_messages.cmd_not_found + end, +} + +local function make_config_info(config, bufnr) + local config_info = {} + config_info.name = config.name + config_info.helptags = {} + + if config.cmd then + config_info.cmd, config_info.cmd_is_executable = cmd_type[type(config.cmd)](config) + else + config_info.cmd = 'cmd not defined' + config_info.cmd_is_executable = 'NA' + end + + local buffer_dir = api.nvim_buf_call(bufnr, function() + return vim.fn.expand '%:p:h' + end) + + if config.get_root_dir then + local root_dir + local co = coroutine.create(function() + local status, err = pcall(function() + root_dir = config.get_root_dir(buffer_dir) + end) + if not status then + vim.notify(('[lspconfig] unhandled error: %s'):format(tostring(err), vim.log.levels.WARN)) + end + end) + coroutine.resume(co) + if root_dir then + config_info.root_dir = root_dir + elseif coroutine.status(co) == 'suspended' then + config_info.root_dir = error_messages.async_root_dir_function + else + config_info.root_dir = error_messages.root_dir_not_found + end + else + config_info.root_dir = error_messages.root_dir_not_found + vim.list_extend(config_info.helptags, helptags[error_messages.root_dir_not_found]) + end + + config_info.autostart = (config.autostart and 'true') or 'false' + config_info.handlers = table.concat(vim.tbl_keys(config.handlers), ', ') + config_info.filetypes = table.concat(config.filetypes or {}, ', ') + + local lines = { + 'Config: ' .. config_info.name, + } + + local info_lines = { + 'filetypes: ' .. config_info.filetypes, + 'root directory: ' .. config_info.root_dir, + 'cmd: ' .. config_info.cmd, + 'cmd is executable: ' .. config_info.cmd_is_executable, + 'autostart: ' .. config_info.autostart, + 'custom handlers: ' .. config_info.handlers, + } + + if vim.tbl_count(config_info.helptags) > 0 then + local help = vim.tbl_map(function(helptag) + return string.format(':h %s', helptag) + end, config_info.helptags) + info_lines = vim.list_extend({ + 'Refer to ' .. table.concat(help, ', ') .. ' for help.', + }, info_lines) + end + + vim.list_extend(lines, indent_lines(info_lines, '\t')) + + return lines +end + +---@param client vim.lsp.Client +---@param fname string +local function make_client_info(client, fname) + local client_info = {} + + client_info.cmd = cmd_type[type(client.config.cmd)](client.config) + local workspace_folders = fn.has 'nvim-0.9' == 1 and client.workspace_folders or client.workspaceFolders + local uv = vim.loop + local is_windows = uv.os_uname().version:match 'Windows' + fname = uv.fs_realpath(fname) or fn.fnamemodify(fn.resolve(fname), ':p') + if is_windows then + fname:gsub('%/', '%\\') + end + + if workspace_folders then + for _, schema in ipairs(workspace_folders) do + local matched = true + local root_dir = uv.fs_realpath(schema.name) + if root_dir == nil or fname:sub(1, root_dir:len()) ~= root_dir then + matched = false + end + + if matched then + client_info.root_dir = schema.name + break + end + end + end + + if not client_info.root_dir then + client_info.root_dir = 'Running in single file mode.' + end + client_info.filetypes = table.concat(client.config.filetypes or {}, ', ') + client_info.autostart = (client.config.autostart and 'true') or 'false' + client_info.attached_buffers_list = table.concat(vim.lsp.get_buffers_by_client_id(client.id), ', ') + + local lines = { + '', + 'Client: ' + .. client.name + .. ' (id: ' + .. tostring(client.id) + .. ', bufnr: [' + .. client_info.attached_buffers_list + .. '])', + } + + local info_lines = { + 'filetypes: ' .. client_info.filetypes, + 'autostart: ' .. client_info.autostart, + 'root directory: ' .. client_info.root_dir, + 'cmd: ' .. client_info.cmd, + } + + if client.config.lspinfo then + local server_specific_info = client.config.lspinfo(client.config) + info_lines = vim.list_extend(info_lines, server_specific_info) + end + + vim.list_extend(lines, indent_lines(info_lines, '\t')) + + return lines +end + +return function() + -- These options need to be cached before switching to the floating + -- buffer. + local original_bufnr = api.nvim_get_current_buf() + local buf_clients = util.get_lsp_clients { bufnr = original_bufnr } + local clients = util.get_lsp_clients() + local buffer_filetype = vim.bo.filetype + local fname = api.nvim_buf_get_name(original_bufnr) + + windows.default_options.wrap = true + windows.default_options.breakindent = true + windows.default_options.breakindentopt = 'shift:25' + windows.default_options.showbreak = 'NONE' + + local win_info = windows.percentage_range_window(0.8, 0.7) + local bufnr, win_id = win_info.bufnr, win_info.win_id + vim.bo.bufhidden = 'wipe' + + local buf_lines = {} + + local buf_client_ids = {} + for _, client in ipairs(buf_clients) do + buf_client_ids[#buf_client_ids + 1] = client.id + end + + local other_active_clients = {} + for _, client in ipairs(clients) do + if not vim.tbl_contains(buf_client_ids, client.id) then + other_active_clients[#other_active_clients + 1] = client + end + end + + -- insert the tips at the top of window + buf_lines[#buf_lines + 1] = 'Press q or <Esc> to close this window. Press <Tab> to view server doc.' + + local header = { + '', + 'Language client log: ' .. (vim.lsp.get_log_path()), + 'Detected filetype: ' .. buffer_filetype, + } + vim.list_extend(buf_lines, header) + + local buffer_clients_header = { + '', + tostring(#vim.tbl_keys(buf_clients)) .. ' client(s) attached to this buffer: ', + } + + vim.list_extend(buf_lines, buffer_clients_header) + for _, client in ipairs(buf_clients) do + local client_info = make_client_info(client, fname) + vim.list_extend(buf_lines, client_info) + end + + local other_active_section_header = { + '', + tostring(#other_active_clients) .. ' active client(s) not attached to this buffer: ', + } + if not vim.tbl_isempty(other_active_clients) then + vim.list_extend(buf_lines, other_active_section_header) + end + for _, client in ipairs(other_active_clients) do + local client_info = make_client_info(client, fname) + vim.list_extend(buf_lines, client_info) + end + + local other_matching_configs_header = { + '', + 'Other clients that match the filetype: ' .. buffer_filetype, + '', + } + + local other_matching_configs = util.get_other_matching_providers(buffer_filetype) + + if not vim.tbl_isempty(other_matching_configs) then + vim.list_extend(buf_lines, other_matching_configs_header) + for _, config in ipairs(other_matching_configs) do + vim.list_extend(buf_lines, make_config_info(config, original_bufnr)) + end + end + + local matching_config_header = { + '', + 'Configured servers list: ' .. table.concat(util.available_servers(), ', '), + } + + vim.list_extend(buf_lines, matching_config_header) + + local fmt_buf_lines = indent_lines(buf_lines, ' ') + + api.nvim_buf_set_lines(bufnr, 0, -1, true, fmt_buf_lines) + vim.bo.modifiable = false + vim.bo.filetype = 'lspinfo' + + local augroup = api.nvim_create_augroup('lspinfo', { clear = false }) + + local function close() + api.nvim_clear_autocmds { group = augroup, buffer = bufnr } + if api.nvim_win_is_valid(win_id) then + api.nvim_win_close(win_id, true) + end + end + + vim.keymap.set('n', '<ESC>', close, { buffer = bufnr, nowait = true }) + vim.keymap.set('n', 'q', close, { buffer = bufnr, nowait = true }) + api.nvim_create_autocmd({ 'BufDelete', 'BufHidden' }, { + once = true, + buffer = bufnr, + callback = close, + group = augroup, + }) + + vim.fn.matchadd( + 'Error', + error_messages.no_filetype_defined + .. '.\\|' + .. 'cmd not defined\\|' + .. error_messages.cmd_not_found + .. '\\|' + .. error_messages.root_dir_not_found + ) + + vim.cmd [[ + syn keyword String true + syn keyword Error false + syn match LspInfoFiletypeList /\<filetypes\?:\s*\zs.*\ze/ contains=LspInfoFiletype + syn match LspInfoFiletype /\k\+/ contained + syn match LspInfoTitle /^\s*\%(Client\|Config\):\s*\zs\S\+\ze/ + syn match LspInfoListList /^\s*Configured servers list:\s*\zs.*\ze/ contains=LspInfoList + syn match LspInfoList /\S\+/ contained + ]] + + api.nvim_buf_add_highlight(bufnr, 0, 'LspInfoTip', 0, 0, -1) + + local function show_doc() + local lines = {} + local function append_lines(config) + if not config then + return + end + local desc = vim.tbl_get(config, 'document_config', 'docs', 'description') + if desc then + lines[#lines + 1] = string.format('# %s', config.name) + lines[#lines + 1] = '' + vim.list_extend(lines, vim.split(desc, '\n')) + lines[#lines + 1] = '' + end + end + + lines[#lines + 1] = 'Press <Tab> to close server info.' + lines[#lines + 1] = '' + + for _, client in ipairs(buf_clients) do + local config = require('lspconfig.configs')[client.name] + append_lines(config) + end + + for _, config in ipairs(other_matching_configs) do + append_lines(config) + end + + local info = windows.percentage_range_window(0.8, 0.7) + lines = indent_lines(lines, ' ') + api.nvim_buf_set_lines(info.bufnr, 0, -1, false, lines) + api.nvim_buf_add_highlight(info.bufnr, 0, 'LspInfoTip', 0, 0, -1) + + vim.bo[info.bufnr].filetype = 'markdown' + vim.bo[info.bufnr].syntax = 'on' + vim.wo[info.win_id].concealcursor = 'niv' + vim.wo[info.win_id].conceallevel = 2 + vim.wo[info.win_id].breakindent = false + vim.wo[info.win_id].breakindentopt = '' + + local function close_doc_win() + if api.nvim_win_is_valid(info.win_id) then + api.nvim_win_close(info.win_id, true) + end + end + + vim.keymap.set('n', '<TAB>', close_doc_win, { buffer = info.bufnr }) + end + + vim.keymap.set('n', '<TAB>', show_doc, { buffer = true, nowait = true }) +end diff --git a/start/lspconfig-0.1.8/lua/lspconfig/ui/windows.lua b/start/lspconfig-0.1.8/lua/lspconfig/ui/windows.lua new file mode 100644 index 0000000..dc02c9e --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/ui/windows.lua @@ -0,0 +1,129 @@ +-- The following is extracted and modified from plenary.vnim by +-- TJ Devries. It is not a stable API, and is expected to change +-- +local api = vim.api + +local function apply_defaults(original, defaults) + if original == nil then + original = {} + end + + original = vim.deepcopy(original) + + for k, v in pairs(defaults) do + if original[k] == nil then + original[k] = v + end + end + + return original +end + +local win_float = {} + +win_float.default_options = {} + +function win_float.default_opts(options) + options = apply_defaults(options, { percentage = 0.9 }) + + local width = math.floor(vim.o.columns * options.percentage) + local height = math.floor(vim.o.lines * options.percentage) + + local top = math.floor(((vim.o.lines - height) / 2)) + local left = math.floor((vim.o.columns - width) / 2) + + local opts = { + relative = 'editor', + row = top, + col = left, + width = width, + height = height, + style = 'minimal', + border = { + { ' ', 'NormalFloat' }, + { ' ', 'NormalFloat' }, + { ' ', 'NormalFloat' }, + { ' ', 'NormalFloat' }, + { ' ', 'NormalFloat' }, + { ' ', 'NormalFloat' }, + { ' ', 'NormalFloat' }, + { ' ', 'NormalFloat' }, + }, + } + + opts.border = options.border and options.border + + return opts +end + +--- Create window that takes up certain percentags of the current screen. +--- +--- Works regardless of current buffers, tabs, splits, etc. +--@param col_range number | Table: +-- If number, then center the window taking up this percentage of the screen. +-- If table, first index should be start, second_index should be end +--@param row_range number | Table: +-- If number, then center the window taking up this percentage of the screen. +-- If table, first index should be start, second_index should be end +function win_float.percentage_range_window(col_range, row_range, options) + options = apply_defaults(options, win_float.default_options) + + local win_opts = win_float.default_opts(options) + win_opts.relative = 'editor' + + local height_percentage, row_start_percentage + if type(row_range) == 'number' then + assert(row_range <= 1) + assert(row_range > 0) + height_percentage = row_range + row_start_percentage = (1 - height_percentage) / 3 + elseif type(row_range) == 'table' then + height_percentage = row_range[2] - row_range[1] + row_start_percentage = row_range[1] + else + error(string.format("Invalid type for 'row_range': %p", row_range)) + end + + win_opts.height = math.ceil(vim.o.lines * height_percentage) + win_opts.row = math.ceil(vim.o.lines * row_start_percentage) + win_opts.border = options.border or 'none' + + local width_percentage, col_start_percentage + if type(col_range) == 'number' then + assert(col_range <= 1) + assert(col_range > 0) + width_percentage = col_range + col_start_percentage = (1 - width_percentage) / 2 + elseif type(col_range) == 'table' then + width_percentage = col_range[2] - col_range[1] + col_start_percentage = col_range[1] + else + error(string.format("Invalid type for 'col_range': %p", col_range)) + end + + win_opts.col = math.floor(vim.o.columns * col_start_percentage) + win_opts.width = math.floor(vim.o.columns * width_percentage) + + local bufnr = options.bufnr or api.nvim_create_buf(false, true) + local win_id = api.nvim_open_win(bufnr, true, win_opts) + api.nvim_win_set_option(win_id, 'winhl', 'FloatBorder:LspInfoBorder') + + for k, v in pairs(win_float.default_options) do + if k ~= 'border' then + vim.opt_local[k] = v + end + end + + api.nvim_win_set_buf(win_id, bufnr) + + api.nvim_win_set_option(win_id, 'cursorcolumn', false) + api.nvim_buf_set_option(bufnr, 'tabstop', 2) + api.nvim_buf_set_option(bufnr, 'shiftwidth', 2) + + return { + bufnr = bufnr, + win_id = win_id, + } +end + +return win_float diff --git a/start/lspconfig-0.1.8/lua/lspconfig/util.lua b/start/lspconfig-0.1.8/lua/lspconfig/util.lua new file mode 100644 index 0000000..a06bfa0 --- /dev/null +++ b/start/lspconfig-0.1.8/lua/lspconfig/util.lua @@ -0,0 +1,429 @@ +local vim = vim +local validate = vim.validate +local api = vim.api +local lsp = vim.lsp +local uv = vim.loop +local nvim_ten = vim.fn.has 'nvim-0.10' == 1 + +local is_windows = uv.os_uname().version:match 'Windows' + +local M = {} + +M.default_config = { + log_level = lsp.protocol.MessageType.Warning, + message_level = lsp.protocol.MessageType.Warning, + settings = vim.empty_dict(), + init_options = vim.empty_dict(), + handlers = {}, + autostart = true, + capabilities = lsp.protocol.make_client_capabilities(), +} + +-- global on_setup hook +M.on_setup = nil + +function M.bufname_valid(bufname) + if bufname:match '^/' or bufname:match '^[a-zA-Z]:' or bufname:match '^zipfile://' or bufname:match '^tarfile:' then + return true + end + return false +end + +function M.validate_bufnr(bufnr) + validate { + bufnr = { bufnr, 'n' }, + } + return bufnr == 0 and api.nvim_get_current_buf() or bufnr +end + +function M.add_hook_before(func, new_fn) + if func then + return function(...) + -- TODO which result? + new_fn(...) + return func(...) + end + else + return new_fn + end +end + +function M.add_hook_after(func, new_fn) + if func then + return function(...) + -- TODO which result? + func(...) + return new_fn(...) + end + else + return new_fn + end +end + +-- Maps lspconfig-style command options to nvim_create_user_command (i.e. |command-attributes|) option names. +local opts_aliases = { + ['description'] = 'desc', +} + +---@param command_definition table<string | integer, any> +function M._parse_user_command_options(command_definition) + ---@type table<string, string | boolean | number> + local opts = {} + for k, v in pairs(command_definition) do + if type(k) == 'string' then + local attribute = k.gsub(k, '^%-+', '') + opts[opts_aliases[attribute] or attribute] = v + elseif type(k) == 'number' and type(v) == 'string' and v:match '^%-' then + -- Splits strings like "-nargs=* -complete=customlist,v:lua.something" into { "-nargs=*", "-complete=customlist,v:lua.something" } + for _, command_attribute in ipairs(vim.split(v, '%s')) do + -- Splits attribute into a key-value pair, like "-nargs=*" to { "-nargs", "*" } + local attribute, value = unpack(vim.split(command_attribute, '=', { plain = true })) + attribute = attribute.gsub(attribute, '^%-+', '') + opts[opts_aliases[attribute] or attribute] = value or true + end + end + end + return opts +end + +function M.create_module_commands(module_name, commands) + for command_name, def in pairs(commands) do + local opts = M._parse_user_command_options(def) + api.nvim_create_user_command(command_name, function(info) + require('lspconfig')[module_name].commands[command_name][1](unpack(info.fargs)) + end, opts) + end +end + +-- Some path utilities +M.path = (function() + local function escape_wildcards(path) + return path:gsub('([%[%]%?%*])', '\\%1') + end + + --- @param path string + --- @return string + local function sanitize(path) + if is_windows then + path = path:sub(1, 1):upper() .. path:sub(2) + path = path:gsub('\\', '/') + end + return path + end + + --- @param filename string + --- @return string|false + local function exists(filename) + local stat = uv.fs_stat(filename) + return stat and stat.type or false + end + + --- @param filename string + --- @return boolean + local function is_dir(filename) + return exists(filename) == 'directory' + end + + --- @param filename string + --- @return boolean + local function is_file(filename) + return exists(filename) == 'file' + end + + --- @param path string + --- @return boolean + local function is_fs_root(path) + if is_windows then + return path:match '^%a:$' + else + return path == '/' + end + end + + --- @param filename string + --- @return boolean + local function is_absolute(filename) + if is_windows then + return filename:match '^%a:' or filename:match '^\\\\' + else + return filename:match '^/' + end + end + + --- @generic T: string? + --- @param path T + --- @return T + local function dirname(path) + local strip_dir_pat = '/([^/]+)$' + local strip_sep_pat = '/$' + if not path or #path == 0 then + return path + end + local result = path:gsub(strip_sep_pat, ''):gsub(strip_dir_pat, '') + if #result == 0 then + if is_windows then + return path:sub(1, 2):upper() + else + return '/' + end + end + return result + end + + local function path_join(...) + return table.concat(M.tbl_flatten { ... }, '/') + end + + -- Traverse the path calling cb along the way. + local function traverse_parents(path, cb) + path = uv.fs_realpath(path) + local dir = path + -- Just in case our algo is buggy, don't infinite loop. + for _ = 1, 100 do + dir = dirname(dir) + if not dir then + return + end + -- If we can't ascend further, then stop looking. + if cb(dir, path) then + return dir, path + end + if is_fs_root(dir) then + break + end + end + end + + -- Iterate the path until we find the rootdir. + local function iterate_parents(path) + local function it(_, v) + if v and not is_fs_root(v) then + v = dirname(v) + else + return + end + if v and uv.fs_realpath(v) then + return v, path + else + return + end + end + return it, path, path + end + + local function is_descendant(root, path) + if not path then + return false + end + + local function cb(dir, _) + return dir == root + end + + local dir, _ = traverse_parents(path, cb) + + return dir == root + end + + local path_separator = is_windows and ';' or ':' + + return { + escape_wildcards = escape_wildcards, + is_dir = is_dir, + is_file = is_file, + is_absolute = is_absolute, + exists = exists, + dirname = dirname, + join = path_join, + sanitize = sanitize, + traverse_parents = traverse_parents, + iterate_parents = iterate_parents, + is_descendant = is_descendant, + path_separator = path_separator, + } +end)() + +function M.search_ancestors(startpath, func) + validate { func = { func, 'f' } } + if func(startpath) then + return startpath + end + local guard = 100 + for path in M.path.iterate_parents(startpath) do + -- Prevent infinite recursion if our algorithm breaks + guard = guard - 1 + if guard == 0 then + return + end + + if func(path) then + return path + end + end +end + +function M.tbl_flatten(t) + return nvim_ten and vim.iter(t):flatten(math.huge):totable() or vim.tbl_flatten(t) +end + +function M.get_lsp_clients(filter) + return nvim_ten and lsp.get_clients(filter) or lsp.get_active_clients(filter) +end + +function M.root_pattern(...) + local patterns = M.tbl_flatten { ... } + return function(startpath) + startpath = M.strip_archive_subpath(startpath) + for _, pattern in ipairs(patterns) do + local match = M.search_ancestors(startpath, function(path) + for _, p in ipairs(vim.fn.glob(M.path.join(M.path.escape_wildcards(path), pattern), true, true)) do + if M.path.exists(p) then + return path + end + end + end) + + if match ~= nil then + return match + end + end + end +end + +function M.find_git_ancestor(startpath) + return M.search_ancestors(startpath, function(path) + -- Support git directories and git files (worktrees) + if M.path.is_dir(M.path.join(path, '.git')) or M.path.is_file(M.path.join(path, '.git')) then + return path + end + end) +end + +function M.find_mercurial_ancestor(startpath) + return M.search_ancestors(startpath, function(path) + -- Support Mercurial directories + if M.path.is_dir(M.path.join(path, '.hg')) then + return path + end + end) +end + +function M.find_node_modules_ancestor(startpath) + return M.search_ancestors(startpath, function(path) + if M.path.is_dir(M.path.join(path, 'node_modules')) then + return path + end + end) +end + +function M.find_package_json_ancestor(startpath) + return M.search_ancestors(startpath, function(path) + if M.path.is_file(M.path.join(path, 'package.json')) then + return path + end + end) +end + +function M.insert_package_json(config_files, field, fname) + local path = vim.fn.fnamemodify(fname, ':h') + local root_with_package = M.find_package_json_ancestor(path) + + if root_with_package then + -- only add package.json if it contains field parameter + local path_sep = is_windows and '\\' or '/' + for line in io.lines(root_with_package .. path_sep .. 'package.json') do + if line:find(field) then + config_files[#config_files + 1] = 'package.json' + break + end + end + end + return config_files +end + +function M.get_active_clients_list_by_ft(filetype) + local clients = M.get_lsp_clients() + local clients_list = {} + for _, client in pairs(clients) do + local filetypes = client.config.filetypes or {} + for _, ft in pairs(filetypes) do + if ft == filetype then + table.insert(clients_list, client.name) + end + end + end + return clients_list +end + +function M.get_other_matching_providers(filetype) + local configs = require 'lspconfig.configs' + local active_clients_list = M.get_active_clients_list_by_ft(filetype) + local other_matching_configs = {} + for _, config in pairs(configs) do + if not vim.tbl_contains(active_clients_list, config.name) then + local filetypes = config.filetypes or {} + for _, ft in pairs(filetypes) do + if ft == filetype then + table.insert(other_matching_configs, config) + end + end + end + end + return other_matching_configs +end + +function M.get_config_by_ft(filetype) + local configs = require 'lspconfig.configs' + local matching_configs = {} + for _, config in pairs(configs) do + local filetypes = config.filetypes or {} + for _, ft in pairs(filetypes) do + if ft == filetype then + table.insert(matching_configs, config) + end + end + end + return matching_configs +end + +function M.get_active_client_by_name(bufnr, servername) + --TODO(glepnir): remove this for loop when we want only support 0.10+ + for _, client in pairs(M.get_lsp_clients { bufnr = bufnr }) do + if client.name == servername then + return client + end + end +end + +function M.get_managed_clients() + local configs = require 'lspconfig.configs' + local clients = {} + for _, config in pairs(configs) do + if config.manager then + vim.list_extend(clients, config.manager:clients()) + end + end + return clients +end + +function M.available_servers() + local servers = {} + local configs = require 'lspconfig.configs' + for server, config in pairs(configs) do + if config.manager ~= nil then + table.insert(servers, server) + end + end + return servers +end + +-- For zipfile: or tarfile: virtual paths, returns the path to the archive. +-- Other paths are returned unaltered. +function M.strip_archive_subpath(path) + -- Matches regex from zip.vim / tar.vim + path = vim.fn.substitute(path, 'zipfile://\\(.\\{-}\\)::[^\\\\].*$', '\\1', '') + path = vim.fn.substitute(path, 'tarfile:\\(.\\{-}\\)::.*$', '\\1', '') + return path +end + +return M diff --git a/start/lspconfig-0.1.8/plugin/lspconfig.lua b/start/lspconfig-0.1.8/plugin/lspconfig.lua new file mode 100644 index 0000000..254ca6c --- /dev/null +++ b/start/lspconfig-0.1.8/plugin/lspconfig.lua @@ -0,0 +1,159 @@ +if vim.g.lspconfig ~= nil then + return +end +vim.g.lspconfig = 1 + +local api, lsp = vim.api, vim.lsp + +if vim.fn.has 'nvim-0.8' ~= 1 then + local version_info = vim.version() + local warning_str = string.format( + '[lspconfig] requires neovim 0.8 or later. Detected neovim version: 0.%s.%s', + version_info.minor, + version_info.patch + ) + vim.notify_once(warning_str) + return +end + +local completion_sort = function(items) + table.sort(items) + return items +end + +local lsp_complete_configured_servers = function(arg) + return completion_sort(vim.tbl_filter(function(s) + return s:sub(1, #arg) == arg + end, require('lspconfig.util').available_servers())) +end + +local lsp_get_active_client_ids = function(arg) + local clients = vim.tbl_map(function(client) + return ('%d (%s)'):format(client.id, client.name) + end, require('lspconfig.util').get_managed_clients()) + + return completion_sort(vim.tbl_filter(function(s) + return s:sub(1, #arg) == arg + end, clients)) +end + +local get_clients_from_cmd_args = function(arg) + local result = {} + for id in (arg or ''):gmatch '(%d+)' do + result[#result + 1] = lsp.get_client_by_id(tonumber(id)) + end + if #result == 0 then + return require('lspconfig.util').get_managed_clients() + end + return result +end + +for group, hi in pairs { + LspInfoBorder = { link = 'Label', default = true }, + LspInfoList = { link = 'Function', default = true }, + LspInfoTip = { link = 'Comment', default = true }, + LspInfoTitle = { link = 'Title', default = true }, + LspInfoFiletype = { link = 'Type', default = true }, +} do + api.nvim_set_hl(0, group, hi) +end + +-- Called from plugin/lspconfig.vim because it requires knowing that the last +-- script in scriptnames to be executed is lspconfig. +api.nvim_create_user_command('LspInfo', function() + require 'lspconfig.ui.lspinfo'() +end, { + desc = 'Displays attached, active, and configured language servers', +}) + +api.nvim_create_user_command('LspStart', function(info) + local server_name = string.len(info.args) > 0 and info.args or nil + if server_name then + local config = require('lspconfig.configs')[server_name] + if config then + config.launch() + return + end + end + + local matching_configs = require('lspconfig.util').get_config_by_ft(vim.bo.filetype) + for _, config in ipairs(matching_configs) do + config.launch() + end +end, { + desc = 'Manually launches a language server', + nargs = '?', + complete = lsp_complete_configured_servers, +}) + +api.nvim_create_user_command('LspRestart', function(info) + local detach_clients = {} + for _, client in ipairs(get_clients_from_cmd_args(info.args)) do + client.stop() + if vim.tbl_count(client.attached_buffers) > 0 then + detach_clients[client.name] = { client, lsp.get_buffers_by_client_id(client.id) } + end + end + local timer = vim.loop.new_timer() + timer:start( + 500, + 100, + vim.schedule_wrap(function() + for client_name, tuple in pairs(detach_clients) do + if require('lspconfig.configs')[client_name] then + local client, attached_buffers = unpack(tuple) + if client.is_stopped() then + for _, buf in pairs(attached_buffers) do + require('lspconfig.configs')[client_name].launch(buf) + end + detach_clients[client_name] = nil + end + end + end + + if next(detach_clients) == nil and not timer:is_closing() then + timer:close() + end + end) + ) +end, { + desc = 'Manually restart the given language client(s)', + nargs = '?', + complete = lsp_get_active_client_ids, +}) + +api.nvim_create_user_command('LspStop', function(info) + local current_buf = vim.api.nvim_get_current_buf() + local server_id, force + local arguments = vim.split(info.args, '%s') + for _, v in pairs(arguments) do + if v == '++force' then + force = true + elseif v:find '^[0-9]+$' then + server_id = v + end + end + + if not server_id then + local servers_on_buffer = require('lspconfig.util').get_lsp_clients { bufnr = current_buf } + for _, client in ipairs(servers_on_buffer) do + if client.attached_buffers[current_buf] then + client.stop(force) + end + end + else + for _, client in ipairs(get_clients_from_cmd_args(server_id)) do + client.stop(force) + end + end +end, { + desc = 'Manually stops the given language client(s)', + nargs = '?', + complete = lsp_get_active_client_ids, +}) + +api.nvim_create_user_command('LspLog', function() + vim.cmd(string.format('tabnew %s', lsp.get_log_path())) +end, { + desc = 'Opens the Nvim LSP client log.', +}) |