diff options
Diffstat (limited to 'start/lspconfig-0.1.3')
157 files changed, 0 insertions, 21017 deletions
diff --git a/start/lspconfig-0.1.3/LICENSE.md b/start/lspconfig-0.1.3/LICENSE.md deleted file mode 100644 index be03814..0000000 --- a/start/lspconfig-0.1.3/LICENSE.md +++ /dev/null @@ -1,183 +0,0 @@ -Copyright Neovim contributors. All rights reserved. - -nvim-lsp is licensed under the terms of the Apache 2.0 license. - -nvim-lsp's license follows: - -==== - 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.3/doc/lspconfig.txt b/start/lspconfig-0.1.3/doc/lspconfig.txt deleted file mode 100644 index d1d9103..0000000 --- a/start/lspconfig-0.1.3/doc/lspconfig.txt +++ /dev/null @@ -1,636 +0,0 @@ -*lspconfig.txt* For Nvim version 0.6.1+ Last change: 2021 Nov 7 -============================================================================== -TABLE OF CONTENTS *lspconfig-toc* - -1. Introduction (|lspconfig|) -2. LSP overview (|lspconfig-lsp|) -3. Quickstart (|lspconfig-quickstart|) -4. Setup {} (|lspconfig-setup|) -5. Global defaults (|lspconfig-global-defaults|) -6. Server configurations (|lspconfig-configurations|) - 6a. Adding servers (|lspconfig-adding-servers|) -7. Root directories (|lspconfig-root-detection|) - 7a. Advanced detection (|lspconfig-root-advanced|) - 7b. Single file support (|lspconfig-single-file-support|) -8. Commands (|lspconfig-commands|) -9. Keybindings (|lspconfig-keybindings|) -10. Completion (|lspconfig-completion|) -11. Debugging (|lspconfig-debugging|) -12. Logging (|lspconfig-logging|) -13. Scope (|lspconfig-scope|) - -============================================================================== -INTRODUCTION *lspconfig* - -`lspconfig` is a collection of community contributed configurations for the -built-in language server client in Neovim 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 - -`lspconfig` is not required to use the built-in client, it is only one front-end -interface for when a language server specific plugin is not available. - -See |lspconfig-server-configurations| by typing `K` over it for the complete -list of language servers configurations. - -============================================================================== -LSP OVERVIEW *lspconfig-lsp* - -Nvim supports the Language Server Protocol (LSP) via the built-in language -server client. LSP facilitates many features, some of which include: - -- go-to-definition -- find-references -- hover -- completion -- rename -- format -- refactor - -These features are implemented in Neovim core, not `lspconfig`. See `:help lsp` -for more details. - -NOTE: Feature availability depends on the implementation details of the -server. A server may implement only a subset of these features. Always -consult the server documentation before filing a bug report on a missing -feature. - -============================================================================== -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-server-configurations|. - -- 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-server-configurations|. - -============================================================================== -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-server-configurations| and -match the server name in `config.SERVER_NAME` defined in each configuration's -source file. - -The purpose of `setup{}` is to wrap the call to Nvim's built-in -`vim.lsp.start_client()` with an autocommand that automatically launch a -language server. - -This autocommand calls `start_client()` or `vim.lsp.buf_attach_client()` -depending on whether the current file belongs to a project with a currently -running client. See |lspconfig-root-detection| for more details. - -The `setup{}` function takes a table which contains a superset of the keys -listed in `:help vim.lsp.start_client()` with the following unique entries: - -- {root_dir} - - `function(filename, bufnr)` - - Returns either a filepath (string) or nil. The language server will only - start if the function returns a filepath. - - If a root directory (string) is returned which is unique from any - previously returned root_dir, a new server will be spawned with that - root directory. See |lspconfig-root-detection| for more details - -- {name} - - `string` - - Defaults to the server's name (`clangd`, `pyright`, etc.). - -- {filetypes} - - `list[string] | nil` - - Set of filetypes for which to attempt to resolve {root_dir}. - - May be empty, or server may specify a default value. - -- {autostart} - - `bool` (default: true) - - Controls if the `FileType` autocommand that launches a language server is - created. If `false`, allows for deferring language servers until manually - launched with `:LspStart` (|lspconfig-commands|). - -- {single_file_support} - - `bool` (default: nil) - - Determines if a server is started without a matching root directory. - See |lspconfig-single-file-support|. - -- {on_new_config} - - `function(new_config, new_root_dir)` - - Function executed after a root directory is detected. This is used to - modify the server configuration (including `cmd` itself). Most commonly, - this is used to inject additional arguments into `cmd`. - - If overriding `on_new_config`, ensure that you read the - `on_new_config` defined in the source file of the default configuration - in `lspconfig`. The original `on_new_config` snippet for a given server - should likely be included in your new override. Some configurations - use `on_new_config` to dynamically set or modify `cmd`. - -Note: all entries passed to `setup {}` override the entry in the default -configuration. There is no composition. - -All `config` elements described in `:help vim.lsp.start_client()` can -additionally be overridden via the `setup {}` call. The most commonly -passed overrides to `setup {}` are: - -- {capabilities} `table <string, string|table|bool|function>` - - a table which represents the neovim client capabilities. Useful for - broadcasting to the server additional functionality (snippets, off-protocol - features) provided by plugins. - -- {cmd} `list[string]` - - a list where each entry corresponds to the blankspace delimited part of - the command that launches the server. The first entry is the binary used - to run the language server. Additional entries are passed as arguments. - - The equivalent `cmd` for: -> - foo --bar baz -< - is: -> - {'foo', '--bar', 'baz} -< -- {handlers} `list[functions]` - - a list of handlers which override the function used to process a response - from a given language server. Applied only to the server referenced by - setup. See |lsp-handler|. - -- {init_options} `table <string, string|table|bool>` - - a table passed during the initialization notification after launching - a language server. Equivalent to the `initializationOptions` field found - in `InitializeParams` in the LSP specification. - - See upstream server documentation for available initialization - options. - -- {on_attach} `function(client, bufnr)` - - Callback invoked by Nvim's built-in client when attaching a buffer to a - language server. Often used to set Nvim (buffer or global) options or to - override the Nvim client properties (`resolved_capabilities`) after a - language server attaches. Most commonly used for settings buffer - local keybindings. See |lspconfig-keybindings| for a usage example. - -- {settings} `table <string, string|table|bool>` - - The `settings` table is sent in `on_init` via a - `workspace/didChangeConfiguration` notification from the Nvim client to - the language server. These settings allow a user to change optional runtime - settings of the language server. - - As an example, to set the following settings found in the pyright - documentation: - - `pyright.disableLanguageServices`: `boolean` - `pyright.disableOrganizeImports`: `boolean` - - Nested keys need to be translated into a nested table and passed to - the settings field in `setup {}` as follows: -> - require('lspconfig').pyright.setup{ - settings = { - pyright = { - disableLanguageServices = true, - disableOrganizeImports = true, - } - } - } -< -============================================================================== -OVERRIDING GLOBAL DEFAULTS *lspconfig-global-defaults* - -The global defaults for all servers can be overridden by extending the -`default_config` table. - -> - local lspconfig = require'lspconfig' - lspconfig.util.default_config = vim.tbl_extend( - "force", - lspconfig.util.default_config, - { - autostart = false, - handlers = { - ["window/logMessage"] = function(err, method, params, client_id) - if params and params.type <= vim.lsp.protocol.MessageType.Log then - vim.lsp.handlers["window/logMessage"](err, method, params, client_id) - end - end; - ["window/showMessage"] = function(err, method, params, client_id) - if params and params.type <= vim.lsp.protocol.MessageType.Warning.Error then - vim.lsp.handlers["window/showMessage"](err, method, params, client_id) - end - end; - } - } - ) -< -`setup {}` can additionally override these defaults in subsequent calls. - -============================================================================== -SERVER CONFIGURATIONS *lspconfig-configurations* - -See |lspconfig-server-configurations| by typing `K` over it for the complete -list of language servers 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`. Example: -> - commands = { - TexlabBuild = { - function() - buf_build(0) - end; - "-range"; - description = "Build the current buffer"; - }; - }; -< -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-adding-servers* - -The three steps for adding and enabling a new server configuration are: - -- load the `lspconfig` module (note that this is a stylistic choice) -> - local lspconfig = require 'lspconfig' -< -- 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 - -- 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.fin.glob()| while traversing up the - filesystem. -> - root_dir = util.root_pattern('pyproject.toml', 'requirements.txt') -< -- `util.find_git_ancestor`: a function that locates the first parent directory - containing a `.git` directory. -> - root_dir = util.find_git_ancestor - -- `util.find_node_modules_ancestor`: a function that locates the first parent - directory containing a `node_modules` directory. -> - root_dir = util.find_node_modules_ancestor -< - -- `util.find_package_json_ancestor`: a function that locates the first parent - directory containing a `package.json`. -> - root_dir = util.find_json_ancestor -< -Note: On Windows, `lspconfig` always assumes forward slash normalized paths with -capitalized drive letters. - -============================================================================== -ADVANCED ROOT DIRECTORY DETECTION *lspconfig-root-advanced* - *lspconfig-root-composition* - -The `root_dir` key in `config` and `setup` can hold any function of the form -> - function custom_root_dir(filename, bufnr) - returns nil | string -> -This allows for rich composition of root directory patterns which is necessary -for some project structures. Example (for Kotlin): -> - local root_files = { - 'settings.gradle', -- Gradle (multi-project) - 'settings.gradle.kts', -- Gradle (multi-project) - 'build.xml', -- Ant - 'pom.xml', -- Maven - } - - local fallback_root_files = { - 'build.gradle', -- Gradle - 'build.gradle.kts', -- Gradle - } - root_dir = function(fname) - local primary = util.root_pattern(unpack(root_files))(fname) - local fallback = util.root_pattern(unpack(fallback_root_files))(fname) - return primary or fallback - end -< -Browsing the source of the default configurations is recommended. - -============================================================================== -SINGLE FILE SUPPORT *lspconfig-single-file-support* - -Language servers require each project to have a `root` in order to provide -features that require cross-file indexing. - -Some servers support not passing a root directory as a proxy for single file -mode under which cross-file features may be degraded. - -`lspconfig` offers limited support for an implicit single-file mode by: - -- first trying to resolve the root directory pattern -- then, if `single_file_support` is enabled for a given language server - configuration, starting the server without sending `rootDirectory` or - `workspaceFolders` during initialization. -- attaching subsequent files in the parent directory to the same server - instance, depending on filetype. - -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. -- `:LspRestart <client_id>` restarts the client with the given client id, and - will attempt to reattach to all previously attached buffers. - -============================================================================== -EXAMPLE KEYBINDINGS *lspconfig-keybindings* - -`lspconfig`, and the core client, do not map any keybindings by default. The -following is an example Lua block which demonstrates how to leverage -`on-attach` to selectively apply keybindings after a language servers has -attached to a given buffer. -> -> - -- Mappings. - -- See `:help vim.diagnostic.*` for documentation on any of the below functions - local opts = { noremap=true, silent=true } - vim.api.nvim_set_keymap('n', '<space>e', '<cmd>lua vim.diagnostic.open_float()<CR>', opts) - vim.api.nvim_set_keymap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts) - vim.api.nvim_set_keymap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts) - vim.api.nvim_set_keymap('n', '<space>q', '<cmd>lua vim.diagnostic.setloclist()<CR>', opts) - - -- Use an on_attach function to only map the following keys - -- after the language server attaches to the current buffer - local on_attach = function(client, bufnr) - -- Enable completion triggered by <c-x><c-o> - vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') - - -- Mappings. - -- See `:help vim.lsp.*` for documentation on any of the below functions - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts) - end - - -- Use a loop to conveniently call 'setup' on multiple servers and - -- map buffer local keybindings when the language server attaches - local servers = { 'pyright', 'rust_analyzer', 'tsserver' } - for _, lsp in pairs(servers) do - require('lspconfig')[lsp].setup { - on_attach = on_attach, - flags = { - -- This will be the default in neovim 0.7+ - debounce_text_changes = 150, - } - } - end -< -Note: these keymappings are meant for illustration and override some -infrequently used default mappings. - -============================================================================== -COMPLETION SUPPORT *lspconfig-completion* - -Manually triggered completion can be provided by Nvim's built-in omnifunc. -See `:help omnifunc` for more details. - -For autocompletion, Nvim does not offer built-in functionality at this time. -Consult the `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 -- `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 `lspconfig`. - -- The root directory inferred for your project is wrong, or it should be - detected but is not due to a bug in the `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 `lspconfig` issues, the most common hurdles users face are: - - - The language server is not installed or is otherwise not executable. - `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. `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: - -> - :lua vim.cmd('e'..vim.lsp.get_log_path()) -< -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. - -============================================================================== - -vim:tw=78:ts=8:ft=help:norl: diff --git a/start/lspconfig-0.1.3/doc/server_configurations.md b/start/lspconfig-0.1.3/doc/server_configurations.md deleted file mode 100644 index 426c422..0000000 --- a/start/lspconfig-0.1.3/doc/server_configurations.md +++ /dev/null @@ -1,6554 +0,0 @@ -# Configurations -<!-- *lspconfig-server-configurations* --> - -The following LSP configs are included. This documentation is autogenerated from the lua files. Follow a link to find documentation for -that config. This file is accessible in neovim via `:help lspconfig-server-configurations` - -- [als](#als) -- [angularls](#angularls) -- [ansiblels](#ansiblels) -- [arduino_language_server](#arduino_language_server) -- [asm_lsp](#asm_lsp) -- [awk_ls](#awk_ls) -- [bashls](#bashls) -- [beancount](#beancount) -- [bicep](#bicep) -- [bsl_ls](#bsl_ls) -- [ccls](#ccls) -- [clangd](#clangd) -- [clarity_lsp](#clarity_lsp) -- [clojure_lsp](#clojure_lsp) -- [cmake](#cmake) -- [codeqlls](#codeqlls) -- [crystalline](#crystalline) -- [csharp_ls](#csharp_ls) -- [cssls](#cssls) -- [cssmodules_ls](#cssmodules_ls) -- [cucumber_language_server](#cucumber_language_server) -- [dartls](#dartls) -- [denols](#denols) -- [dhall_lsp_server](#dhall_lsp_server) -- [diagnosticls](#diagnosticls) -- [dockerls](#dockerls) -- [dotls](#dotls) -- [efm](#efm) -- [elixirls](#elixirls) -- [elmls](#elmls) -- [ember](#ember) -- [emmet_ls](#emmet_ls) -- [erlangls](#erlangls) -- [esbonio](#esbonio) -- [eslint](#eslint) -- [flow](#flow) -- [flux_lsp](#flux_lsp) -- [foam_ls](#foam_ls) -- [fortls](#fortls) -- [fsautocomplete](#fsautocomplete) -- [fstar](#fstar) -- [gdscript](#gdscript) -- [ghcide](#ghcide) -- [golangci_lint_ls](#golangci_lint_ls) -- [gopls](#gopls) -- [gradle_ls](#gradle_ls) -- [grammarly](#grammarly) -- [graphql](#graphql) -- [groovyls](#groovyls) -- [haxe_language_server](#haxe_language_server) -- [hdl_checker](#hdl_checker) -- [hhvm](#hhvm) -- [hie](#hie) -- [hls](#hls) -- [hoon_ls](#hoon_ls) -- [html](#html) -- [idris2_lsp](#idris2_lsp) -- [intelephense](#intelephense) -- [java_language_server](#java_language_server) -- [jdtls](#jdtls) -- [jedi_language_server](#jedi_language_server) -- [jsonls](#jsonls) -- [jsonnet_ls](#jsonnet_ls) -- [julials](#julials) -- [kotlin_language_server](#kotlin_language_server) -- [lean3ls](#lean3ls) -- [leanls](#leanls) -- [lelwel_ls](#lelwel_ls) -- [lemminx](#lemminx) -- [ltex](#ltex) -- [metals](#metals) -- [mint](#mint) -- [mm0_ls](#mm0_ls) -- [nickel_ls](#nickel_ls) -- [nimls](#nimls) -- [ocamlls](#ocamlls) -- [ocamllsp](#ocamllsp) -- [ols](#ols) -- [omnisharp](#omnisharp) -- [opencl_ls](#opencl_ls) -- [openscad_ls](#openscad_ls) -- [pasls](#pasls) -- [perlls](#perlls) -- [perlnavigator](#perlnavigator) -- [perlpls](#perlpls) -- [phpactor](#phpactor) -- [please](#please) -- [powershell_es](#powershell_es) -- [prismals](#prismals) -- [prosemd_lsp](#prosemd_lsp) -- [psalm](#psalm) -- [puppet](#puppet) -- [purescriptls](#purescriptls) -- [pylsp](#pylsp) -- [pyre](#pyre) -- [pyright](#pyright) -- [quick_lint_js](#quick_lint_js) -- [r_language_server](#r_language_server) -- [racket_langserver](#racket_langserver) -- [reason_ls](#reason_ls) -- [remark_ls](#remark_ls) -- [rescriptls](#rescriptls) -- [rls](#rls) -- [rnix](#rnix) -- [robotframework_ls](#robotframework_ls) -- [rome](#rome) -- [rust_analyzer](#rust_analyzer) -- [salt_ls](#salt_ls) -- [scry](#scry) -- [serve_d](#serve_d) -- [sixtyfps](#sixtyfps) -- [slint_lsp](#slint_lsp) -- [solang](#solang) -- [solargraph](#solargraph) -- [solc](#solc) -- [solidity_ls](#solidity_ls) -- [sorbet](#sorbet) -- [sourcekit](#sourcekit) -- [sourcery](#sourcery) -- [spectral](#spectral) -- [sqlls](#sqlls) -- [sqls](#sqls) -- [stylelint_lsp](#stylelint_lsp) -- [sumneko_lua](#sumneko_lua) -- [svelte](#svelte) -- [svls](#svls) -- [tailwindcss](#tailwindcss) -- [taplo](#taplo) -- [teal_ls](#teal_ls) -- [terraform_lsp](#terraform_lsp) -- [terraformls](#terraformls) -- [texlab](#texlab) -- [tflint](#tflint) -- [theme_check](#theme_check) -- [tsserver](#tsserver) -- [typeprof](#typeprof) -- [vala_ls](#vala_ls) -- [vdmj](#vdmj) -- [verible](#verible) -- [vimls](#vimls) -- [vls](#vls) -- [volar](#volar) -- [vuels](#vuels) -- [yamlls](#yamlls) -- [zeta_note](#zeta_note) -- [zk](#zk) -- [zls](#zls) - -## 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") - ``` - - -## 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", ".git") - ``` - - -## ansiblels - -https://github.com/ansible/ansible-language-server - -Language server for the ansible configuration management tool. - -`ansible-language-server` can be installed via `npm`: - -```sh -npm install -g @ansible/ansible-language-server -``` - - - -**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" - }, - ansibleLint = { - enabled = true, - path = "ansible-lint" - }, - executionEnvironment = { - enabled = false - }, - python = { - interpreterPath = "python" - } - } - } - ``` - - `single_file_support` : - ```lua - true - ``` - - -## arduino_language_server - -https://github.com/arduino/arduino-language-server - -Language server for Arduino - -The `arduino-language-server` can be installed by running: - go get -u github.com/arduino/arduino-language-server - -The `arduino-cli` tools must also be installed. Follow these instructions for your distro: - https://arduino.github.io/arduino-cli/latest/installation/ - -After installing the `arduino-cli` tools, follow these instructions for generating -a configuration file: - https://arduino.github.io/arduino-cli/latest/getting-started/#create-a-configuration-file -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` be installed. It will look for `clangd` by default but -the binary path can be overridden if need be. - -After all dependencies are installed you'll need to override the lspconfig command for the -language server in your setup function with the necessary configurations: - -```lua -lspconfig.arduino_language_server.setup({ - cmd = { - -- Required - "arduino-language-server", - "-cli-config", "/path/to/arduino-cli.yaml", - -- Optional - "-cli", "/path/to/arduino-cli", - "-clangd", "/path/to/clangd" - } -}) -``` - -For further instruction about configuration options, run `arduino-language-server --help`. - - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.arduino_language_server.setup{} -``` - - -**Default values:** - - `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 - ``` - - -## 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 - ``` - - -## bashls - -https://github.com/mads-hartmann/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" } - ``` - - `cmd_env` : - ```lua - { - GLOB_PATTERN = "*@(.sh|.inc|.bash|.command)" - } - ``` - - `filetypes` : - ```lua - { "sh" } - ``` - - `root_dir` : - ```lua - util.find_git_ancestor - ``` - - `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-langserver", "--stdio" } - ``` - - `filetypes` : - ```lua - { "beancount" } - ``` - - `init_options` : - ```lua - { - journalFile = "", - pythonPath = "python3" - } - ``` - - `root_dir` : - ```lua - root_pattern("elm.json") - ``` - - `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 - ``` - - -## 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") - ``` - - -## 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" } - ``` - - `offset_encoding` : - ```lua - "utf-32" - ``` - - `root_dir` : - ```lua - root_pattern("compile_commands.json", ".ccls", ".git") - ``` - - `single_file_support` : - ```lua - false - ``` - - -## clangd - -https://clangd.llvm.org/installation.html - -**NOTE:** Clang >= 11 is recommended! See [this issue for more](https://github.com/neovim/nvim-lsp/issues/23). - -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" } - ``` - - `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/snoe/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") - ``` - - -## 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(".git", "compile_commands.json", "build") - ``` - - `single_file_support` : - ```lua - true - ``` - - -## codeqlls - -Reference: -https://help.semmle.com/codeql/codeql-cli.html - -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'" - } - ``` - - -## 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 - ``` - - -## 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" } - ``` - - `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 - ``` - - -## 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", "./snapshots/analysis_server.dart.snapshot", "--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 - } - } - ``` - - -## denols - -https://github.com/denoland/deno - -Deno's built-in language server - -To approrpiately 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" } - ``` - - `filetypes` : - ```lua - { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" } - ``` - - `handlers` : - ```lua - { - ["textDocument/definition"] = <function 1>, - ["textDocument/references"] = <function 1> - } - ``` - - `init_options` : - ```lua - { - enable = true, - lint = false, - unstable = false - } - ``` - - `root_dir` : - ```lua - root_pattern("deno.json", "deno.jsonc", "tsconfig.json", ".git") - ``` - - -## 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 - ``` - - -## dockerls - -https://github.com/rcjsuen/dockerfile-language-server-nodejs - -`docker-langserver` can be installed via `npm`: -```sh -npm install -g dockerfile-language-server-nodejs -``` - - - -**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 - ``` - - -## 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 - ``` - - -## 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" }; - ... -} -``` - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.elixirls.setup{} -``` - - -**Default values:** - - `filetypes` : - ```lua - { "elixir", "eelixir" } - ``` - - `root_dir` : - ```lua - root_pattern("mix.exs", ".git") or vim.loop.os_homedir() - ``` - - -## 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 - { - elmAnalyseTrigger = "change" - } - ``` - - `root_dir` : - ```lua - root_pattern("elm.json") - ``` - - -## ember - -https://github.com/lifeart/ember-language-server - -`ember-language-server` can be installed via `npm`: - -```sh -npm install -g @lifeart/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" } - ``` - - `root_dir` : - ```lua - root_pattern("ember-cli-build.js", ".git") - ``` - - -## 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 - { "html", "css" } - ``` - - `root_dir` : - ```lua - git root - ``` - - `single_file_support` : - ```lua - true - ``` - - -## 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://swyddfa.github.io/esbonio/docs/lsp/editors/index.html) - - - -**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: A linting engine for JavaScript / Typescript - -`vscode-eslint-language-server` 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 document on save -```vim -autocmd BufWritePre *.tsx,*.ts,*.jsx,*.js EslintFixAll -``` - -See [vscode-eslint](https://github.com/microsoft/vscode-eslint/blob/55871979d7af184bf09af491b6ea35ebd56822cf/server/src/eslintServer.ts#L216-L229) for configuration options. - -Additional messages you can handle: eslint/noConfig -Messages already handled in lspconfig: eslint/openDoc, eslint/confirmESLintExecution, eslint/probeFailed, eslint/noLibrary - - - -**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" } - ``` - - `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" - }, - format = true, - nodePath = "", - onIgnoredFiles = "off", - packageManager = "npm", - quiet = false, - rulesCustomizations = {}, - run = "onType", - useESLintClass = false, - validate = "on", - workingDirectory = { - mode = "location" - } - } - ``` - - -## 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/hansec/fortran-language-server - -Fortran Language Server for the Language Server Protocol - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.fortls.setup{} -``` - - -**Default values:** - - `cmd` : - ```lua - { "fortls" } - ``` - - `filetypes` : - ```lua - { "fortran" } - ``` - - `root_dir` : - ```lua - root_pattern(".fortls") - ``` - - `settings` : - ```lua - { - nthreads = 1 - } - ``` - - -## 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", "--background-service-enabled" } - ``` - - `filetypes` : - ```lua - { "fsharp" } - ``` - - `init_options` : - ```lua - { - AutomaticWorkspaceInit = true - } - ``` - - `root_dir` : - ```lua - see source file - ``` - - -## 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 - ``` - - -## 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 - { "nc", "localhost", "6008" } - ``` - - `filetypes` : - ```lua - { "gd", "gdscript", "gdscript3" } - ``` - - `root_dir` : - ```lua - util.root_pattern("project.godot", ".git") - ``` - - -## 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") - ``` - - -## 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@v1.42.1 -``` - - - - -**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('go.work') or root_pattern('go.mod', '.golangci.yaml', '.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", "gotmpl" } - ``` - - `root_dir` : - ```lua - root_pattern("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" } - ``` - - `root_dir` : - ```lua - root_pattern("settings.gradle") - ``` - - -## grammarly - -https://github.com/emacs-grammarly/unofficial-grammarly-language-server - -`unofficial-grammarly-language-server` can be installed via `npm`: - -```sh -npm i -g @emacs-grammarly/unofficial-grammarly-language-server -``` - -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 - { "unofficial-grammarly-language-server", "--stdio" } - ``` - - `filetypes` : - ```lua - { "markdown" } - ``` - - `handlers` : - ```lua - { - ["$/updateDocumentState"] = <function 1> - } - ``` - - `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 and create a [GraphQL config file](https://www.graphql-config.com/docs/user/user-introduction). - - - -**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 - root_pattern('.git', '.graphqlrc*', '.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 - ``` - - -## 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 - ``` - - -## 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") - ``` - - -## hls - -https://github.com/haskell/haskell-language-server - -Haskell Language Server - - - -**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("*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml") - ``` - - `settings` : - ```lua - { - haskell = { - 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" } - ``` - - `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 - ``` - - -## 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-api-git/) 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) - -Due to the nature of java, settings cannot be inferred. Please set the following -environmental variables to match your installation. If you need per-project configuration -[direnv](https://github.com/direnv/direnv) is highly recommended. - -```bash -# Mandatory: -# .bashrc -export JDTLS_HOME=/path/to/jdtls_root # Directory with the plugin and configs directories - -# Optional: -export JAVA_HOME=/path/to/java_home # In case you don't have java in path or want to use a version in particular -export WORKSPACE=/path/to/workspace # Defaults to $HOME/workspace -``` -```lua - -- init.lua - require'lspconfig'.jdtls.setup{} -``` - -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 - { "/usr/lib/jvm/temurin-11-jdk-amd64/bin/java", "-Declipse.application=org.eclipse.jdt.ls.core.id1", "-Dosgi.bundles.defaultStartLevel=4", "-Declipse.product=org.eclipse.jdt.ls.core.product", "-Dlog.protocol=true", "-Dlog.level=ALL", "-Xms1g", "-Xmx2G", "--add-modules=ALL-SYSTEM", "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "-jar", "/plugins/org.eclipse.equinox.launcher_*.jar", "-configuration", "config_linux", "-data", "/home/runner/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/runner/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 - ``` - - -## 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") - ``` - - -## 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 - ``` - - -## 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. - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.kotlin_language_server.setup{} -``` - - -**Default values:** - - `cmd` : - ```lua - { "kotlin-language-server" } - ``` - - `filetypes` : - ```lua - { "kotlin" } - ``` - - `root_dir` : - ```lua - root_pattern("settings.gradle") - ``` - - -## 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 at https://download.jboss.org/jbosstools/vscode/stable/lemminx-binary/ and place it in your PATH. - -NOTE to macOS users: Binaries from unidentified developers are blocked by default. If you trust the downloaded binary from jboss.org, 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 - ``` - - -## 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. - -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" } - ``` - - `get_language_id` : - ```lua - see source file - ``` - - `root_dir` : - ```lua - see source file - ``` - - `single_file_support` : - ```lua - true - ``` - - -## 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.html#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`. You can also manually bootstrap Metals with the following command. - -```bash -cs bootstrap \ - --java-opt -Xss4m \ - --java-opt -Xms100m \ - org.scalameta:metals_2.12:<enter-version-here> \ - -r bintray:scalacenter/releases \ - -r sonatype:snapshots \ - -o /usr/local/bin/metals -f -``` - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.metals.setup{} -``` - - -**Default values:** - - `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") - ``` - - -## 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 - ``` - - -## 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 - ``` - - -## 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 prequisite 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 - ``` - - -## 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 - ``` - - -## 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 pin add ocaml-lsp-server https://github.com/ocaml/ocaml-lsp.git -opam install ocaml-lsp-server -``` - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.ocamllsp.setup{} -``` - - -**Default values:** - - `cmd` : - ```lua - { "ocamllsp" } - ``` - - `filetypes` : - ```lua - { "ocaml", "ocaml.menhir", "ocaml.interface", "ocaml.ocamllex", "reason" } - ``` - - `get_language_id` : - ```lua - see source file - ``` - - `root_dir` : - ```lua - root_pattern("*.opam", "esy.json", "package.json", ".git") - ``` - - -## 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") - ``` - - `single_file_support` : - ```lua - true - ``` - - -## 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. - -```lua -local pid = vim.fn.getpid() --- On linux/darwin if using a release build, otherwise under scripts/OmniSharp(.Core)(.cmd) -local omnisharp_bin = "/path/to/omnisharp-repo/run" --- on Windows --- local omnisharp_bin = "/path/to/omnisharp/OmniSharp.exe" -require'lspconfig'.omnisharp.setup{ - cmd = { omnisharp_bin, "--languageserver" , "--hostPID", tostring(pid) }; - ... -} -``` - -Note, if you download the executable for darwin you will need to strip the quarantine label to run: -```bash -find /path/to/omnisharp-osx | xargs xattr -r -d com.apple.quarantine -``` - - - -**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") or root_pattern(".csproj") - ``` - - -## 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") - ``` - - -## 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 - ``` - - -## 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 - ``` - - -## 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", "--version 2.1.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 - -**By default, perlnavigator 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 PerlNavigator repo, install based on the [instructions](https://github.com/bscan/PerlNavigator#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 `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 - {} - ``` - - `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 - ``` - - -## 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") - ``` - - -## 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 - ``` - - -## 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 = "" - } - } - ``` - - -## 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 -`purescript-language-server` can be installed via `npm` -```sh -npm install -g purescript-language-server -``` - - - -**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("spago.dhall, 'psc-package.json', bower.json") - ``` - - -## pylsp - -https://github.com/python-lsp/python-lsp-server - -A Python 3.6+ implementation of the Language Server Protocol. - -The language server can be installed via `pipx install 'python-lsp-server[all]'`. -Further instructions can be found in the [project's README](https://github.com/python-lsp/python-lsp-server). - -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 - ``` - - -## 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 - -**Default values:** - - `cmd` : - ```lua - { "pyright-langserver", "--stdio" } - ``` - - `filetypes` : - ```lua - { "python" } - ``` - - `root_dir` : - ```lua - see source file - ``` - - `settings` : - ```lua - { - python = { - analysis = { - autoSearchPaths = true, - diagnosticMode = "workspace", - useLibraryCodeForTypes = true - } - } - } - ``` - - `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" } - ``` - - `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 - ``` - - -## reason_ls - -Reason language server - -**By default, reason_ls 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. - -You can install reason language server from [reason-language-server](https://github.com/jaredly/reason-language-server) repository. - -```lua -cmd = {'<path_to_reason_language_server>'} -``` - - - -**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 - ``` - - -## 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 - -ReScript language server - -**By default, rescriptls 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. - -You can use the bundled language server inside the [vim-rescript](https://github.com/rescript-lang/vim-rescript) repo. - -Clone the vim-rescript repo and point `cmd` to `server.js` inside `server/out` directory: - -```lua -cmd = {'node', '<path_to_repo>/server/out/server.js', '--stdio'} - -``` - -If you have vim-rescript installed you can also use that installation. for example if you're using packer.nvim you can set cmd to something like this: - -```lua -cmd = { - 'node', - '/home/username/.local/share/nvim/site/pack/packer/start/vim-rescript/server/out/server.js', - '--stdio' -} -``` - -Another option is to use vscode extension [release](https://github.com/rescript-lang/rescript-vscode/releases). -Take a look at [here](https://github.com/rescript-lang/rescript-vscode#use-with-other-editors) for instructions. - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.rescriptls.setup{} -``` - - -**Default values:** - - `cmd` : - ```lua - {} - ``` - - `filetypes` : - ```lua - { "rescript" } - ``` - - `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')(fname) or util.find_git_ancestor(fname) - ``` - - -## rome - -https://rome.tools - -Language server for the Rome Frontend Toolchain. - -```sh -npm install [-g] rome -``` - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.rome.setup{} -``` - - -**Default values:** - - `cmd` : - ```lua - { "rome", "lsp" } - ``` - - `filetypes` : - ```lua - { "javascript", "javascriptreact", "json", "typescript", "typescript.tsx", "typescriptreact" } - ``` - - `root_dir` : - ```lua - root_pattern('package.json', 'node_modules', '.git') - ``` - - `single_file_support` : - ```lua - true - ``` - - -## rust_analyzer - -https://github.com/rust-analyzer/rust-analyzer - -rust-analyzer (aka rls 2.0), a language server for Rust - -See [docs](https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/user#settings) for extra settings. - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.rust_analyzer.setup{} -``` -**Commands:** -- CargoReload: Reload current cargo workspace - -**Default values:** - - `cmd` : - ```lua - { "rust-analyzer" } - ``` - - `filetypes` : - ```lua - { "rust" } - ``` - - `root_dir` : - ```lua - root_pattern("Cargo.toml", "rust-project.json") - ``` - - `settings` : - ```lua - { - ["rust-analyzer"] = {} - } - ``` - - -## 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 - ``` - - -## 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") - ``` - - -## 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 - ``` - - -## 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 - ``` - - -## 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", "ewasm" } - ``` - - `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(".git") - ``` - - -## solidity_ls - -npm install -g solidity-language-server - -solidity-language-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 - { "solidity-language-server", "--stdio" } - ``` - - `filetypes` : - ```lua - { "solidity" } - ``` - - `root_dir` : - ```lua - root_pattern(".git", "package.json") - ``` - - -## 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("Package.swift", ".git") - ``` - - -## sourcery - -https://github.com/sourcery-ai/sourcery - -Refactor Python instantly using the power of AI. - -It requires the initializationOptions param to be populated as shown below and will respond with the list of ServerCapabilities that it supports. - -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' -} - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.sourcery.setup{} -``` - - -**Default values:** - - `cmd` : - ```lua - { "sourcery", "lsp" } - ``` - - `filetypes` : - ```lua - { "python" } - ``` - - `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 - ``` - - -## 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/lighttiger2505/sqls - -```lua -require'lspconfig'.sqls.setup{ - cmd = {"path/to/command", "-config", "path/to/config.yml"}; - ... -} -``` -Sqls can be installed via `go get github.com/lighttiger2505/sqls`. Instructions for compiling Sqls from the source can be found at [lighttiger2505/sqls](https://github.com/lighttiger2505/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 - ``` - - -## 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 - root_pattern('.stylelintrc', 'package.json') - ``` - - `settings` : - ```lua - {} - ``` - - -## sumneko_lua - -https://github.com/sumneko/lua-language-server - -Lua language server. - -`lua-language-server` can be installed by following the instructions [here](https://github.com/sumneko/lua-language-server/wiki/Build-and-Run). The default `cmd` assumes that the `lua-language-server` binary can be found in `$PATH`. - -```lua -local runtime_path = vim.split(package.path, ';') -table.insert(runtime_path, "lua/?.lua") -table.insert(runtime_path, "lua/?/init.lua") - -require'lspconfig'.sumneko_lua.setup { - settings = { - Lua = { - runtime = { - -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) - version = 'LuaJIT', - -- Setup your lua path - path = runtime_path, - }, - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = {'vim'}, - }, - workspace = { - -- Make the server aware of Neovim runtime files - library = vim.api.nvim_get_runtime_file("", true), - }, - -- Do not send telemetry data containing a randomized but unique identifier - telemetry = { - enable = false, - }, - }, - }, -} -``` - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.sumneko_lua.setup{} -``` - - -**Default values:** - - `cmd` : - ```lua - { "lua-language-server" } - ``` - - `filetypes` : - ```lua - { "lua" } - ``` - - `log_level` : - ```lua - 2 - ``` - - `root_dir` : - ```lua - root_pattern(".luarc.json", ".luacheckrc", ".stylua.toml", "selene.toml", ".git") - ``` - - `settings` : - ```lua - { - Lua = { - telemetry = { - enable = false - } - } - } - ``` - - `single_file_support` : - ```lua - true - ``` - - -## svelte - -https://github.com/sveltejs/language-tools/tree/master/packages/language-server - -`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") - ``` - - -## 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 - ``` - - -## 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", "django-html", "htmldjango", "edge", "eelixir", "ejs", "erb", "eruby", "gohtml", "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" } - ``` - - `init_options` : - ```lua - { - userLanguages = { - eelixir = "html-eex", - eruby = "erb" - } - } - ``` - - `on_new_config` : - ```lua - see source file - ``` - - `root_dir` : - ```lua - root_pattern('tailwind.config.js', 'tailwind.config.ts', 'postcss.config.js', 'postcss.config.ts', 'package.json', 'node_modules', '.git') - ``` - - `settings` : - ```lua - { - tailwindCSS = { - classAttributes = { "class", "className", "classList", "ngClass" }, - lint = { - cssConflict = "warning", - invalidApply = "error", - invalidConfigPath = "error", - invalidScreen = "error", - invalidTailwindDirective = "error", - invalidVariant = "error", - recommendedVariantOrder = "warning" - }, - validate = true - } - } - ``` - - -## taplo - -https://taplo.tamasfe.dev/lsp/ - -Language server for Taplo, a TOML toolkit. - -`taplo-cli` can be installed via `cargo`: -```sh -cargo install --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 - ``` - - -## 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") - ``` - - -## 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) - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.terraformls.setup{} -``` - - -**Default values:** - - `cmd` : - ```lua - { "terraform-ls", "serve" } - ``` - - `filetypes` : - ```lua - { "terraform" } - ``` - - `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/blob/master/docs/options.md 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", "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 - ``` - - -## 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 - {} - ``` - - -## tsserver - -https://github.com/theia-ide/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 type 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'.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("package.json", "tsconfig.json", "jsconfig.json", ".git") - ``` - - -## 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") - ``` - - -## 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 - ``` - - -## 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/com/fujitsu", - 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 - ``` - - -## 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 - }, - iskeyword = "@,48-57,_,192-255,-#", - runtimepath = "", - suggest = { - fromRuntimepath = true, - fromVimruntime = true - }, - vimruntime = "" - } - ``` - - `root_dir` : - ```lua - see source file - ``` - - -## 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). - -**By default, v-language-server 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 and compiled v-language-server. - -```lua --- set the path to the vls installation; -local vls_root_path = vim.fn.stdpath('cache')..'/lspconfig/vls' -local vls_binary = vls_root_path.."/cmd/vls/vls" - -require'lspconfig'.vls.setup { - cmd = {vls_binary}, -} -``` - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.vls.setup{} -``` - - -**Default values:** - - `filetypes` : - ```lua - { "vlang" } - ``` - - `root_dir` : - ```lua - root_pattern("v.mod", ".git") - ``` - - -## volar - -https://github.com/johnsoncodehk/volar/tree/master/packages/vue-language-server - -Volar language server for Vue - -Volar can be installed via npm: - -```sh -npm install -g @volar/vue-language-server -``` - -Volar by default supports Vue 3 projects. Vue 2 projects need [additional configuration](https://github.com/johnsoncodehk/volar/blob/master/extensions/vscode-vue-language-features/README.md?plain=1#L28-L63). - -**Take Over Mode** -Volar 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. The alternatives are: - -- use a global TypeScript Server installation - -```lua -require'lspconfig'.volar.setup{ - init_options = { - typescript = { - serverPath = '/path/to/.npm/lib/node_modules/typescript/lib/tsserverlib.js' - } - } -} -``` - -- use a global TypeScript Server installation if a local server is not found - -```lua -local util = require 'lspconfig.util' - -local function get_typescript_server_path(root_dir) - local project_root = util.find_node_modules_ancestor(root_dir) - - local local_tsserverlib = project_root ~= nil and util.path.join(project_root, 'node_modules', 'typescript', 'lib', 'tsserverlibrary.js') - local global_tsserverlib = '/home/[yourusernamehere]/.npm/lib/node_modules/typescript/lib/tsserverlibrary.js' - - if local_tsserverlib and util.path.exists(local_tsserverlib) then - return local_tsserverlib - else - return global_tsserverlib - end -end - -require'lspconfig'.volar.setup{ - on_new_config = function(new_config, new_root_dir) - new_config.init_options.typescript.serverPath = 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 - { - documentFeatures = { - documentColor = false, - documentFormatting = { - defaultPrintWidth = 100 - }, - documentSymbol = true, - foldingRange = true, - linkedEditingRange = true, - selectionRange = true - }, - languageFeatures = { - callHierarchy = true, - codeAction = true, - codeLens = true, - completion = { - defaultAttrNameCase = "kebabCase", - defaultTagNameCase = "both" - }, - definition = true, - diagnostics = true, - documentHighlight = true, - documentLink = true, - hover = true, - implementation = true, - references = true, - rename = true, - renameFileRefactoring = true, - schemaRequestService = true, - semanticTokens = false, - signatureHelp = true, - typeDefinition = true - }, - typescript = { - serverPath = "" - } - } - ``` - - `on_new_config` : - ```lua - see source file - ``` - - `root_dir` : - ```lua - see source file - ``` - - -## 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") - ``` - - -## 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" } - ``` - - `root_dir` : - ```lua - util.find_git_ancestor - ``` - - `settings` : - ```lua - { - redhat = { - telemetry = { - enabled = false - } - } - } - ``` - - `single_file_support` : - ```lua - true - ``` - - -## zeta_note - -https://github.com/artempyanykh/zeta-note - -Markdown LSP server for easy note-taking with cross-references and diagnostics. - -Binaries can be downloaded from https://github.com/artempyanykh/zeta-note/releases - -**By default, zeta-note 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 zeta-note binary. - -```lua -require'lspconfig'.zeta_note.setup{ - cmd = {'path/to/zeta-note'} -} -``` - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.zeta_note.setup{} -``` - - -**Default values:** - - `filetypes` : - ```lua - { "markdown" } - ``` - - `root_dir` : - ```lua - root_pattern(".zeta.toml") - ``` - - -## zk - -github.com/mickael-menu/zk - -A plain text note-taking assistant - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.zk.setup{} -``` -**Commands:** -- ZkIndex: Index -- 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", ".git") - ``` - - `single_file_support` : - ```lua - true - ``` - - - -vim:ft=markdown diff --git a/start/lspconfig-0.1.3/doc/server_configurations.txt b/start/lspconfig-0.1.3/doc/server_configurations.txt deleted file mode 100644 index 426c422..0000000 --- a/start/lspconfig-0.1.3/doc/server_configurations.txt +++ /dev/null @@ -1,6554 +0,0 @@ -# Configurations -<!-- *lspconfig-server-configurations* --> - -The following LSP configs are included. This documentation is autogenerated from the lua files. Follow a link to find documentation for -that config. This file is accessible in neovim via `:help lspconfig-server-configurations` - -- [als](#als) -- [angularls](#angularls) -- [ansiblels](#ansiblels) -- [arduino_language_server](#arduino_language_server) -- [asm_lsp](#asm_lsp) -- [awk_ls](#awk_ls) -- [bashls](#bashls) -- [beancount](#beancount) -- [bicep](#bicep) -- [bsl_ls](#bsl_ls) -- [ccls](#ccls) -- [clangd](#clangd) -- [clarity_lsp](#clarity_lsp) -- [clojure_lsp](#clojure_lsp) -- [cmake](#cmake) -- [codeqlls](#codeqlls) -- [crystalline](#crystalline) -- [csharp_ls](#csharp_ls) -- [cssls](#cssls) -- [cssmodules_ls](#cssmodules_ls) -- [cucumber_language_server](#cucumber_language_server) -- [dartls](#dartls) -- [denols](#denols) -- [dhall_lsp_server](#dhall_lsp_server) -- [diagnosticls](#diagnosticls) -- [dockerls](#dockerls) -- [dotls](#dotls) -- [efm](#efm) -- [elixirls](#elixirls) -- [elmls](#elmls) -- [ember](#ember) -- [emmet_ls](#emmet_ls) -- [erlangls](#erlangls) -- [esbonio](#esbonio) -- [eslint](#eslint) -- [flow](#flow) -- [flux_lsp](#flux_lsp) -- [foam_ls](#foam_ls) -- [fortls](#fortls) -- [fsautocomplete](#fsautocomplete) -- [fstar](#fstar) -- [gdscript](#gdscript) -- [ghcide](#ghcide) -- [golangci_lint_ls](#golangci_lint_ls) -- [gopls](#gopls) -- [gradle_ls](#gradle_ls) -- [grammarly](#grammarly) -- [graphql](#graphql) -- [groovyls](#groovyls) -- [haxe_language_server](#haxe_language_server) -- [hdl_checker](#hdl_checker) -- [hhvm](#hhvm) -- [hie](#hie) -- [hls](#hls) -- [hoon_ls](#hoon_ls) -- [html](#html) -- [idris2_lsp](#idris2_lsp) -- [intelephense](#intelephense) -- [java_language_server](#java_language_server) -- [jdtls](#jdtls) -- [jedi_language_server](#jedi_language_server) -- [jsonls](#jsonls) -- [jsonnet_ls](#jsonnet_ls) -- [julials](#julials) -- [kotlin_language_server](#kotlin_language_server) -- [lean3ls](#lean3ls) -- [leanls](#leanls) -- [lelwel_ls](#lelwel_ls) -- [lemminx](#lemminx) -- [ltex](#ltex) -- [metals](#metals) -- [mint](#mint) -- [mm0_ls](#mm0_ls) -- [nickel_ls](#nickel_ls) -- [nimls](#nimls) -- [ocamlls](#ocamlls) -- [ocamllsp](#ocamllsp) -- [ols](#ols) -- [omnisharp](#omnisharp) -- [opencl_ls](#opencl_ls) -- [openscad_ls](#openscad_ls) -- [pasls](#pasls) -- [perlls](#perlls) -- [perlnavigator](#perlnavigator) -- [perlpls](#perlpls) -- [phpactor](#phpactor) -- [please](#please) -- [powershell_es](#powershell_es) -- [prismals](#prismals) -- [prosemd_lsp](#prosemd_lsp) -- [psalm](#psalm) -- [puppet](#puppet) -- [purescriptls](#purescriptls) -- [pylsp](#pylsp) -- [pyre](#pyre) -- [pyright](#pyright) -- [quick_lint_js](#quick_lint_js) -- [r_language_server](#r_language_server) -- [racket_langserver](#racket_langserver) -- [reason_ls](#reason_ls) -- [remark_ls](#remark_ls) -- [rescriptls](#rescriptls) -- [rls](#rls) -- [rnix](#rnix) -- [robotframework_ls](#robotframework_ls) -- [rome](#rome) -- [rust_analyzer](#rust_analyzer) -- [salt_ls](#salt_ls) -- [scry](#scry) -- [serve_d](#serve_d) -- [sixtyfps](#sixtyfps) -- [slint_lsp](#slint_lsp) -- [solang](#solang) -- [solargraph](#solargraph) -- [solc](#solc) -- [solidity_ls](#solidity_ls) -- [sorbet](#sorbet) -- [sourcekit](#sourcekit) -- [sourcery](#sourcery) -- [spectral](#spectral) -- [sqlls](#sqlls) -- [sqls](#sqls) -- [stylelint_lsp](#stylelint_lsp) -- [sumneko_lua](#sumneko_lua) -- [svelte](#svelte) -- [svls](#svls) -- [tailwindcss](#tailwindcss) -- [taplo](#taplo) -- [teal_ls](#teal_ls) -- [terraform_lsp](#terraform_lsp) -- [terraformls](#terraformls) -- [texlab](#texlab) -- [tflint](#tflint) -- [theme_check](#theme_check) -- [tsserver](#tsserver) -- [typeprof](#typeprof) -- [vala_ls](#vala_ls) -- [vdmj](#vdmj) -- [verible](#verible) -- [vimls](#vimls) -- [vls](#vls) -- [volar](#volar) -- [vuels](#vuels) -- [yamlls](#yamlls) -- [zeta_note](#zeta_note) -- [zk](#zk) -- [zls](#zls) - -## 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") - ``` - - -## 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", ".git") - ``` - - -## ansiblels - -https://github.com/ansible/ansible-language-server - -Language server for the ansible configuration management tool. - -`ansible-language-server` can be installed via `npm`: - -```sh -npm install -g @ansible/ansible-language-server -``` - - - -**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" - }, - ansibleLint = { - enabled = true, - path = "ansible-lint" - }, - executionEnvironment = { - enabled = false - }, - python = { - interpreterPath = "python" - } - } - } - ``` - - `single_file_support` : - ```lua - true - ``` - - -## arduino_language_server - -https://github.com/arduino/arduino-language-server - -Language server for Arduino - -The `arduino-language-server` can be installed by running: - go get -u github.com/arduino/arduino-language-server - -The `arduino-cli` tools must also be installed. Follow these instructions for your distro: - https://arduino.github.io/arduino-cli/latest/installation/ - -After installing the `arduino-cli` tools, follow these instructions for generating -a configuration file: - https://arduino.github.io/arduino-cli/latest/getting-started/#create-a-configuration-file -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` be installed. It will look for `clangd` by default but -the binary path can be overridden if need be. - -After all dependencies are installed you'll need to override the lspconfig command for the -language server in your setup function with the necessary configurations: - -```lua -lspconfig.arduino_language_server.setup({ - cmd = { - -- Required - "arduino-language-server", - "-cli-config", "/path/to/arduino-cli.yaml", - -- Optional - "-cli", "/path/to/arduino-cli", - "-clangd", "/path/to/clangd" - } -}) -``` - -For further instruction about configuration options, run `arduino-language-server --help`. - - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.arduino_language_server.setup{} -``` - - -**Default values:** - - `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 - ``` - - -## 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 - ``` - - -## bashls - -https://github.com/mads-hartmann/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" } - ``` - - `cmd_env` : - ```lua - { - GLOB_PATTERN = "*@(.sh|.inc|.bash|.command)" - } - ``` - - `filetypes` : - ```lua - { "sh" } - ``` - - `root_dir` : - ```lua - util.find_git_ancestor - ``` - - `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-langserver", "--stdio" } - ``` - - `filetypes` : - ```lua - { "beancount" } - ``` - - `init_options` : - ```lua - { - journalFile = "", - pythonPath = "python3" - } - ``` - - `root_dir` : - ```lua - root_pattern("elm.json") - ``` - - `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 - ``` - - -## 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") - ``` - - -## 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" } - ``` - - `offset_encoding` : - ```lua - "utf-32" - ``` - - `root_dir` : - ```lua - root_pattern("compile_commands.json", ".ccls", ".git") - ``` - - `single_file_support` : - ```lua - false - ``` - - -## clangd - -https://clangd.llvm.org/installation.html - -**NOTE:** Clang >= 11 is recommended! See [this issue for more](https://github.com/neovim/nvim-lsp/issues/23). - -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" } - ``` - - `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/snoe/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") - ``` - - -## 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(".git", "compile_commands.json", "build") - ``` - - `single_file_support` : - ```lua - true - ``` - - -## codeqlls - -Reference: -https://help.semmle.com/codeql/codeql-cli.html - -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'" - } - ``` - - -## 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 - ``` - - -## 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" } - ``` - - `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 - ``` - - -## 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", "./snapshots/analysis_server.dart.snapshot", "--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 - } - } - ``` - - -## denols - -https://github.com/denoland/deno - -Deno's built-in language server - -To approrpiately 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" } - ``` - - `filetypes` : - ```lua - { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" } - ``` - - `handlers` : - ```lua - { - ["textDocument/definition"] = <function 1>, - ["textDocument/references"] = <function 1> - } - ``` - - `init_options` : - ```lua - { - enable = true, - lint = false, - unstable = false - } - ``` - - `root_dir` : - ```lua - root_pattern("deno.json", "deno.jsonc", "tsconfig.json", ".git") - ``` - - -## 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 - ``` - - -## dockerls - -https://github.com/rcjsuen/dockerfile-language-server-nodejs - -`docker-langserver` can be installed via `npm`: -```sh -npm install -g dockerfile-language-server-nodejs -``` - - - -**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 - ``` - - -## 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 - ``` - - -## 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" }; - ... -} -``` - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.elixirls.setup{} -``` - - -**Default values:** - - `filetypes` : - ```lua - { "elixir", "eelixir" } - ``` - - `root_dir` : - ```lua - root_pattern("mix.exs", ".git") or vim.loop.os_homedir() - ``` - - -## 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 - { - elmAnalyseTrigger = "change" - } - ``` - - `root_dir` : - ```lua - root_pattern("elm.json") - ``` - - -## ember - -https://github.com/lifeart/ember-language-server - -`ember-language-server` can be installed via `npm`: - -```sh -npm install -g @lifeart/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" } - ``` - - `root_dir` : - ```lua - root_pattern("ember-cli-build.js", ".git") - ``` - - -## 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 - { "html", "css" } - ``` - - `root_dir` : - ```lua - git root - ``` - - `single_file_support` : - ```lua - true - ``` - - -## 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://swyddfa.github.io/esbonio/docs/lsp/editors/index.html) - - - -**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: A linting engine for JavaScript / Typescript - -`vscode-eslint-language-server` 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 document on save -```vim -autocmd BufWritePre *.tsx,*.ts,*.jsx,*.js EslintFixAll -``` - -See [vscode-eslint](https://github.com/microsoft/vscode-eslint/blob/55871979d7af184bf09af491b6ea35ebd56822cf/server/src/eslintServer.ts#L216-L229) for configuration options. - -Additional messages you can handle: eslint/noConfig -Messages already handled in lspconfig: eslint/openDoc, eslint/confirmESLintExecution, eslint/probeFailed, eslint/noLibrary - - - -**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" } - ``` - - `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" - }, - format = true, - nodePath = "", - onIgnoredFiles = "off", - packageManager = "npm", - quiet = false, - rulesCustomizations = {}, - run = "onType", - useESLintClass = false, - validate = "on", - workingDirectory = { - mode = "location" - } - } - ``` - - -## 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/hansec/fortran-language-server - -Fortran Language Server for the Language Server Protocol - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.fortls.setup{} -``` - - -**Default values:** - - `cmd` : - ```lua - { "fortls" } - ``` - - `filetypes` : - ```lua - { "fortran" } - ``` - - `root_dir` : - ```lua - root_pattern(".fortls") - ``` - - `settings` : - ```lua - { - nthreads = 1 - } - ``` - - -## 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", "--background-service-enabled" } - ``` - - `filetypes` : - ```lua - { "fsharp" } - ``` - - `init_options` : - ```lua - { - AutomaticWorkspaceInit = true - } - ``` - - `root_dir` : - ```lua - see source file - ``` - - -## 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 - ``` - - -## 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 - { "nc", "localhost", "6008" } - ``` - - `filetypes` : - ```lua - { "gd", "gdscript", "gdscript3" } - ``` - - `root_dir` : - ```lua - util.root_pattern("project.godot", ".git") - ``` - - -## 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") - ``` - - -## 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@v1.42.1 -``` - - - - -**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('go.work') or root_pattern('go.mod', '.golangci.yaml', '.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", "gotmpl" } - ``` - - `root_dir` : - ```lua - root_pattern("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" } - ``` - - `root_dir` : - ```lua - root_pattern("settings.gradle") - ``` - - -## grammarly - -https://github.com/emacs-grammarly/unofficial-grammarly-language-server - -`unofficial-grammarly-language-server` can be installed via `npm`: - -```sh -npm i -g @emacs-grammarly/unofficial-grammarly-language-server -``` - -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 - { "unofficial-grammarly-language-server", "--stdio" } - ``` - - `filetypes` : - ```lua - { "markdown" } - ``` - - `handlers` : - ```lua - { - ["$/updateDocumentState"] = <function 1> - } - ``` - - `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 and create a [GraphQL config file](https://www.graphql-config.com/docs/user/user-introduction). - - - -**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 - root_pattern('.git', '.graphqlrc*', '.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 - ``` - - -## 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 - ``` - - -## 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") - ``` - - -## hls - -https://github.com/haskell/haskell-language-server - -Haskell Language Server - - - -**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("*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml") - ``` - - `settings` : - ```lua - { - haskell = { - 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" } - ``` - - `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 - ``` - - -## 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-api-git/) 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) - -Due to the nature of java, settings cannot be inferred. Please set the following -environmental variables to match your installation. If you need per-project configuration -[direnv](https://github.com/direnv/direnv) is highly recommended. - -```bash -# Mandatory: -# .bashrc -export JDTLS_HOME=/path/to/jdtls_root # Directory with the plugin and configs directories - -# Optional: -export JAVA_HOME=/path/to/java_home # In case you don't have java in path or want to use a version in particular -export WORKSPACE=/path/to/workspace # Defaults to $HOME/workspace -``` -```lua - -- init.lua - require'lspconfig'.jdtls.setup{} -``` - -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 - { "/usr/lib/jvm/temurin-11-jdk-amd64/bin/java", "-Declipse.application=org.eclipse.jdt.ls.core.id1", "-Dosgi.bundles.defaultStartLevel=4", "-Declipse.product=org.eclipse.jdt.ls.core.product", "-Dlog.protocol=true", "-Dlog.level=ALL", "-Xms1g", "-Xmx2G", "--add-modules=ALL-SYSTEM", "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "-jar", "/plugins/org.eclipse.equinox.launcher_*.jar", "-configuration", "config_linux", "-data", "/home/runner/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/runner/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 - ``` - - -## 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") - ``` - - -## 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 - ``` - - -## 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. - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.kotlin_language_server.setup{} -``` - - -**Default values:** - - `cmd` : - ```lua - { "kotlin-language-server" } - ``` - - `filetypes` : - ```lua - { "kotlin" } - ``` - - `root_dir` : - ```lua - root_pattern("settings.gradle") - ``` - - -## 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 at https://download.jboss.org/jbosstools/vscode/stable/lemminx-binary/ and place it in your PATH. - -NOTE to macOS users: Binaries from unidentified developers are blocked by default. If you trust the downloaded binary from jboss.org, 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 - ``` - - -## 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. - -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" } - ``` - - `get_language_id` : - ```lua - see source file - ``` - - `root_dir` : - ```lua - see source file - ``` - - `single_file_support` : - ```lua - true - ``` - - -## 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.html#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`. You can also manually bootstrap Metals with the following command. - -```bash -cs bootstrap \ - --java-opt -Xss4m \ - --java-opt -Xms100m \ - org.scalameta:metals_2.12:<enter-version-here> \ - -r bintray:scalacenter/releases \ - -r sonatype:snapshots \ - -o /usr/local/bin/metals -f -``` - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.metals.setup{} -``` - - -**Default values:** - - `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") - ``` - - -## 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 - ``` - - -## 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 - ``` - - -## 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 prequisite 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 - ``` - - -## 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 - ``` - - -## 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 pin add ocaml-lsp-server https://github.com/ocaml/ocaml-lsp.git -opam install ocaml-lsp-server -``` - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.ocamllsp.setup{} -``` - - -**Default values:** - - `cmd` : - ```lua - { "ocamllsp" } - ``` - - `filetypes` : - ```lua - { "ocaml", "ocaml.menhir", "ocaml.interface", "ocaml.ocamllex", "reason" } - ``` - - `get_language_id` : - ```lua - see source file - ``` - - `root_dir` : - ```lua - root_pattern("*.opam", "esy.json", "package.json", ".git") - ``` - - -## 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") - ``` - - `single_file_support` : - ```lua - true - ``` - - -## 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. - -```lua -local pid = vim.fn.getpid() --- On linux/darwin if using a release build, otherwise under scripts/OmniSharp(.Core)(.cmd) -local omnisharp_bin = "/path/to/omnisharp-repo/run" --- on Windows --- local omnisharp_bin = "/path/to/omnisharp/OmniSharp.exe" -require'lspconfig'.omnisharp.setup{ - cmd = { omnisharp_bin, "--languageserver" , "--hostPID", tostring(pid) }; - ... -} -``` - -Note, if you download the executable for darwin you will need to strip the quarantine label to run: -```bash -find /path/to/omnisharp-osx | xargs xattr -r -d com.apple.quarantine -``` - - - -**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") or root_pattern(".csproj") - ``` - - -## 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") - ``` - - -## 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 - ``` - - -## 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 - ``` - - -## 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", "--version 2.1.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 - -**By default, perlnavigator 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 PerlNavigator repo, install based on the [instructions](https://github.com/bscan/PerlNavigator#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 `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 - {} - ``` - - `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 - ``` - - -## 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") - ``` - - -## 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 - ``` - - -## 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 = "" - } - } - ``` - - -## 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 -`purescript-language-server` can be installed via `npm` -```sh -npm install -g purescript-language-server -``` - - - -**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("spago.dhall, 'psc-package.json', bower.json") - ``` - - -## pylsp - -https://github.com/python-lsp/python-lsp-server - -A Python 3.6+ implementation of the Language Server Protocol. - -The language server can be installed via `pipx install 'python-lsp-server[all]'`. -Further instructions can be found in the [project's README](https://github.com/python-lsp/python-lsp-server). - -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 - ``` - - -## 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 - -**Default values:** - - `cmd` : - ```lua - { "pyright-langserver", "--stdio" } - ``` - - `filetypes` : - ```lua - { "python" } - ``` - - `root_dir` : - ```lua - see source file - ``` - - `settings` : - ```lua - { - python = { - analysis = { - autoSearchPaths = true, - diagnosticMode = "workspace", - useLibraryCodeForTypes = true - } - } - } - ``` - - `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" } - ``` - - `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 - ``` - - -## reason_ls - -Reason language server - -**By default, reason_ls 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. - -You can install reason language server from [reason-language-server](https://github.com/jaredly/reason-language-server) repository. - -```lua -cmd = {'<path_to_reason_language_server>'} -``` - - - -**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 - ``` - - -## 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 - -ReScript language server - -**By default, rescriptls 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. - -You can use the bundled language server inside the [vim-rescript](https://github.com/rescript-lang/vim-rescript) repo. - -Clone the vim-rescript repo and point `cmd` to `server.js` inside `server/out` directory: - -```lua -cmd = {'node', '<path_to_repo>/server/out/server.js', '--stdio'} - -``` - -If you have vim-rescript installed you can also use that installation. for example if you're using packer.nvim you can set cmd to something like this: - -```lua -cmd = { - 'node', - '/home/username/.local/share/nvim/site/pack/packer/start/vim-rescript/server/out/server.js', - '--stdio' -} -``` - -Another option is to use vscode extension [release](https://github.com/rescript-lang/rescript-vscode/releases). -Take a look at [here](https://github.com/rescript-lang/rescript-vscode#use-with-other-editors) for instructions. - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.rescriptls.setup{} -``` - - -**Default values:** - - `cmd` : - ```lua - {} - ``` - - `filetypes` : - ```lua - { "rescript" } - ``` - - `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')(fname) or util.find_git_ancestor(fname) - ``` - - -## rome - -https://rome.tools - -Language server for the Rome Frontend Toolchain. - -```sh -npm install [-g] rome -``` - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.rome.setup{} -``` - - -**Default values:** - - `cmd` : - ```lua - { "rome", "lsp" } - ``` - - `filetypes` : - ```lua - { "javascript", "javascriptreact", "json", "typescript", "typescript.tsx", "typescriptreact" } - ``` - - `root_dir` : - ```lua - root_pattern('package.json', 'node_modules', '.git') - ``` - - `single_file_support` : - ```lua - true - ``` - - -## rust_analyzer - -https://github.com/rust-analyzer/rust-analyzer - -rust-analyzer (aka rls 2.0), a language server for Rust - -See [docs](https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/user#settings) for extra settings. - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.rust_analyzer.setup{} -``` -**Commands:** -- CargoReload: Reload current cargo workspace - -**Default values:** - - `cmd` : - ```lua - { "rust-analyzer" } - ``` - - `filetypes` : - ```lua - { "rust" } - ``` - - `root_dir` : - ```lua - root_pattern("Cargo.toml", "rust-project.json") - ``` - - `settings` : - ```lua - { - ["rust-analyzer"] = {} - } - ``` - - -## 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 - ``` - - -## 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") - ``` - - -## 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 - ``` - - -## 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 - ``` - - -## 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", "ewasm" } - ``` - - `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(".git") - ``` - - -## solidity_ls - -npm install -g solidity-language-server - -solidity-language-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 - { "solidity-language-server", "--stdio" } - ``` - - `filetypes` : - ```lua - { "solidity" } - ``` - - `root_dir` : - ```lua - root_pattern(".git", "package.json") - ``` - - -## 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("Package.swift", ".git") - ``` - - -## sourcery - -https://github.com/sourcery-ai/sourcery - -Refactor Python instantly using the power of AI. - -It requires the initializationOptions param to be populated as shown below and will respond with the list of ServerCapabilities that it supports. - -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' -} - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.sourcery.setup{} -``` - - -**Default values:** - - `cmd` : - ```lua - { "sourcery", "lsp" } - ``` - - `filetypes` : - ```lua - { "python" } - ``` - - `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 - ``` - - -## 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/lighttiger2505/sqls - -```lua -require'lspconfig'.sqls.setup{ - cmd = {"path/to/command", "-config", "path/to/config.yml"}; - ... -} -``` -Sqls can be installed via `go get github.com/lighttiger2505/sqls`. Instructions for compiling Sqls from the source can be found at [lighttiger2505/sqls](https://github.com/lighttiger2505/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 - ``` - - -## 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 - root_pattern('.stylelintrc', 'package.json') - ``` - - `settings` : - ```lua - {} - ``` - - -## sumneko_lua - -https://github.com/sumneko/lua-language-server - -Lua language server. - -`lua-language-server` can be installed by following the instructions [here](https://github.com/sumneko/lua-language-server/wiki/Build-and-Run). The default `cmd` assumes that the `lua-language-server` binary can be found in `$PATH`. - -```lua -local runtime_path = vim.split(package.path, ';') -table.insert(runtime_path, "lua/?.lua") -table.insert(runtime_path, "lua/?/init.lua") - -require'lspconfig'.sumneko_lua.setup { - settings = { - Lua = { - runtime = { - -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) - version = 'LuaJIT', - -- Setup your lua path - path = runtime_path, - }, - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = {'vim'}, - }, - workspace = { - -- Make the server aware of Neovim runtime files - library = vim.api.nvim_get_runtime_file("", true), - }, - -- Do not send telemetry data containing a randomized but unique identifier - telemetry = { - enable = false, - }, - }, - }, -} -``` - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.sumneko_lua.setup{} -``` - - -**Default values:** - - `cmd` : - ```lua - { "lua-language-server" } - ``` - - `filetypes` : - ```lua - { "lua" } - ``` - - `log_level` : - ```lua - 2 - ``` - - `root_dir` : - ```lua - root_pattern(".luarc.json", ".luacheckrc", ".stylua.toml", "selene.toml", ".git") - ``` - - `settings` : - ```lua - { - Lua = { - telemetry = { - enable = false - } - } - } - ``` - - `single_file_support` : - ```lua - true - ``` - - -## svelte - -https://github.com/sveltejs/language-tools/tree/master/packages/language-server - -`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") - ``` - - -## 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 - ``` - - -## 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", "django-html", "htmldjango", "edge", "eelixir", "ejs", "erb", "eruby", "gohtml", "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" } - ``` - - `init_options` : - ```lua - { - userLanguages = { - eelixir = "html-eex", - eruby = "erb" - } - } - ``` - - `on_new_config` : - ```lua - see source file - ``` - - `root_dir` : - ```lua - root_pattern('tailwind.config.js', 'tailwind.config.ts', 'postcss.config.js', 'postcss.config.ts', 'package.json', 'node_modules', '.git') - ``` - - `settings` : - ```lua - { - tailwindCSS = { - classAttributes = { "class", "className", "classList", "ngClass" }, - lint = { - cssConflict = "warning", - invalidApply = "error", - invalidConfigPath = "error", - invalidScreen = "error", - invalidTailwindDirective = "error", - invalidVariant = "error", - recommendedVariantOrder = "warning" - }, - validate = true - } - } - ``` - - -## taplo - -https://taplo.tamasfe.dev/lsp/ - -Language server for Taplo, a TOML toolkit. - -`taplo-cli` can be installed via `cargo`: -```sh -cargo install --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 - ``` - - -## 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") - ``` - - -## 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) - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.terraformls.setup{} -``` - - -**Default values:** - - `cmd` : - ```lua - { "terraform-ls", "serve" } - ``` - - `filetypes` : - ```lua - { "terraform" } - ``` - - `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/blob/master/docs/options.md 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", "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 - ``` - - -## 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 - {} - ``` - - -## tsserver - -https://github.com/theia-ide/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 type 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'.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("package.json", "tsconfig.json", "jsconfig.json", ".git") - ``` - - -## 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") - ``` - - -## 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 - ``` - - -## 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/com/fujitsu", - 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 - ``` - - -## 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 - }, - iskeyword = "@,48-57,_,192-255,-#", - runtimepath = "", - suggest = { - fromRuntimepath = true, - fromVimruntime = true - }, - vimruntime = "" - } - ``` - - `root_dir` : - ```lua - see source file - ``` - - -## 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). - -**By default, v-language-server 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 and compiled v-language-server. - -```lua --- set the path to the vls installation; -local vls_root_path = vim.fn.stdpath('cache')..'/lspconfig/vls' -local vls_binary = vls_root_path.."/cmd/vls/vls" - -require'lspconfig'.vls.setup { - cmd = {vls_binary}, -} -``` - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.vls.setup{} -``` - - -**Default values:** - - `filetypes` : - ```lua - { "vlang" } - ``` - - `root_dir` : - ```lua - root_pattern("v.mod", ".git") - ``` - - -## volar - -https://github.com/johnsoncodehk/volar/tree/master/packages/vue-language-server - -Volar language server for Vue - -Volar can be installed via npm: - -```sh -npm install -g @volar/vue-language-server -``` - -Volar by default supports Vue 3 projects. Vue 2 projects need [additional configuration](https://github.com/johnsoncodehk/volar/blob/master/extensions/vscode-vue-language-features/README.md?plain=1#L28-L63). - -**Take Over Mode** -Volar 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. The alternatives are: - -- use a global TypeScript Server installation - -```lua -require'lspconfig'.volar.setup{ - init_options = { - typescript = { - serverPath = '/path/to/.npm/lib/node_modules/typescript/lib/tsserverlib.js' - } - } -} -``` - -- use a global TypeScript Server installation if a local server is not found - -```lua -local util = require 'lspconfig.util' - -local function get_typescript_server_path(root_dir) - local project_root = util.find_node_modules_ancestor(root_dir) - - local local_tsserverlib = project_root ~= nil and util.path.join(project_root, 'node_modules', 'typescript', 'lib', 'tsserverlibrary.js') - local global_tsserverlib = '/home/[yourusernamehere]/.npm/lib/node_modules/typescript/lib/tsserverlibrary.js' - - if local_tsserverlib and util.path.exists(local_tsserverlib) then - return local_tsserverlib - else - return global_tsserverlib - end -end - -require'lspconfig'.volar.setup{ - on_new_config = function(new_config, new_root_dir) - new_config.init_options.typescript.serverPath = 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 - { - documentFeatures = { - documentColor = false, - documentFormatting = { - defaultPrintWidth = 100 - }, - documentSymbol = true, - foldingRange = true, - linkedEditingRange = true, - selectionRange = true - }, - languageFeatures = { - callHierarchy = true, - codeAction = true, - codeLens = true, - completion = { - defaultAttrNameCase = "kebabCase", - defaultTagNameCase = "both" - }, - definition = true, - diagnostics = true, - documentHighlight = true, - documentLink = true, - hover = true, - implementation = true, - references = true, - rename = true, - renameFileRefactoring = true, - schemaRequestService = true, - semanticTokens = false, - signatureHelp = true, - typeDefinition = true - }, - typescript = { - serverPath = "" - } - } - ``` - - `on_new_config` : - ```lua - see source file - ``` - - `root_dir` : - ```lua - see source file - ``` - - -## 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") - ``` - - -## 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" } - ``` - - `root_dir` : - ```lua - util.find_git_ancestor - ``` - - `settings` : - ```lua - { - redhat = { - telemetry = { - enabled = false - } - } - } - ``` - - `single_file_support` : - ```lua - true - ``` - - -## zeta_note - -https://github.com/artempyanykh/zeta-note - -Markdown LSP server for easy note-taking with cross-references and diagnostics. - -Binaries can be downloaded from https://github.com/artempyanykh/zeta-note/releases - -**By default, zeta-note 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 zeta-note binary. - -```lua -require'lspconfig'.zeta_note.setup{ - cmd = {'path/to/zeta-note'} -} -``` - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.zeta_note.setup{} -``` - - -**Default values:** - - `filetypes` : - ```lua - { "markdown" } - ``` - - `root_dir` : - ```lua - root_pattern(".zeta.toml") - ``` - - -## zk - -github.com/mickael-menu/zk - -A plain text note-taking assistant - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.zk.setup{} -``` -**Commands:** -- ZkIndex: Index -- 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", ".git") - ``` - - `single_file_support` : - ```lua - true - ``` - - - -vim:ft=markdown diff --git a/start/lspconfig-0.1.3/lua/lspconfig.lua b/start/lspconfig-0.1.3/lua/lspconfig.lua deleted file mode 100644 index 8404632..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig.lua +++ /dev/null @@ -1,92 +0,0 @@ -local configs = require 'lspconfig.configs' - -local M = { - util = require 'lspconfig.util', -} - -M._root = {} - -function M.available_servers() - return vim.tbl_keys(configs) -end - --- Called from plugin/lspconfig.vim because it requires knowing that the last --- script in scriptnames to be executed is lspconfig. -function M._root._setup() - M._root.commands = { - LspInfo = { - function() - require 'lspconfig.ui.lspinfo'() - end, - '-nargs=0', - description = '`:LspInfo` Displays attached, active, and configured language servers', - }, - LspStart = { - function(server_name) - if server_name then - if configs[server_name] then - configs[server_name].launch() - end - else - local buffer_filetype = vim.bo.filetype - for _, config in pairs(configs) do - for _, filetype_match in ipairs(config.filetypes or {}) do - if buffer_filetype == filetype_match then - config.launch() - end - end - end - end - end, - '-nargs=? -complete=custom,v:lua.lsp_complete_configured_servers', - description = '`:LspStart` Manually launches a language server.', - }, - LspStop = { - function(cmd_args) - for _, client in ipairs(M.util.get_clients_from_cmd_args(cmd_args)) do - client.stop() - end - end, - '-nargs=? -complete=customlist,v:lua.lsp_get_active_client_ids', - description = '`:LspStop` Manually stops the given language client(s).', - }, - LspRestart = { - function(cmd_args) - for _, client in ipairs(M.util.get_clients_from_cmd_args(cmd_args)) do - client.stop() - vim.defer_fn(function() - configs[client.name].launch() - end, 500) - end - end, - '-nargs=? -complete=customlist,v:lua.lsp_get_active_client_ids', - description = '`:LspRestart` Manually restart the given language client(s).', - }, - } - - M.util.create_module_commands('_root', M._root.commands) -end - -local mt = {} -function mt:__index(k) - if configs[k] == nil then - 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.3/lua/lspconfig/configs.lua b/start/lspconfig-0.1.3/lua/lspconfig/configs.lua deleted file mode 100644 index a47ecba..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/configs.lua +++ /dev/null @@ -1,295 +0,0 @@ -local util = require 'lspconfig.util' -local api, validate, lsp = vim.api, vim.validate, vim.lsp -local tbl_extend = vim.tbl_extend - -local configs = {} - -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.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_extend('keep', config_def.default_config, util.default_config) - - -- Force this part. - default_config.name = config_name - - function M.setup(config) - validate { - cmd = { config.cmd, 't', true }, - root_dir = { config.root_dir, 'f', true }, - filetypes = { config.filetype, 't', true }, - on_new_config = { config.on_new_config, 'f', true }, - on_attach = { config.on_attach, 'f', true }, - commands = { config.commands, 't', true }, - } - if config.commands then - for k, v in pairs(config.commands) do - validate { - ['command.name'] = { k, 's' }, - ['command.fn'] = { v[1], 'f' }, - } - end - end - - config = tbl_extend('keep', config, default_config) - - if util.on_setup then - pcall(util.on_setup, config) - end - - if config.autostart == true then - local event - local pattern - if config.filetypes then - event = 'FileType' - pattern = table.concat(config.filetypes, ',') - else - event = 'BufReadPost' - pattern = '*' - end - api.nvim_command( - string.format( - "autocmd %s %s unsilent lua require'lspconfig'[%q].manager.try_add()", - event, - pattern, - config.name - ) - ) - end - - local get_root_dir = config.root_dir - - function M.launch() - local root_dir - if get_root_dir then - local bufnr = api.nvim_get_current_buf() - local bufname = api.nvim_buf_get_name(bufnr) - if not util.bufname_valid(bufname) then - return - end - root_dir = get_root_dir(util.path.sanitize(bufname), bufnr) - end - - if root_dir then - api.nvim_command( - string.format( - "autocmd BufReadPost %s/* unsilent lua require'lspconfig'[%q].manager.try_add_wrapper()", - vim.fn.fnameescape(root_dir), - config.name - ) - ) - for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do - local bufname = api.nvim_buf_get_name(bufnr) - if util.bufname_valid(bufname) then - local buf_dir = util.path.sanitize(bufname) - if buf_dir:sub(1, root_dir:len()) == root_dir then - M.manager.try_add_wrapper(bufnr) - 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. - local bufname = api.nvim_buf_get_name(0) - if not util.bufname_valid(bufname) then - return - end - local pseudo_root = util.path.dirname(util.path.sanitize(bufname)) - local client_id = M.manager.add(pseudo_root, true) - vim.lsp.buf_attach_client(vim.api.nvim_get_current_buf(), client_id) - 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 = vim.tbl_deep_extend('keep', vim.empty_dict(), config) - new_config = vim.tbl_deep_extend('keep', new_config, default_config) - new_config.capabilities = new_config.capabilities or lsp.protocol.make_client_capabilities() - new_config.capabilities = vim.tbl_deep_extend('keep', new_config.capabilities, { - workspace = { - configuration = true, - }, - }) - - if config_def.on_new_config then - pcall(config_def.on_new_config, new_config, root_dir) - end - if config.on_new_config then - pcall(config.on_new_config, new_config, root_dir) - end - - new_config.on_init = util.add_hook_after(new_config.on_init, function(client, result) - -- Handle offset encoding by default - if result.offsetEncoding then - client.offset_encoding = result.offsetEncoding - end - - -- Send `settings to server via workspace/didChangeConfiguration - function client.workspace_did_change_configuration(settings) - if not settings then - return - end - if vim.tbl_isempty(settings) then - settings = { [vim.type_idx] = vim.types.dictionary } - end - return client.notify('workspace/didChangeConfiguration', { - settings = settings, - }) - end - if not vim.tbl_isempty(new_config.settings) then - client.workspace_did_change_configuration(new_config.settings) - end - end) - - -- Save the old _on_attach so that we can reference it via the BufEnter. - new_config._on_attach = new_config.on_attach - new_config.on_attach = vim.schedule_wrap(function(client, bufnr) - if bufnr == api.nvim_get_current_buf() then - M._setup_buffer(client.id, bufnr) - else - api.nvim_command( - string.format( - "autocmd BufEnter <buffer=%d> ++once lua require'lspconfig'[%q]._setup_buffer(%d,%d)", - bufnr, - config_name, - client.id, - bufnr - ) - ) - end - end) - - new_config.root_dir = root_dir - new_config.workspace_folders = { - { - uri = vim.uri_from_fname(root_dir), - name = string.format('%s', root_dir), - }, - } - return new_config - end - - local manager = util.server_per_root_dir_manager(function(root_dir) - return make_config(root_dir) - end) - - function manager.try_add(bufnr) - bufnr = bufnr or api.nvim_get_current_buf() - - if vim.api.nvim_buf_get_option(bufnr, 'buftype') == 'nofile' then - return - end - - local id - local root_dir - - local bufname = api.nvim_buf_get_name(bufnr) - if not util.bufname_valid(bufname) then - return - end - local buf_path = util.path.sanitize(bufname) - - if get_root_dir then - root_dir = get_root_dir(buf_path, bufnr) - end - - if root_dir then - id = manager.add(root_dir, false) - elseif config.single_file_support then - local pseudo_root = util.path.dirname(buf_path) - id = manager.add(pseudo_root, true) - end - - if id then - lsp.buf_attach_client(bufnr, id) - end - end - - function manager.try_add_wrapper(bufnr) - bufnr = bufnr or api.nvim_get_current_buf() - local buf_filetype = vim.api.nvim_buf_get_option(bufnr, 'filetype') - if config.filetypes then - for _, filetype in ipairs(config.filetypes) do - if buf_filetype == filetype then - manager.try_add(bufnr) - return - end - end - else - manager.try_add(bufnr) - end - end - - M.manager = manager - M.make_config = make_config - if reload and config.autostart ~= false then - for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do - manager.try_add_wrapper(bufnr) - end - end - end - - function M._setup_buffer(client_id, bufnr) - local client = lsp.get_client_by_id(client_id) - if not client then - return - end - if client.config._on_attach then - client.config._on_attach(client, bufnr) - end - if client.config.commands and not vim.tbl_isempty(client.config.commands) then - M.commands = vim.tbl_deep_extend('force', M.commands, client.config.commands) - end - if not M.commands_created and not vim.tbl_isempty(M.commands) then - -- Create the module commands - util.create_module_commands(config_name, M.commands) - M.commands_created = true - end - end - - M.commands_created = false - M.commands = config_def.commands - M.name = config_name - M.document_config = config_def - - rawset(t, config_name, M) - - return M -end - -return setmetatable({}, configs) diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/als.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/als.lua deleted file mode 100644 index 7d916ad..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/als.lua +++ /dev/null @@ -1,37 +0,0 @@ -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.3/lua/lspconfig/server_configurations/angularls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/angularls.lua deleted file mode 100644 index 4d30de7..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/angularls.lua +++ /dev/null @@ -1,75 +0,0 @@ -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()) - -local bin_name = 'ngserver' -local args = { - '--stdio', - '--tsProbeLocations', - default_probe_dir, - '--ngProbeLocations', - default_probe_dir, -} - -local cmd = { bin_name, unpack(args) } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, unpack(args) } -end - -return { - default_config = { - cmd = cmd, - filetypes = { 'typescript', 'html', 'typescriptreact', 'typescript.tsx' }, - -- Check for angular.json or .git first 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', '.git'), - }, - 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", ".git")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/ansiblels.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/ansiblels.lua deleted file mode 100644 index b4bb324..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/ansiblels.lua +++ /dev/null @@ -1,47 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'ansible-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - settings = { - ansible = { - python = { - interpreterPath = 'python', - }, - ansibleLint = { - path = 'ansible-lint', - enabled = true, - }, - ansible = { - path = 'ansible', - }, - executionEnvironment = { - enabled = false, - }, - }, - }, - filetypes = { 'yaml.ansible' }, - root_dir = util.root_pattern('ansible.cfg', '.ansible-lint'), - single_file_support = true, - }, - docs = { - description = [[ -https://github.com/ansible/ansible-language-server - -Language server for the ansible configuration management tool. - -`ansible-language-server` can be installed via `npm`: - -```sh -npm install -g @ansible/ansible-language-server -``` -]], - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/arduino_language_server.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/arduino_language_server.lua deleted file mode 100644 index 72f48a1..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/arduino_language_server.lua +++ /dev/null @@ -1,50 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'arduino-language-server' }, - filetypes = { 'arduino' }, - root_dir = util.root_pattern '*.ino', - }, - docs = { - description = [[ -https://github.com/arduino/arduino-language-server - -Language server for Arduino - -The `arduino-language-server` can be installed by running: - go get -u github.com/arduino/arduino-language-server - -The `arduino-cli` tools must also be installed. Follow these instructions for your distro: - https://arduino.github.io/arduino-cli/latest/installation/ - -After installing the `arduino-cli` tools, follow these instructions for generating -a configuration file: - https://arduino.github.io/arduino-cli/latest/getting-started/#create-a-configuration-file -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` be installed. It will look for `clangd` by default but -the binary path can be overridden if need be. - -After all dependencies are installed you'll need to override the lspconfig command for the -language server in your setup function with the necessary configurations: - -```lua -lspconfig.arduino_language_server.setup({ - cmd = { - -- Required - "arduino-language-server", - "-cli-config", "/path/to/arduino-cli.yaml", - -- Optional - "-cli", "/path/to/arduino-cli", - "-clangd", "/path/to/clangd" - } -}) -``` - -For further instruction about configuration options, run `arduino-language-server --help`. - -]], - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/asm_lsp.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/asm_lsp.lua deleted file mode 100644 index 102bcba..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/asm_lsp.lua +++ /dev/null @@ -1,19 +0,0 @@ -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.3/lua/lspconfig/server_configurations/awk_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/awk_ls.lua deleted file mode 100644 index ff1087d..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/awk_ls.lua +++ /dev/null @@ -1,22 +0,0 @@ -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.3/lua/lspconfig/server_configurations/bashls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/bashls.lua deleted file mode 100644 index 3f25c76..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/bashls.lua +++ /dev/null @@ -1,39 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'bash-language-server' -local cmd = { bin_name, 'start' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, 'start' } -end - -return { - default_config = { - cmd = cmd, - 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 '*@(.sh|.inc|.bash|.command)', - }, - filetypes = { 'sh' }, - root_dir = util.find_git_ancestor, - single_file_support = true, - }, - docs = { - description = [[ -https://github.com/mads-hartmann/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.3/lua/lspconfig/server_configurations/beancount.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/beancount.lua deleted file mode 100644 index 1d86d34..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/beancount.lua +++ /dev/null @@ -1,26 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'beancount-langserver', '--stdio' }, - filetypes = { 'beancount' }, - root_dir = util.find_git_ancestor, - single_file_support = true, - init_options = { - -- this is the path to the beancout journal file - journalFile = '', - -- this is the path to the python binary with beancount installed - pythonPath = 'python3', - }, - }, - 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("elm.json")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/bicep.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/bicep.lua deleted file mode 100644 index 1ec7032..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/bicep.lua +++ /dev/null @@ -1,47 +0,0 @@ -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.3/lua/lspconfig/server_configurations/bsl_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/bsl_ls.lua deleted file mode 100644 index fef15f9..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/bsl_ls.lua +++ /dev/null @@ -1,19 +0,0 @@ -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.3/lua/lspconfig/server_configurations/ccls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/ccls.lua deleted file mode 100644 index dd642db..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/ccls.lua +++ /dev/null @@ -1,43 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'ccls' }, - filetypes = { 'c', 'cpp', 'objc', 'objcpp' }, - root_dir = util.root_pattern('compile_commands.json', '.ccls', '.git'), - 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.3/lua/lspconfig/server_configurations/clangd.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/clangd.lua deleted file mode 100644 index 4e0f2d7..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/clangd.lua +++ /dev/null @@ -1,87 +0,0 @@ -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 = vim.tbl_deep_extend( - 'force', - util.default_config.capabilities or vim.lsp.protocol.make_client_capabilities(), - { - textDocument = { - completion = { - editsNearCursor = true, - }, - }, - offsetEncoding = { 'utf-8', 'utf-16' }, - } -) - -return { - default_config = { - cmd = { 'clangd' }, - filetypes = { 'c', 'cpp', 'objc', 'objcpp' }, - 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 [this issue for more](https://github.com/neovim/nvim-lsp/issues/23). - -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.3/lua/lspconfig/server_configurations/clarity_lsp.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/clarity_lsp.lua deleted file mode 100644 index 72a6197..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/clarity_lsp.lua +++ /dev/null @@ -1,19 +0,0 @@ -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.3/lua/lspconfig/server_configurations/clojure_lsp.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/clojure_lsp.lua deleted file mode 100644 index 5340693..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/clojure_lsp.lua +++ /dev/null @@ -1,19 +0,0 @@ -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'), - }, - docs = { - description = [[ -https://github.com/snoe/clojure-lsp - -Clojure Language Server -]], - default_config = { - root_dir = [[root_pattern("project.clj", "deps.edn", "build.boot", "shadow-cljs.edn", ".git")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/cmake.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/cmake.lua deleted file mode 100644 index d334535..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/cmake.lua +++ /dev/null @@ -1,26 +0,0 @@ -local util = require 'lspconfig.util' - -local root_files = { 'CMakeLists.txt', 'cmake' } -return { - default_config = { - cmd = { 'cmake-language-server' }, - filetypes = { 'cmake' }, - root_dir = function(fname) - return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) - 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(".git", "compile_commands.json", "build")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/codeqlls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/codeqlls.lua deleted file mode 100644 index 9184d2f..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/codeqlls.lua +++ /dev/null @@ -1,46 +0,0 @@ -local util = require 'lspconfig.util' - -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) - initialize_params['workspaceFolders'] = { - { - name = 'workspace', - uri = initialize_params['rootUri'], - }, - } - end, - settings = { - search_path = vim.empty_dict(), - }, - }, - docs = { - description = [[ -Reference: -https://help.semmle.com/codeql/codeql-cli.html - -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) .. ':' - 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.3/lua/lspconfig/server_configurations/crystalline.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/crystalline.lua deleted file mode 100644 index ef4d6bc..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/crystalline.lua +++ /dev/null @@ -1,20 +0,0 @@ -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.3/lua/lspconfig/server_configurations/csharp_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/csharp_ls.lua deleted file mode 100644 index 828cba4..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/csharp_ls.lua +++ /dev/null @@ -1,23 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'csharp-ls' }, - root_dir = util.root_pattern('*.sln', '*.csproj', '.git'), - filetypes = { 'cs' }, - init_options = { - AutomaticWorkspaceInit = true, - }, - }, - docs = { - description = [[ -https://github.com/razzmatazz/csharp-language-server - -Language Server for C#. - -csharp-ls requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. - -The preferred way to install csharp-ls is with `dotnet tool install --global csharp-ls`. - ]], - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/cssls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/cssls.lua deleted file mode 100644 index 41c38e6..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/cssls.lua +++ /dev/null @@ -1,49 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'vscode-css-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { 'css', 'scss', 'less' }, - root_dir = util.root_pattern('package.json', '.git'), - single_file_support = true, - settings = { - css = { validate = true }, - scss = { validate = true }, - less = { validate = true }, - }, - }, - docs = { - description = [[ - -https://github.com/hrsh7th/vscode-langservers-extracted - -`css-languageserver` can be installed via `npm`: - -```sh -npm i -g vscode-langservers-extracted -``` - -Neovim does not currently include built-in snippets. `vscode-css-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. - -```lua ---Enable (broadcasting) snippet capability for completion -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities.textDocument.completion.completionItem.snippetSupport = true - -require'lspconfig'.cssls.setup { - capabilities = capabilities, -} -``` -]], - default_config = { - root_dir = [[root_pattern("package.json", ".git") or bufdir]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/cssmodules_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/cssmodules_ls.lua deleted file mode 100644 index 3107b75..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/cssmodules_ls.lua +++ /dev/null @@ -1,31 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'cssmodules-language-server' -local cmd = { bin_name } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name } -end - -return { - default_config = { - cmd = cmd, - 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.3/lua/lspconfig/server_configurations/cucumber_language_server.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/cucumber_language_server.lua deleted file mode 100644 index 0783206..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/cucumber_language_server.lua +++ /dev/null @@ -1,33 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'cucumber-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { '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.3/lua/lspconfig/server_configurations/dartls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/dartls.lua deleted file mode 100644 index eecb0b7..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/dartls.lua +++ /dev/null @@ -1,60 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'dart' - -local find_dart_sdk_root_path = function() - if os.getenv 'FLUTTER_SDK' then - local flutter_path = os.getenv 'FLUTTER_SDK' - return util.path.join(flutter_path, 'cache', 'dart-sdk', 'bin', 'dart') - elseif vim.fn['executable'] 'flutter' == 1 then - local flutter_path = vim.fn['resolve'](vim.fn['exepath'] 'flutter') - local flutter_bin = vim.fn['fnamemodify'](flutter_path, ':h') - return util.path.join(flutter_bin, 'cache', 'dart-sdk', 'bin', 'dart') - elseif vim.fn['executable'] 'dart' == 1 then - return vim.fn['resolve'](vim.fn['exepath'] 'dart') - else - return '' - end -end - -local analysis_server_snapshot_path = function() - local dart_sdk_root_path = vim.fn['fnamemodify'](find_dart_sdk_root_path(), ':h') - local snapshot = util.path.join(dart_sdk_root_path, 'snapshots', 'analysis_server.dart.snapshot') - - if vim.fn['has'] 'win32' == 1 or vim.fn['has'] 'win64' == 1 then - snapshot = snapshot:gsub('/', '\\') - end - - return snapshot -end - -return { - default_config = { - cmd = { bin_name, analysis_server_snapshot_path(), '--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.3/lua/lspconfig/server_configurations/denols.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/denols.lua deleted file mode 100644 index a7bed35..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/denols.lua +++ /dev/null @@ -1,114 +0,0 @@ -local util = require 'lspconfig.util' -local lsp = vim.lsp - -local function buf_cache(bufnr) - local params = {} - params['referrer'] = { uri = vim.uri_from_bufnr(bufnr) } - params['uris'] = {} - lsp.buf_request(bufnr, 'deno/cache', params, function(err) - if err then - error(tostring(err)) - end - end) -end - -local function virtual_text_document_handler(uri, result) - if not result then - return nil - end - - for client_id, res in pairs(result) do - local lines = vim.split(res.result, '\n') - local bufnr = vim.uri_to_bufnr(uri) - - local current_buf = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false) - if #current_buf ~= 0 then - return nil - end - - vim.api.nvim_buf_set_lines(bufnr, 0, -1, nil, lines) - vim.api.nvim_buf_set_option(bufnr, 'readonly', true) - vim.api.nvim_buf_set_option(bufnr, 'modified', false) - vim.api.nvim_buf_set_option(bufnr, 'modifiable', false) - lsp.buf_attach_client(bufnr, client_id) - end -end - -local function virtual_text_document(uri) - local params = { - textDocument = { - uri = uri, - }, - } - local result = lsp.buf_request_sync(0, 'deno/virtualTextDocument', params) - virtual_text_document_handler(uri, result) -end - -local function denols_handler(err, result, ctx) - if not result or vim.tbl_isempty(result) then - return nil - end - - for _, res in pairs(result) do - local uri = res.uri or res.targetUri - if uri:match '^deno:' then - virtual_text_document(uri) - res['uri'] = uri - res['targetUri'] = uri - end - end - - lsp.handlers[ctx.method](err, result, ctx) -end - -return { - default_config = { - cmd = { 'deno', 'lsp' }, - filetypes = { - 'javascript', - 'javascriptreact', - 'javascript.jsx', - 'typescript', - 'typescriptreact', - 'typescript.tsx', - }, - root_dir = util.root_pattern('deno.json', 'deno.jsonc', 'tsconfig.json', '.git'), - init_options = { - enable = true, - lint = false, - unstable = false, - }, - handlers = { - ['textDocument/definition'] = denols_handler, - ['textDocument/references'] = denols_handler, - }, - }, - commands = { - DenolsCache = { - function() - buf_cache(0) - end, - description = 'Cache a module and all of its dependencies.', - }, - }, - docs = { - description = [[ -https://github.com/denoland/deno - -Deno's built-in language server - -To approrpiately 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", "tsconfig.json", ".git")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/dhall_lsp_server.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/dhall_lsp_server.lua deleted file mode 100644 index af910f3..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/dhall_lsp_server.lua +++ /dev/null @@ -1,26 +0,0 @@ -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.3/lua/lspconfig/server_configurations/diagnosticls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/diagnosticls.lua deleted file mode 100644 index 8f0476b..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/diagnosticls.lua +++ /dev/null @@ -1,29 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'diagnostic-languageserver' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - 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.3/lua/lspconfig/server_configurations/dockerls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/dockerls.lua deleted file mode 100644 index 6d1cfc7..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/dockerls.lua +++ /dev/null @@ -1,30 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'docker-langserver' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { 'dockerfile' }, - root_dir = util.root_pattern 'Dockerfile', - single_file_support = true, - }, - docs = { - description = [[ -https://github.com/rcjsuen/dockerfile-language-server-nodejs - -`docker-langserver` can be installed via `npm`: -```sh -npm install -g dockerfile-language-server-nodejs -``` - ]], - default_config = { - root_dir = [[root_pattern("Dockerfile")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/dotls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/dotls.lua deleted file mode 100644 index dff14b9..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/dotls.lua +++ /dev/null @@ -1,27 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'dot-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { '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.3/lua/lspconfig/server_configurations/efm.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/efm.lua deleted file mode 100644 index f5f74ed..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/efm.lua +++ /dev/null @@ -1,43 +0,0 @@ -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.3/lua/lspconfig/server_configurations/elixirls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/elixirls.lua deleted file mode 100644 index d51aa50..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/elixirls.lua +++ /dev/null @@ -1,39 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - filetypes = { 'elixir', 'eelixir' }, - root_dir = function(fname) - return util.root_pattern('mix.exs', '.git')(fname) or vim.loop.os_homedir() - end, - }, - docs = { - description = [[ -https://github.com/elixir-lsp/elixir-ls - -`elixir-ls` can be installed by following the instructions [here](https://github.com/elixir-lsp/elixir-ls#building-and-running). - -```bash -curl -fLO https://github.com/elixir-lsp/elixir-ls/releases/latest/download/elixir-ls.zip -unzip elixir-ls.zip -d /path/to/elixir-ls -# Unix -chmod +x /path/to/elixir-ls/language_server.sh -``` - -**By default, elixir-ls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of your unzipped elixir-ls. - -```lua -require'lspconfig'.elixirls.setup{ - -- Unix - cmd = { "/path/to/elixir-ls/language_server.sh" }; - -- Windows - cmd = { "/path/to/elixir-ls/language_server.bat" }; - ... -} -``` -]], - default_config = { - root_dir = [[root_pattern("mix.exs", ".git") or vim.loop.os_homedir()]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/elmls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/elmls.lua deleted file mode 100644 index 2718c88..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/elmls.lua +++ /dev/null @@ -1,44 +0,0 @@ -local util = require 'lspconfig.util' -local lsp = vim.lsp -local api = vim.api - -local bin_name = 'elm-language-server' -local cmd = { bin_name } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name } -end - -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 = cmd, - -- TODO(ashkan) if we comment this out, it will allow elmls to operate on elm.json. It seems like it could do that, but no other editor allows it right now. - filetypes = { 'elm' }, - root_dir = function(fname) - local filetype = api.nvim_buf_get_option(0, 'filetype') - if filetype == 'elm' or (filetype == 'json' and fname:match 'elm%.json$') then - return elm_root_pattern(fname) - end - end, - init_options = { - elmAnalyseTrigger = 'change', - }, - }, - docs = { - description = [[ -https://github.com/elm-tooling/elm-language-server#installation - -If you don't want to use Nvim to install it, then you can use: -```sh -npm install -g elm elm-test elm-format @elm-tooling/elm-language-server -``` -]], - default_config = { - root_dir = [[root_pattern("elm.json")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/ember.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/ember.lua deleted file mode 100644 index e6ce1ea..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/ember.lua +++ /dev/null @@ -1,30 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'ember-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { 'handlebars', 'typescript', 'javascript' }, - root_dir = util.root_pattern('ember-cli-build.js', '.git'), - }, - docs = { - description = [[ -https://github.com/lifeart/ember-language-server - -`ember-language-server` can be installed via `npm`: - -```sh -npm install -g @lifeart/ember-language-server -``` -]], - default_config = { - root_dir = [[root_pattern("ember-cli-build.js", ".git")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/emmet_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/emmet_ls.lua deleted file mode 100644 index 3750ae5..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/emmet_ls.lua +++ /dev/null @@ -1,31 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'emmet-ls' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { 'html', 'css' }, - 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.3/lua/lspconfig/server_configurations/erlangls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/erlangls.lua deleted file mode 100644 index cec1928..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/erlangls.lua +++ /dev/null @@ -1,34 +0,0 @@ -local util = require 'lspconfig.util' - -local cmd = { 'erlang_ls' } -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', 'erlang_ls.cmd' } -end - -return { - default_config = { - cmd = cmd, - 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.3/lua/lspconfig/server_configurations/esbonio.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/esbonio.lua deleted file mode 100644 index a97c26b..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/esbonio.lua +++ /dev/null @@ -1,55 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'python3', '-m', 'esbonio' }, - filetypes = { 'rst' }, - root_dir = util.find_git_ancestor, - }, - docs = { - description = [[ -https://github.com/swyddfa/esbonio - -Esbonio is a language server for [Sphinx](https://www.sphinx-doc.org/en/master/) documentation projects. -The language server can be installed via pip - -``` -pip install esbonio -``` - -Since Sphinx is highly extensible you will get best results if you install the language server in the same -Python environment as the one used to build your documentation. To ensure that the correct Python environment -is picked up, you can either launch `nvim` with the correct environment activated. - -``` -source env/bin/activate -nvim -``` - -Or you can modify the default `cmd` to include the full path to the Python interpreter. - -```lua -require'lspconfig'.esbonio.setup { - cmd = { '/path/to/virtualenv/bin/python', '-m', 'esbonio' } -} -``` - -Esbonio supports a number of config values passed as `init_options` on startup, for example. - -```lua -require'lspconfig'.esbonio.setup { - init_options = { - server = { - logLevel = "debug" - }, - sphinx = { - confDir = "/path/to/docs", - srcDir = "${confDir}/../docs-src" - } -} -``` - -A full list and explanation of the available options can be found [here](https://swyddfa.github.io/esbonio/docs/lsp/editors/index.html) -]], - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/eslint.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/eslint.lua deleted file mode 100644 index 925cdfe..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/eslint.lua +++ /dev/null @@ -1,172 +0,0 @@ -local util = require 'lspconfig.util' -local lsp = vim.lsp - -local get_eslint_client = function() - local active_clients = lsp.get_active_clients() - for _, client in ipairs(active_clients) do - if client.name == 'eslint' then - return client - end - end - return nil -end - -local function fix_all(opts) - opts = opts or {} - - local eslint_lsp_client = get_eslint_client() - 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 bin_name = 'vscode-eslint-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { - 'javascript', - 'javascriptreact', - 'javascript.jsx', - 'typescript', - 'typescriptreact', - 'typescript.tsx', - 'vue', - }, - -- https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-file-formats - root_dir = util.root_pattern( - '.eslintrc.js', - '.eslintrc.cjs', - '.eslintrc.yaml', - '.eslintrc.yml', - '.eslintrc.json', - 'package.json' - ), - -- Refer to https://github.com/Microsoft/vscode-eslint#settings-options for documentation. - settings = { - validate = 'on', - packageManager = 'npm', - useESLintClass = false, - codeActionOnSave = { - enable = false, - mode = 'all', - }, - format = true, - quiet = false, - onIgnoredFiles = 'off', - rulesCustomizations = {}, - run = 'onType', - -- 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'), - } - 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: A linting engine for JavaScript / Typescript - -`vscode-eslint-language-server` 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 document on save -```vim -autocmd BufWritePre *.tsx,*.ts,*.jsx,*.js EslintFixAll -``` - -See [vscode-eslint](https://github.com/microsoft/vscode-eslint/blob/55871979d7af184bf09af491b6ea35ebd56822cf/server/src/eslintServer.ts#L216-L229) for configuration options. - -Additional messages you can handle: eslint/noConfig -Messages already handled in lspconfig: eslint/openDoc, eslint/confirmESLintExecution, eslint/probeFailed, eslint/noLibrary -]], - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/flow.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/flow.lua deleted file mode 100644 index 3ac59aa..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/flow.lua +++ /dev/null @@ -1,27 +0,0 @@ -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.3/lua/lspconfig/server_configurations/flux_lsp.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/flux_lsp.lua deleted file mode 100644 index 3be9a1b..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/flux_lsp.lua +++ /dev/null @@ -1,22 +0,0 @@ -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.3/lua/lspconfig/server_configurations/foam_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/foam_ls.lua deleted file mode 100644 index 1f0d7fc..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/foam_ls.lua +++ /dev/null @@ -1,31 +0,0 @@ -local util = require 'lspconfig.util' -local bin_name = 'foam-ls' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { '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.3/lua/lspconfig/server_configurations/fortls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/fortls.lua deleted file mode 100644 index 5879139..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/fortls.lua +++ /dev/null @@ -1,24 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'fortls' }, - filetypes = { 'fortran' }, - root_dir = function(fname) - return util.root_pattern '.fortls'(fname) or util.find_git_ancestor(fname) - end, - settings = { - nthreads = 1, - }, - }, - docs = { - description = [[ -https://github.com/hansec/fortran-language-server - -Fortran Language Server for the Language Server Protocol - ]], - default_config = { - root_dir = [[root_pattern(".fortls")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/fsautocomplete.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/fsautocomplete.lua deleted file mode 100644 index 1a1d4c5..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/fsautocomplete.lua +++ /dev/null @@ -1,32 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'fsautocomplete', '--background-service-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.3/lua/lspconfig/server_configurations/fstar.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/fstar.lua deleted file mode 100644 index d866c54..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/fstar.lua +++ /dev/null @@ -1,19 +0,0 @@ -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.3/lua/lspconfig/server_configurations/gdscript.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/gdscript.lua deleted file mode 100644 index d6d697f..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/gdscript.lua +++ /dev/null @@ -1,19 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'nc', 'localhost', '6008' }, - 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.3/lua/lspconfig/server_configurations/ghcide.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/ghcide.lua deleted file mode 100644 index 7f9307b..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/ghcide.lua +++ /dev/null @@ -1,21 +0,0 @@ -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.3/lua/lspconfig/server_configurations/golangci_lint_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/golangci_lint_ls.lua deleted file mode 100644 index 8eaa015..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/golangci_lint_ls.lua +++ /dev/null @@ -1,34 +0,0 @@ -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 'go.work'(fname) or util.root_pattern('go.mod', '.golangci.yaml', '.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@v1.42.1 -``` - -]], - default_config = { - root_dir = [[root_pattern('go.work') or root_pattern('go.mod', '.golangci.yaml', '.git')]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/gopls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/gopls.lua deleted file mode 100644 index f6a085d..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/gopls.lua +++ /dev/null @@ -1,22 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'gopls' }, - filetypes = { 'go', 'gomod', 'gotmpl' }, - root_dir = function(fname) - return util.root_pattern 'go.work'(fname) or util.root_pattern('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.mod", ".git")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/gradle_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/gradle_ls.lua deleted file mode 100644 index b23b599..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/gradle_ls.lua +++ /dev/null @@ -1,37 +0,0 @@ -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) -} - -local fallback_root_files = { - 'build.gradle', -- Gradle -} - -return { - default_config = { - filetypes = { 'groovy' }, - root_dir = function(fname) - return util.root_pattern(unpack(root_files))(fname) or util.root_pattern(unpack(fallback_root_files))(fname) - end, - cmd = { bin_name }, - }, - 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")]], - cmd = { 'gradle-language-server' }, - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/grammarly.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/grammarly.lua deleted file mode 100644 index 675169d..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/grammarly.lua +++ /dev/null @@ -1,38 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'unofficial-grammarly-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { 'markdown' }, - root_dir = util.find_git_ancestor, - single_file_support = true, - handlers = { - ['$/updateDocumentState'] = function() - return '' - end, - }, - }, - docs = { - description = [[ -https://github.com/emacs-grammarly/unofficial-grammarly-language-server - -`unofficial-grammarly-language-server` can be installed via `npm`: - -```sh -npm i -g @emacs-grammarly/unofficial-grammarly-language-server -``` - -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.3/lua/lspconfig/server_configurations/graphql.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/graphql.lua deleted file mode 100644 index d34881c..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/graphql.lua +++ /dev/null @@ -1,33 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'graphql-lsp' -local cmd = { bin_name, 'server', '-m', 'stream' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, 'server', '-m', 'stream' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { 'graphql', 'typescriptreact', 'javascriptreact' }, - root_dir = util.root_pattern('.git', '.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 and create a [GraphQL config file](https://www.graphql-config.com/docs/user/user-introduction). -]], - default_config = { - root_dir = [[root_pattern('.git', '.graphqlrc*', '.graphql.config.*')]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/groovyls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/groovyls.lua deleted file mode 100644 index b4182f4..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/groovyls.lua +++ /dev/null @@ -1,36 +0,0 @@ -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.3/lua/lspconfig/server_configurations/haxe_language_server.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/haxe_language_server.lua deleted file mode 100644 index 1589c7b..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/haxe_language_server.lua +++ /dev/null @@ -1,47 +0,0 @@ -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.3/lua/lspconfig/server_configurations/hdl_checker.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/hdl_checker.lua deleted file mode 100644 index 5cf2941..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/hdl_checker.lua +++ /dev/null @@ -1,20 +0,0 @@ -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.3/lua/lspconfig/server_configurations/hhvm.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/hhvm.lua deleted file mode 100644 index 0e8ac5c..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/hhvm.lua +++ /dev/null @@ -1,21 +0,0 @@ -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.3/lua/lspconfig/server_configurations/hie.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/hie.lua deleted file mode 100644 index 96148ad..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/hie.lua +++ /dev/null @@ -1,34 +0,0 @@ -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.3/lua/lspconfig/server_configurations/hls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/hls.lua deleted file mode 100644 index 32b3ea2..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/hls.lua +++ /dev/null @@ -1,43 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'haskell-language-server-wrapper', '--lsp' }, - filetypes = { 'haskell', 'lhaskell' }, - root_dir = util.root_pattern('*.cabal', 'stack.yaml', 'cabal.project', 'package.yaml', 'hie.yaml'), - single_file_support = true, - settings = { - haskell = { - formattingProvider = 'ormolu', - }, - }, - 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 - ]], - - default_config = { - root_dir = [[root_pattern("*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/hoon_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/hoon_ls.lua deleted file mode 100644 index 80092db..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/hoon_ls.lua +++ /dev/null @@ -1,29 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'hoon-language-server' -local cmd = { bin_name } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name } -end - -return { - default_config = { - cmd = cmd, - 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.3/lua/lspconfig/server_configurations/html.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/html.lua deleted file mode 100644 index 2f8214f..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/html.lua +++ /dev/null @@ -1,48 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'vscode-html-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { 'html' }, - 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.3/lua/lspconfig/server_configurations/idris2_lsp.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/idris2_lsp.lua deleted file mode 100644 index d6efdd1..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/idris2_lsp.lua +++ /dev/null @@ -1,41 +0,0 @@ -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-api-git/) 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.3/lua/lspconfig/server_configurations/intelephense.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/intelephense.lua deleted file mode 100644 index c9e35b9..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/intelephense.lua +++ /dev/null @@ -1,50 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'intelephense' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { '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.3/lua/lspconfig/server_configurations/java_language_server.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/java_language_server.lua deleted file mode 100644 index 3ddf4b1..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/java_language_server.lua +++ /dev/null @@ -1,18 +0,0 @@ -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.3/lua/lspconfig/server_configurations/jdtls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/jdtls.lua deleted file mode 100644 index d740572..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/jdtls.lua +++ /dev/null @@ -1,193 +0,0 @@ -local util = require 'lspconfig.util' -local handlers = require 'vim.lsp.handlers' - -local sysname = vim.loop.os_uname().sysname -local env = { - HOME = vim.loop.os_homedir(), - JAVA_HOME = os.getenv 'JAVA_HOME', - JDTLS_HOME = os.getenv 'JDTLS_HOME', - WORKSPACE = os.getenv 'WORKSPACE', -} - -local function get_java_executable() - local executable = env.JAVA_HOME and util.path.join(env.JAVA_HOME, 'bin', 'java') or 'java' - - return sysname:match 'Windows' and executable .. '.exe' or executable -end - -local function get_workspace_dir() - return env.WORKSPACE and env.WORKSPACE or util.path.join(env.HOME, 'workspace') -end - -local function get_jdtls_jar() - return vim.fn.expand '$JDTLS_HOME/plugins/org.eclipse.equinox.launcher_*.jar' -end - -local function get_jdtls_config() - if sysname:match 'Linux' then - return util.path.join(env.JDTLS_HOME, 'config_linux') - elseif sysname:match 'Darwin' then - return util.path.join(env.JDTLS_HOME, 'config_mac') - elseif sysname:match 'Windows' then - return util.path.join(env.JDTLS_HOME, 'config_win') - else - return util.path.join(env.JDTLS_HOME, 'config_linux') - end -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 = { - -- Single-module projects - { - 'build.xml', -- Ant - 'pom.xml', -- Maven - 'settings.gradle', -- Gradle - 'settings.gradle.kts', -- Gradle - }, - -- Multi-module projects - { 'build.gradle', 'build.gradle.kts' }, -} - -return { - default_config = { - cmd = { - get_java_executable(), - '-Declipse.application=org.eclipse.jdt.ls.core.id1', - '-Dosgi.bundles.defaultStartLevel=4', - '-Declipse.product=org.eclipse.jdt.ls.core.product', - '-Dlog.protocol=true', - '-Dlog.level=ALL', - '-Xms1g', - '-Xmx2G', - '--add-modules=ALL-SYSTEM', - '--add-opens', - 'java.base/java.util=ALL-UNNAMED', - '--add-opens', - 'java.base/java.lang=ALL-UNNAMED', - '-jar', - get_jdtls_jar(), - '-configuration', - get_jdtls_config(), - '-data', - get_workspace_dir(), - }, - 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_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) - -Due to the nature of java, settings cannot be inferred. Please set the following -environmental variables to match your installation. If you need per-project configuration -[direnv](https://github.com/direnv/direnv) is highly recommended. - -```bash -# Mandatory: -# .bashrc -export JDTLS_HOME=/path/to/jdtls_root # Directory with the plugin and configs directories - -# Optional: -export JAVA_HOME=/path/to/java_home # In case you don't have java in path or want to use a version in particular -export WORKSPACE=/path/to/workspace # Defaults to $HOME/workspace -``` -```lua - -- init.lua - require'lspconfig'.jdtls.setup{} -``` - -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.3/lua/lspconfig/server_configurations/jedi_language_server.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/jedi_language_server.lua deleted file mode 100644 index 30cf8f5..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/jedi_language_server.lua +++ /dev/null @@ -1,28 +0,0 @@ -local util = require 'lspconfig.util' - -local root_files = { - 'pyproject.toml', - 'setup.py', - 'setup.cfg', - 'requirements.txt', - 'Pipfile', -} - -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.3/lua/lspconfig/server_configurations/jsonls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/jsonls.lua deleted file mode 100644 index a62a715..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/jsonls.lua +++ /dev/null @@ -1,48 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'vscode-json-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { '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.3/lua/lspconfig/server_configurations/jsonnet_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/jsonnet_ls.lua deleted file mode 100644 index 3493e7e..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/jsonnet_ls.lua +++ /dev/null @@ -1,40 +0,0 @@ -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' }, - 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) - new_config.cmd_env = { - JSONNET_PATH = jsonnet_path(root_dir), - } - 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.3/lua/lspconfig/server_configurations/julials.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/julials.lua deleted file mode 100644 index 44360c7..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/julials.lua +++ /dev/null @@ -1,75 +0,0 @@ -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.3/lua/lspconfig/server_configurations/kotlin_language_server.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/kotlin_language_server.lua deleted file mode 100644 index a955fe6..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/kotlin_language_server.lua +++ /dev/null @@ -1,71 +0,0 @@ -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 -} - -local fallback_root_files = { - 'build.gradle', -- Gradle - 'build.gradle.kts', -- Gradle -} - -return { - default_config = { - filetypes = { 'kotlin' }, - root_dir = function(fname) - return util.root_pattern(unpack(root_files))(fname) or util.root_pattern(unpack(fallback_root_files))(fname) - end, - cmd = { bin_name }, - }, - 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. - ]], - default_config = { - root_dir = [[root_pattern("settings.gradle")]], - cmd = { 'kotlin-language-server' }, - capabilities = [[ - smart code completion, - diagnostics, - hover, - document symbols, - definition lookup, - method signature help, - dependency resolution, - additional plugins from: https://github.com/fwcd - - Snipped of License (refer to source for full License): - - The MIT License (MIT) - - Copyright (c) 2016 George Fraser - Copyright (c) 2018 fwcd - - ]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/lean3ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/lean3ls.lua deleted file mode 100644 index b35a693..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/lean3ls.lua +++ /dev/null @@ -1,54 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'lean-language-server' -local args = { '--stdio', '--', '-M', '4096', '-T', '100000' } -local cmd = { bin_name, unpack(args) } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, unpack(args) } -end - -return { - default_config = { - cmd = cmd, - 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.3/lua/lspconfig/server_configurations/leanls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/leanls.lua deleted file mode 100644 index 208598a..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/leanls.lua +++ /dev/null @@ -1,77 +0,0 @@ -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.3/lua/lspconfig/server_configurations/lelwel_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/lelwel_ls.lua deleted file mode 100644 index ac8c456..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/lelwel_ls.lua +++ /dev/null @@ -1,21 +0,0 @@ -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.3/lua/lspconfig/server_configurations/lemminx.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/lemminx.lua deleted file mode 100644 index 5bcf1cf..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/lemminx.lua +++ /dev/null @@ -1,23 +0,0 @@ -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 at https://download.jboss.org/jbosstools/vscode/stable/lemminx-binary/ and place it in your PATH. - -NOTE to macOS users: Binaries from unidentified developers are blocked by default. If you trust the downloaded binary from jboss.org, 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.3/lua/lspconfig/server_configurations/ltex.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/ltex.lua deleted file mode 100644 index 0aeb387..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/ltex.lua +++ /dev/null @@ -1,47 +0,0 @@ -local util = require 'lspconfig.util' - -local language_id_mapping = { - bib = 'bibtex', - plaintex = 'tex', - rnoweb = 'sweave', - rst = 'restructuredtext', - tex = 'latex', - xhtml = 'xhtml', -} - -local bin_name = 'ltex-ls' -if vim.fn.has 'win32' == 1 then - bin_name = bin_name .. '.bat' -end - -return { - default_config = { - cmd = { bin_name }, - filetypes = { 'bib', 'gitcommit', 'markdown', 'org', 'plaintex', 'rst', 'rnoweb', 'tex' }, - root_dir = util.find_git_ancestor, - single_file_support = true, - get_language_id = function(_, filetype) - local language_id = language_id_mapping[filetype] - if language_id then - return language_id - else - return filetype - end - end, - }, - 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. - -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.3/lua/lspconfig/server_configurations/metals.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/metals.lua deleted file mode 100644 index b05db5c..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/metals.lua +++ /dev/null @@ -1,45 +0,0 @@ -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, - }, - }, - }, - 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.html#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`. You can also manually bootstrap Metals with the following command. - -```bash -cs bootstrap \ - --java-opt -Xss4m \ - --java-opt -Xms100m \ - org.scalameta:metals_2.12:<enter-version-here> \ - -r bintray:scalacenter/releases \ - -r sonatype:snapshots \ - -o /usr/local/bin/metals -f -``` -]], - default_config = { - root_dir = [[util.root_pattern("build.sbt", "build.sc", "build.gradle", "pom.xml")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/mint.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/mint.lua deleted file mode 100644 index 7fde1c4..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/mint.lua +++ /dev/null @@ -1,20 +0,0 @@ -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.3/lua/lspconfig/server_configurations/mm0_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/mm0_ls.lua deleted file mode 100644 index 513bbeb..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/mm0_ls.lua +++ /dev/null @@ -1,20 +0,0 @@ -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.3/lua/lspconfig/server_configurations/nickel_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/nickel_ls.lua deleted file mode 100644 index 3a9387e..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/nickel_ls.lua +++ /dev/null @@ -1,37 +0,0 @@ -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 prequisite for autostarting a server), -install the [Nickel vim plugin](https://github.com/nickel-lang/vim-nickel). - ]], - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/nimls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/nimls.lua deleted file mode 100644 index f10b002..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/nimls.lua +++ /dev/null @@ -1,21 +0,0 @@ -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.3/lua/lspconfig/server_configurations/ocamlls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/ocamlls.lua deleted file mode 100644 index fcc25db..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/ocamlls.lua +++ /dev/null @@ -1,28 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'ocaml-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end -return { - default_config = { - cmd = cmd, - filetypes = { '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.3/lua/lspconfig/server_configurations/ocamllsp.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/ocamllsp.lua deleted file mode 100644 index 1528471..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/ocamllsp.lua +++ /dev/null @@ -1,38 +0,0 @@ -local util = require 'lspconfig.util' - -local language_id_of = { - menhir = 'ocaml.menhir', - ocaml = 'ocaml', - ocamlinterface = 'ocaml.interface', - ocamllex = 'ocaml.ocamllex', - reason = 'reason', -} - -local get_language_id = function(_, ftype) - return language_id_of[ftype] -end - -return { - default_config = { - cmd = { 'ocamllsp' }, - filetypes = { 'ocaml', 'ocaml.menhir', 'ocaml.interface', 'ocaml.ocamllex', 'reason' }, - root_dir = util.root_pattern('*.opam', 'esy.json', 'package.json', '.git'), - 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 pin add ocaml-lsp-server https://github.com/ocaml/ocaml-lsp.git -opam install ocaml-lsp-server -``` - ]], - default_config = { - root_dir = [[root_pattern("*.opam", "esy.json", "package.json", ".git")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/ols.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/ols.lua deleted file mode 100644 index 65dd085..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/ols.lua +++ /dev/null @@ -1,20 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'ols' }, - filetypes = { 'odin' }, - root_dir = util.root_pattern('ols.json', '.git'), - single_file_support = true, - }, - docs = { - description = [[ - https://github.com/DanielGavin/ols - - `Odin Language Server`. - ]], - default_config = { - root_dir = [[util.root_pattern("ols.json", ".git")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/omnisharp.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/omnisharp.lua deleted file mode 100644 index b51d898..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/omnisharp.lua +++ /dev/null @@ -1,52 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - filetypes = { 'cs', 'vb' }, - root_dir = function(fname) - return util.root_pattern '*.sln'(fname) or util.root_pattern '*.csproj'(fname) - end, - on_new_config = function(new_config, new_root_dir) - if new_root_dir then - table.insert(new_config.cmd, '-s') - table.insert(new_config.cmd, new_root_dir) - end - end, - init_options = {}, - }, - -- on_new_config = function(new_config) end; - -- on_attach = function(client, bufnr) end; - docs = { - description = [[ -https://github.com/omnisharp/omnisharp-roslyn -OmniSharp server based on Roslyn workspaces - -`omnisharp-roslyn` can be installed by downloading and extracting a release from [here](https://github.com/OmniSharp/omnisharp-roslyn/releases). -Omnisharp can also be built from source by following the instructions [here](https://github.com/omnisharp/omnisharp-roslyn#downloading-omnisharp). - -Omnisharp requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. - -**By default, omnisharp-roslyn doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. - -```lua -local pid = vim.fn.getpid() --- On linux/darwin if using a release build, otherwise under scripts/OmniSharp(.Core)(.cmd) -local omnisharp_bin = "/path/to/omnisharp-repo/run" --- on Windows --- local omnisharp_bin = "/path/to/omnisharp/OmniSharp.exe" -require'lspconfig'.omnisharp.setup{ - cmd = { omnisharp_bin, "--languageserver" , "--hostPID", tostring(pid) }; - ... -} -``` - -Note, if you download the executable for darwin you will need to strip the quarantine label to run: -```bash -find /path/to/omnisharp-osx | xargs xattr -r -d com.apple.quarantine -``` -]], - default_config = { - root_dir = [[root_pattern(".sln") or root_pattern(".csproj")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/opencl_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/opencl_ls.lua deleted file mode 100644 index dc88d24..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/opencl_ls.lua +++ /dev/null @@ -1,21 +0,0 @@ -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.3/lua/lspconfig/server_configurations/openscad_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/openscad_ls.lua deleted file mode 100644 index e5ca9ca..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/openscad_ls.lua +++ /dev/null @@ -1,32 +0,0 @@ -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.3/lua/lspconfig/server_configurations/pasls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/pasls.lua deleted file mode 100644 index 5758c82..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/pasls.lua +++ /dev/null @@ -1,28 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'pasls' }, - filetypes = { 'pascal' }, - root_dir = util.find_git_ancestor, - 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.3/lua/lspconfig/server_configurations/perlls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/perlls.lua deleted file mode 100644 index 5d241a5..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/perlls.lua +++ /dev/null @@ -1,39 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { - 'perl', - '-MPerl::LanguageServer', - '-e', - 'Perl::LanguageServer::run', - '--', - '--port 13603', - '--nostdio 0', - '--version 2.1.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.3/lua/lspconfig/server_configurations/perlnavigator.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/perlnavigator.lua deleted file mode 100644 index 7ba3895..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/perlnavigator.lua +++ /dev/null @@ -1,39 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = {}, - filetypes = { 'perl' }, - root_dir = util.find_git_ancestor, - single_file_support = true, - }, - docs = { - description = [[ -https://github.com/bscan/PerlNavigator - -A Perl language server - -**By default, perlnavigator 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 PerlNavigator repo, install based on the [instructions](https://github.com/bscan/PerlNavigator#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 `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.3/lua/lspconfig/server_configurations/perlpls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/perlpls.lua deleted file mode 100644 index 3326028..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/perlpls.lua +++ /dev/null @@ -1,29 +0,0 @@ -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.3/lua/lspconfig/server_configurations/phpactor.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/phpactor.lua deleted file mode 100644 index 5a1f0d1..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/phpactor.lua +++ /dev/null @@ -1,26 +0,0 @@ -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')(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.3/lua/lspconfig/server_configurations/please.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/please.lua deleted file mode 100644 index 085d1e7..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/please.lua +++ /dev/null @@ -1,19 +0,0 @@ -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.3/lua/lspconfig/server_configurations/powershell_es.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/powershell_es.lua deleted file mode 100644 index ac723f4..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/powershell_es.lua +++ /dev/null @@ -1,72 +0,0 @@ -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.3/lua/lspconfig/server_configurations/prismals.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/prismals.lua deleted file mode 100644 index f330e25..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/prismals.lua +++ /dev/null @@ -1,34 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'prisma-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { '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.3/lua/lspconfig/server_configurations/prosemd_lsp.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/prosemd_lsp.lua deleted file mode 100644 index 048e4b4..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/prosemd_lsp.lua +++ /dev/null @@ -1,22 +0,0 @@ -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.3/lua/lspconfig/server_configurations/psalm.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/psalm.lua deleted file mode 100644 index 01f7581..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/psalm.lua +++ /dev/null @@ -1,29 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'psalm-language-server' - -if vim.fn.has 'win32' == 1 then - bin_name = bin_name .. '.bat' -end - -return { - default_config = { - cmd = { bin_name }, - 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.3/lua/lspconfig/server_configurations/puppet.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/puppet.lua deleted file mode 100644 index 18a1532..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/puppet.lua +++ /dev/null @@ -1,38 +0,0 @@ -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.3/lua/lspconfig/server_configurations/purescriptls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/purescriptls.lua deleted file mode 100644 index 495133d..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/purescriptls.lua +++ /dev/null @@ -1,28 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'purescript-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { 'purescript' }, - root_dir = util.root_pattern('bower.json', 'psc-package.json', 'spago.dhall'), - }, - docs = { - description = [[ -https://github.com/nwolverson/purescript-language-server -`purescript-language-server` can be installed via `npm` -```sh -npm install -g purescript-language-server -``` -]], - default_config = { - root_dir = [[root_pattern("spago.dhall, 'psc-package.json', bower.json")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/pylsp.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/pylsp.lua deleted file mode 100644 index 7284fac..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/pylsp.lua +++ /dev/null @@ -1,31 +0,0 @@ -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. - -The language server can be installed via `pipx install 'python-lsp-server[all]'`. -Further instructions can be found in the [project's README](https://github.com/python-lsp/python-lsp-server). - -Note: This is a community fork of `pyls`. - ]], - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/pyre.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/pyre.lua deleted file mode 100644 index 5c2f8fb..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/pyre.lua +++ /dev/null @@ -1,22 +0,0 @@ -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.3/lua/lspconfig/server_configurations/pyright.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/pyright.lua deleted file mode 100644 index a198477..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/pyright.lua +++ /dev/null @@ -1,56 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'pyright-langserver' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -local root_files = { - 'pyproject.toml', - 'setup.py', - 'setup.cfg', - 'requirements.txt', - 'Pipfile', - 'pyrightconfig.json', -} - -local function organize_imports() - local params = { - command = 'pyright.organizeimports', - arguments = { vim.uri_from_bufnr(0) }, - } - vim.lsp.buf.execute_command(params) -end - -return { - default_config = { - cmd = cmd, - filetypes = { 'python' }, - root_dir = util.root_pattern(unpack(root_files)), - single_file_support = true, - settings = { - python = { - analysis = { - autoSearchPaths = true, - useLibraryCodeForTypes = true, - diagnosticMode = 'workspace', - }, - }, - }, - }, - commands = { - PyrightOrganizeImports = { - organize_imports, - description = 'Organize Imports', - }, - }, - docs = { - description = [[ -https://github.com/microsoft/pyright - -`pyright`, a static type checker and language server for python -]], - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/quick_lint_js.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/quick_lint_js.lua deleted file mode 100644 index 29daa96..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/quick_lint_js.lua +++ /dev/null @@ -1,19 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'quick-lint-js', '--lsp-server' }, - filetypes = { 'javascript' }, - 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.3/lua/lspconfig/server_configurations/r_language_server.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/r_language_server.lua deleted file mode 100644 index 7e1e3f3..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/r_language_server.lua +++ /dev/null @@ -1,28 +0,0 @@ -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.3/lua/lspconfig/server_configurations/racket_langserver.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/racket_langserver.lua deleted file mode 100644 index 25bd0ab..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/racket_langserver.lua +++ /dev/null @@ -1,21 +0,0 @@ -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.3/lua/lspconfig/server_configurations/reason_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/reason_ls.lua deleted file mode 100644 index 45e7d0b..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/reason_ls.lua +++ /dev/null @@ -1,23 +0,0 @@ -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 - -**By default, reason_ls 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. - -You can install reason language server from [reason-language-server](https://github.com/jaredly/reason-language-server) repository. - -```lua -cmd = {'<path_to_reason_language_server>'} -``` -]], - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/remark_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/remark_ls.lua deleted file mode 100644 index 4ef3717..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/remark_ls.lua +++ /dev/null @@ -1,50 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'remark-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { 'markdown' }, - root_dir = util.find_git_ancestor, - 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.3/lua/lspconfig/server_configurations/rescriptls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/rescriptls.lua deleted file mode 100644 index 1c80ada..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/rescriptls.lua +++ /dev/null @@ -1,42 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = {}, - filetypes = { 'rescript' }, - root_dir = util.root_pattern('bsconfig.json', '.git'), - settings = {}, - }, - docs = { - description = [[ -https://github.com/rescript-lang/rescript-vscode - -ReScript language server - -**By default, rescriptls 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. - -You can use the bundled language server inside the [vim-rescript](https://github.com/rescript-lang/vim-rescript) repo. - -Clone the vim-rescript repo and point `cmd` to `server.js` inside `server/out` directory: - -```lua -cmd = {'node', '<path_to_repo>/server/out/server.js', '--stdio'} - -``` - -If you have vim-rescript installed you can also use that installation. for example if you're using packer.nvim you can set cmd to something like this: - -```lua -cmd = { - 'node', - '/home/username/.local/share/nvim/site/pack/packer/start/vim-rescript/server/out/server.js', - '--stdio' -} -``` - -Another option is to use vscode extension [release](https://github.com/rescript-lang/rescript-vscode/releases). -Take a look at [here](https://github.com/rescript-lang/rescript-vscode#use-with-other-editors) for instructions. -]], - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/rls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/rls.lua deleted file mode 100644 index 363b81d..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/rls.lua +++ /dev/null @@ -1,42 +0,0 @@ -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.3/lua/lspconfig/server_configurations/rnix.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/rnix.lua deleted file mode 100644 index aa7f00e..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/rnix.lua +++ /dev/null @@ -1,28 +0,0 @@ -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.3/lua/lspconfig/server_configurations/robotframework_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/robotframework_ls.lua deleted file mode 100644 index 7cb772b..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/robotframework_ls.lua +++ /dev/null @@ -1,21 +0,0 @@ -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')(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')(fname) or util.find_git_ancestor(fname)", - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/rome.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/rome.lua deleted file mode 100644 index 075d31a..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/rome.lua +++ /dev/null @@ -1,42 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'rome' -local cmd = { bin_name, 'lsp' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, 'lsp' } -end - -return { - default_config = { - cmd = cmd, - 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. - -```sh -npm install [-g] rome -``` -]], - default_config = { - root_dir = [[root_pattern('package.json', 'node_modules', '.git')]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/rust_analyzer.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/rust_analyzer.lua deleted file mode 100644 index 6331cf5..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/rust_analyzer.lua +++ /dev/null @@ -1,79 +0,0 @@ -local util = require 'lspconfig.util' - -local function reload_workspace(bufnr) - bufnr = util.validate_bufnr(bufnr) - vim.lsp.buf_request(bufnr, 'rust-analyzer/reloadWorkspace', nil, function(err) - if err then - error(tostring(err)) - end - vim.notify 'Cargo workspace reloaded' - end) -end - -return { - default_config = { - cmd = { 'rust-analyzer' }, - filetypes = { 'rust' }, - root_dir = function(fname) - local cargo_crate_dir = util.root_pattern 'Cargo.toml'(fname) - local cmd = { 'cargo', 'metadata', '--no-deps', '--format-version', '1' } - if cargo_crate_dir ~= nil then - cmd[#cmd + 1] = '--manifest-path' - cmd[#cmd + 1] = util.path.join(cargo_crate_dir, 'Cargo.toml') - end - local cargo_metadata = '' - local cargo_metadata_err = '' - local cm = vim.fn.jobstart(cmd, { - on_stdout = function(_, d, _) - cargo_metadata = table.concat(d, '\n') - end, - on_stderr = function(_, d, _) - cargo_metadata_err = table.concat(d, '\n') - end, - stdout_buffered = true, - stderr_buffered = true, - }) - if cm > 0 then - cm = vim.fn.jobwait({ cm })[1] - else - cm = -1 - end - local cargo_workspace_dir = nil - if cm == 0 then - cargo_workspace_dir = vim.fn.json_decode(cargo_metadata)['workspace_root'] - else - vim.notify( - string.format('[lspconfig] cmd (%q) failed:\n%s', table.concat(cmd, ' '), cargo_metadata_err), - vim.log.levels.WARN - ) - end - return cargo_workspace_dir - or cargo_crate_dir - or util.root_pattern 'rust-project.json'(fname) - or util.find_git_ancestor(fname) - end, - settings = { - ['rust-analyzer'] = {}, - }, - }, - commands = { - CargoReload = { - function() - reload_workspace(0) - end, - description = 'Reload current cargo workspace', - }, - }, - docs = { - description = [[ -https://github.com/rust-analyzer/rust-analyzer - -rust-analyzer (aka rls 2.0), a language server for Rust - -See [docs](https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/user#settings) for extra settings. - ]], - default_config = { - root_dir = [[root_pattern("Cargo.toml", "rust-project.json")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/salt_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/salt_ls.lua deleted file mode 100644 index 65d1d32..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/salt_ls.lua +++ /dev/null @@ -1,24 +0,0 @@ -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.3/lua/lspconfig/server_configurations/scry.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/scry.lua deleted file mode 100644 index 8350a43..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/scry.lua +++ /dev/null @@ -1,22 +0,0 @@ -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.3/lua/lspconfig/server_configurations/serve_d.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/serve_d.lua deleted file mode 100644 index 09d1b10..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/serve_d.lua +++ /dev/null @@ -1,20 +0,0 @@ -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.3/lua/lspconfig/server_configurations/sixtyfps.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/sixtyfps.lua deleted file mode 100644 index da90fe3..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/sixtyfps.lua +++ /dev/null @@ -1,28 +0,0 @@ -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.3/lua/lspconfig/server_configurations/slint_lsp.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/slint_lsp.lua deleted file mode 100644 index e921cb6..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/slint_lsp.lua +++ /dev/null @@ -1,26 +0,0 @@ -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.3/lua/lspconfig/server_configurations/solang.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/solang.lua deleted file mode 100644 index be1d1ec..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/solang.lua +++ /dev/null @@ -1,27 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'solang', '--language-server', '--target', 'ewasm' }, - 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.3/lua/lspconfig/server_configurations/solargraph.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/solargraph.lua deleted file mode 100644 index 4fba400..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/solargraph.lua +++ /dev/null @@ -1,38 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'solargraph' -local cmd = { bin_name, 'stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, 'stdio' } -end - -return { - default_config = { - cmd = cmd, - 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.3/lua/lspconfig/server_configurations/solc.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/solc.lua deleted file mode 100644 index 42e44fe..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/solc.lua +++ /dev/null @@ -1,19 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'solc', '--lsp' }, - filetypes = { 'solidity' }, - root_dir = util.root_pattern '.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(".git")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/solidity_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/solidity_ls.lua deleted file mode 100644 index 4d4c490..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/solidity_ls.lua +++ /dev/null @@ -1,24 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'solidity-language-server' -if vim.fn.has 'win32' == 1 then - bin_name = bin_name .. '.cmd' -end - -return { - default_config = { - cmd = { bin_name, '--stdio' }, - filetypes = { 'solidity' }, - root_dir = util.root_pattern('.git', 'package.json'), - }, - docs = { - description = [[ -npm install -g solidity-language-server - -solidity-language-server is a language server for the solidity language ported from the vscode solidity extension -]], - default_config = { - root_dir = [[root_pattern(".git", "package.json")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/sorbet.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/sorbet.lua deleted file mode 100644 index 86d3443..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/sorbet.lua +++ /dev/null @@ -1,26 +0,0 @@ -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.3/lua/lspconfig/server_configurations/sourcekit.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/sourcekit.lua deleted file mode 100644 index d90b30a..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/sourcekit.lua +++ /dev/null @@ -1,19 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'sourcekit-lsp' }, - filetypes = { 'swift', 'c', 'cpp', 'objective-c', 'objective-cpp' }, - root_dir = util.root_pattern('Package.swift', '.git'), - }, - docs = { - description = [[ -https://github.com/apple/sourcekit-lsp - -Language server for Swift and C/C++/Objective-C. - ]], - default_config = { - root_dir = [[root_pattern("Package.swift", ".git")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/sourcery.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/sourcery.lua deleted file mode 100644 index 9100c5a..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/sourcery.lua +++ /dev/null @@ -1,55 +0,0 @@ -local util = require 'lspconfig/util' - -local root_files = { - 'pyproject.toml', - 'setup.py', - 'setup.cfg', - 'requirements.txt', - 'Pipfile', - 'pyrightconfig.json', -} - -return { - default_config = { - cmd = { 'sourcery', 'lsp' }, - filetypes = { 'python' }, - 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 then - local notify = vim.notify_once or vim.notify - notify('[lspconfig] The authentication token must be provided in config.init_options', 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 initializationOptions param to be populated as shown below and will respond with the list of ServerCapabilities that it supports. - -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' -} -]], - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/spectral.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/spectral.lua deleted file mode 100644 index e21b6cb..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/spectral.lua +++ /dev/null @@ -1,29 +0,0 @@ -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.3/lua/lspconfig/server_configurations/sqlls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/sqlls.lua deleted file mode 100644 index 434a7ce..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/sqlls.lua +++ /dev/null @@ -1,18 +0,0 @@ -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.3/lua/lspconfig/server_configurations/sqls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/sqls.lua deleted file mode 100644 index 2680253..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/sqls.lua +++ /dev/null @@ -1,25 +0,0 @@ -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/lighttiger2505/sqls - -```lua -require'lspconfig'.sqls.setup{ - cmd = {"path/to/command", "-config", "path/to/config.yml"}; - ... -} -``` -Sqls can be installed via `go get github.com/lighttiger2505/sqls`. Instructions for compiling Sqls from the source can be found at [lighttiger2505/sqls](https://github.com/lighttiger2505/sqls). - - ]], - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/stylelint_lsp.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/stylelint_lsp.lua deleted file mode 100644 index d471d26..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/stylelint_lsp.lua +++ /dev/null @@ -1,54 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'stylelint-lsp' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { - 'css', - 'less', - 'scss', - 'sugarss', - 'vue', - 'wxss', - 'javascript', - 'javascriptreact', - 'typescript', - 'typescriptreact', - }, - root_dir = util.root_pattern('.stylelintrc', 'package.json'), - 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 - } - } -} -``` -]], - default_config = { - root_dir = [[ root_pattern('.stylelintrc', 'package.json') ]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/sumneko_lua.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/sumneko_lua.lua deleted file mode 100644 index 6338095..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/sumneko_lua.lua +++ /dev/null @@ -1,63 +0,0 @@ -local util = require 'lspconfig.util' - -local root_files = { - '.luarc.json', - '.luacheckrc', - '.stylua.toml', - 'selene.toml', -} -return { - default_config = { - cmd = { 'lua-language-server' }, - filetypes = { 'lua' }, - root_dir = function(fname) - return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) - end, - single_file_support = true, - log_level = vim.lsp.protocol.MessageType.Warning, - settings = { Lua = { telemetry = { enable = false } } }, - }, - docs = { - description = [[ -https://github.com/sumneko/lua-language-server - -Lua language server. - -`lua-language-server` can be installed by following the instructions [here](https://github.com/sumneko/lua-language-server/wiki/Build-and-Run). The default `cmd` assumes that the `lua-language-server` binary can be found in `$PATH`. - -```lua -local runtime_path = vim.split(package.path, ';') -table.insert(runtime_path, "lua/?.lua") -table.insert(runtime_path, "lua/?/init.lua") - -require'lspconfig'.sumneko_lua.setup { - settings = { - Lua = { - runtime = { - -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) - version = 'LuaJIT', - -- Setup your lua path - path = runtime_path, - }, - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = {'vim'}, - }, - workspace = { - -- Make the server aware of Neovim runtime files - library = vim.api.nvim_get_runtime_file("", true), - }, - -- Do not send telemetry data containing a randomized but unique identifier - telemetry = { - enable = false, - }, - }, - }, -} -``` -]], - default_config = { - root_dir = [[root_pattern(".luarc.json", ".luacheckrc", ".stylua.toml", "selene.toml", ".git")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/svelte.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/svelte.lua deleted file mode 100644 index 14db192..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/svelte.lua +++ /dev/null @@ -1,29 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'svelteserver' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { 'svelte' }, - root_dir = util.root_pattern('package.json', '.git'), - }, - docs = { - description = [[ -https://github.com/sveltejs/language-tools/tree/master/packages/language-server - -`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.3/lua/lspconfig/server_configurations/svls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/svls.lua deleted file mode 100644 index ff4d810..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/svls.lua +++ /dev/null @@ -1,24 +0,0 @@ -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.3/lua/lspconfig/server_configurations/tailwindcss.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/tailwindcss.lua deleted file mode 100644 index 5a5abc0..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/tailwindcss.lua +++ /dev/null @@ -1,126 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'tailwindcss-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - -- filetypes copied and adjusted from tailwindcss-intellisense - filetypes = { - -- html - 'aspnetcorerazor', - 'astro', - 'astro-markdown', - 'blade', - 'django-html', - 'htmldjango', - 'edge', - 'eelixir', -- vim ft - 'ejs', - 'erb', - 'eruby', -- vim ft - 'gohtml', - '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', - }, - init_options = { - userLanguages = { - eelixir = 'html-eex', - eruby = 'erb', - }, - }, - settings = { - tailwindCSS = { - validate = true, - lint = { - cssConflict = 'warning', - invalidApply = 'error', - invalidScreen = 'error', - invalidVariant = 'error', - invalidConfigPath = 'error', - invalidTailwindDirective = 'error', - recommendedVariantOrder = 'warning', - }, - classAttributes = { - 'class', - 'className', - '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.ts')(fname) - or util.root_pattern('postcss.config.js', '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.ts', 'postcss.config.js', 'postcss.config.ts', 'package.json', 'node_modules', '.git')]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/taplo.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/taplo.lua deleted file mode 100644 index 320ced9..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/taplo.lua +++ /dev/null @@ -1,27 +0,0 @@ -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/lsp/ - -Language server for Taplo, a TOML toolkit. - -`taplo-cli` can be installed via `cargo`: -```sh -cargo install --locked taplo-cli -``` - ]], - default_config = { - root_dir = [[root_pattern("*.toml", ".git")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/teal_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/teal_ls.lua deleted file mode 100644 index b554add..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/teal_ls.lua +++ /dev/null @@ -1,29 +0,0 @@ -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.3/lua/lspconfig/server_configurations/terraform_lsp.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/terraform_lsp.lua deleted file mode 100644 index 48a6fc5..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/terraform_lsp.lua +++ /dev/null @@ -1,43 +0,0 @@ -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.3/lua/lspconfig/server_configurations/terraformls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/terraformls.lua deleted file mode 100644 index 3eb4a1c..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/terraformls.lua +++ /dev/null @@ -1,42 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'terraform-ls', 'serve' }, - filetypes = { 'terraform' }, - 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) -]], - default_config = { - root_dir = [[root_pattern(".terraform", ".git")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/texlab.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/texlab.lua deleted file mode 100644 index 88bfa20..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/texlab.lua +++ /dev/null @@ -1,126 +0,0 @@ -local util = require 'lspconfig.util' - -local texlab_build_status = vim.tbl_add_reverse_lookup { - Success = 0, - Error = 1, - Failure = 2, - Cancelled = 3, -} - -local texlab_forward_status = vim.tbl_add_reverse_lookup { - Success = 0, - Error = 1, - Failure = 2, - Unconfigured = 3, -} - -local function buf_build(bufnr) - bufnr = util.validate_bufnr(bufnr) - local texlab_client = util.get_active_client_by_name(bufnr, 'texlab') - local params = { - textDocument = { uri = vim.uri_from_bufnr(bufnr) }, - } - 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 params = { - textDocument = { uri = vim.uri_from_bufnr(bufnr) }, - position = { line = vim.fn.line '.' - 1, character = vim.fn.col '.' }, - } - 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', 'bib' }, - root_dir = function(fname) - return util.root_pattern '.latexmkrc'(fname) or util.find_git_ancestor(fname) - end, - 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/blob/master/docs/options.md for configuration options. -]], - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/tflint.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/tflint.lua deleted file mode 100644 index de2a1d8..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/tflint.lua +++ /dev/null @@ -1,20 +0,0 @@ -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.3/lua/lspconfig/server_configurations/theme_check.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/theme_check.lua deleted file mode 100644 index 94d6774..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/theme_check.lua +++ /dev/null @@ -1,31 +0,0 @@ -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.3/lua/lspconfig/server_configurations/tsserver.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/tsserver.lua deleted file mode 100644 index 0f916fe..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/tsserver.lua +++ /dev/null @@ -1,60 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'typescript-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - init_options = { hostInfo = 'neovim' }, - cmd = cmd, - filetypes = { - 'javascript', - 'javascriptreact', - 'javascript.jsx', - 'typescript', - 'typescriptreact', - 'typescript.tsx', - }, - root_dir = function(fname) - return util.root_pattern 'tsconfig.json'(fname) - or util.root_pattern('package.json', 'jsconfig.json', '.git')(fname) - end, - }, - docs = { - description = [[ -https://github.com/theia-ide/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 type 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("package.json", "tsconfig.json", "jsconfig.json", ".git")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/typeprof.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/typeprof.lua deleted file mode 100644 index ab9dc8e..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/typeprof.lua +++ /dev/null @@ -1,19 +0,0 @@ -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.3/lua/lspconfig/server_configurations/vala_ls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/vala_ls.lua deleted file mode 100644 index 842c561..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/vala_ls.lua +++ /dev/null @@ -1,40 +0,0 @@ -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.3/lua/lspconfig/server_configurations/vdmj.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/vdmj.lua deleted file mode 100644 index 9699b93..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/vdmj.lua +++ /dev/null @@ -1,128 +0,0 @@ -local util = require 'lspconfig.util' - -local mavenrepo = util.path.join(vim.env.HOME, '.m2', 'repository', 'com', 'fujitsu') - -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 = mavenrepo, - version = get_latest_installed_version(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/com/fujitsu', - 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 = vim.tbl_flatten { java_cmd, vdmj_cmd } - end, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/verible.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/verible.lua deleted file mode 100644 index 3c4823a..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/verible.lua +++ /dev/null @@ -1,21 +0,0 @@ -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.3/lua/lspconfig/server_configurations/vimls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/vimls.lua deleted file mode 100644 index 4f0d1d9..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/vimls.lua +++ /dev/null @@ -1,41 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'vim-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { 'vim' }, - root_dir = function(fname) - return util.find_git_ancestor(fname) or vim.fn.getcwd() - end, - init_options = { - 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.3/lua/lspconfig/server_configurations/vls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/vls.lua deleted file mode 100644 index 36255c0..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/vls.lua +++ /dev/null @@ -1,32 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - filetypes = { '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). - -**By default, v-language-server 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 and compiled v-language-server. - -```lua --- set the path to the vls installation; -local vls_root_path = vim.fn.stdpath('cache')..'/lspconfig/vls' -local vls_binary = vls_root_path.."/cmd/vls/vls" - -require'lspconfig'.vls.setup { - cmd = {vls_binary}, -} -``` -]], - default_config = { - root_dir = [[root_pattern("v.mod", ".git")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/volar.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/volar.lua deleted file mode 100644 index 7742757..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/volar.lua +++ /dev/null @@ -1,138 +0,0 @@ -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', 'tsserverlibrary.js')) - or '' -end - --- https://github.com/johnsoncodehk/volar/blob/master/packages/shared/src/types.ts -local volar_init_options = { - typescript = { - serverPath = '', - }, - languageFeatures = { - implementation = true, - -- not supported - https://github.com/neovim/neovim/pull/14122 - semanticTokens = false, - references = true, - definition = true, - typeDefinition = true, - callHierarchy = true, - hover = true, - rename = true, - renameFileRefactoring = true, - signatureHelp = true, - codeAction = true, - completion = { - defaultTagNameCase = 'both', - defaultAttrNameCase = 'kebabCase', - }, - schemaRequestService = true, - documentHighlight = true, - documentLink = true, - codeLens = true, - diagnostics = true, - }, - documentFeatures = { - -- not supported - https://github.com/neovim/neovim/pull/13654 - documentColor = false, - selectionRange = true, - foldingRange = true, - linkedEditingRange = true, - documentSymbol = true, - documentFormatting = { - defaultPrintWidth = 100, - }, - }, -} - -local bin_name = 'vue-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end -return { - default_config = { - cmd = cmd, - filetypes = { '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.serverPath == '' - then - new_config.init_options.typescript.serverPath = get_typescript_server_path(new_root_dir) - end - end, - }, - docs = { - description = [[ -https://github.com/johnsoncodehk/volar/tree/master/packages/vue-language-server - -Volar language server for Vue - -Volar can be installed via npm: - -```sh -npm install -g @volar/vue-language-server -``` - -Volar by default supports Vue 3 projects. Vue 2 projects need [additional configuration](https://github.com/johnsoncodehk/volar/blob/master/extensions/vscode-vue-language-features/README.md?plain=1#L28-L63). - -**Take Over Mode** -Volar 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. The alternatives are: - -- use a global TypeScript Server installation - -```lua -require'lspconfig'.volar.setup{ - init_options = { - typescript = { - serverPath = '/path/to/.npm/lib/node_modules/typescript/lib/tsserverlib.js' - } - } -} -``` - -- use a global TypeScript Server installation if a local server is not found - -```lua -local util = require 'lspconfig.util' - -local function get_typescript_server_path(root_dir) - local project_root = util.find_node_modules_ancestor(root_dir) - - local local_tsserverlib = project_root ~= nil and util.path.join(project_root, 'node_modules', 'typescript', 'lib', 'tsserverlibrary.js') - local global_tsserverlib = '/home/[yourusernamehere]/.npm/lib/node_modules/typescript/lib/tsserverlibrary.js' - - if local_tsserverlib and util.path.exists(local_tsserverlib) then - return local_tsserverlib - else - return global_tsserverlib - end -end - -require'lspconfig'.volar.setup{ - on_new_config = function(new_config, new_root_dir) - new_config.init_options.typescript.serverPath = get_typescript_server_path(new_root_dir) - end, -} -``` - ]], - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/vuels.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/vuels.lua deleted file mode 100644 index d3d2d92..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/vuels.lua +++ /dev/null @@ -1,68 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'vls' -local cmd = { bin_name } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name } -end - -return { - default_config = { - cmd = cmd, - 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.3/lua/lspconfig/server_configurations/yamlls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/yamlls.lua deleted file mode 100644 index 52d8e6f..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/yamlls.lua +++ /dev/null @@ -1,87 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'yaml-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { 'yaml', 'yaml.docker-compose' }, - 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.3/lua/lspconfig/server_configurations/zeta_note.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/zeta_note.lua deleted file mode 100644 index 9798af9..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/zeta_note.lua +++ /dev/null @@ -1,28 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - filetypes = { 'markdown' }, - root_dir = util.root_pattern '.zeta.toml', - }, - docs = { - description = [[ -https://github.com/artempyanykh/zeta-note - -Markdown LSP server for easy note-taking with cross-references and diagnostics. - -Binaries can be downloaded from https://github.com/artempyanykh/zeta-note/releases - -**By default, zeta-note 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 zeta-note binary. - -```lua -require'lspconfig'.zeta_note.setup{ - cmd = {'path/to/zeta-note'} -} -``` -]], - default_config = { - root_dir = [[root_pattern(".zeta.toml")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/zk.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/zk.lua deleted file mode 100644 index c289045..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/zk.lua +++ /dev/null @@ -1,48 +0,0 @@ -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 = 'Index', - }, - 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 = [[ -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.3/lua/lspconfig/server_configurations/zls.lua b/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/zls.lua deleted file mode 100644 index d890fb6..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/server_configurations/zls.lua +++ /dev/null @@ -1,20 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'zls' }, - filetypes = { 'zig', 'zir' }, - root_dir = util.root_pattern('zls.json', '.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", ".git")]], - }, - }, -} diff --git a/start/lspconfig-0.1.3/lua/lspconfig/ui/lspinfo.lua b/start/lspconfig-0.1.3/lua/lspconfig/ui/lspinfo.lua deleted file mode 100644 index 42a7fed..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/ui/lspinfo.lua +++ /dev/null @@ -1,225 +0,0 @@ -local configs = require 'lspconfig.configs' -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()', -} - -local function trim_blankspace(cmd) - local trimmed_cmd = {} - for _, str in pairs(cmd) do - table.insert(trimmed_cmd, 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 function make_config_info(config) - local config_info = {} - config_info.name = config.name - if config.cmd then - config_info.cmd = remove_newlines(config.cmd) - if vim.fn.executable(config.cmd[1]) == 1 then - config_info.cmd_is_executable = 'true' - else - config_info.cmd_is_executable = error_messages.cmd_not_found - end - else - config_info.cmd = 'cmd not defined' - config_info.cmd_is_executable = 'NA' - end - - local buffer_dir = vim.fn.expand '%:p:h' - config_info.root_dir = config.get_root_dir(buffer_dir) or 'NA' - 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, - } - - vim.list_extend(lines, indent_lines(info_lines, '\t')) - - return lines -end - -local function make_client_info(client) - local client_info = {} - - client_info.cmd = remove_newlines(client.config.cmd) - if client.workspaceFolders then - client_info.root_dir = client.workspaceFolders[1].name - else - 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) - .. ', pid: ' - .. tostring(client.rpc.pid) - .. ', 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 buf_clients = vim.lsp.buf_get_clients() - local clients = vim.lsp.get_active_clients() - local buffer_filetype = vim.bo.filetype - - local win_info = windows.percentage_range_window(0.8, 0.7) - local bufnr, win_id = win_info.bufnr, win_info.win_id - - local buf_lines = {} - - local buf_client_names = {} - for _, client in pairs(buf_clients) do - table.insert(buf_client_names, client.name) - end - - local buf_client_ids = {} - for _, client in pairs(buf_clients) do - table.insert(buf_client_ids, client.id) - end - - local other_active_clients = {} - local client_names = {} - for _, client in pairs(clients) do - if not vim.tbl_contains(buf_client_ids, client.id) then - table.insert(other_active_clients, client) - end - table.insert(client_names, client.name) - end - - local header = { - '', - '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 pairs(buf_clients) do - local client_info = make_client_info(client) - 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 pairs(other_active_clients) do - local client_info = make_client_info(client) - 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 pairs(other_matching_configs) do - vim.list_extend(buf_lines, make_config_info(config)) - end - end - - local matching_config_header = { - '', - 'Configured servers list: ' .. table.concat(vim.tbl_keys(configs), ', '), - } - vim.list_extend(buf_lines, matching_config_header) - - local fmt_buf_lines = indent_lines(buf_lines, ' ') - - fmt_buf_lines = vim.lsp.util._trim(fmt_buf_lines, {}) - - vim.api.nvim_buf_set_lines(bufnr, 0, -1, true, fmt_buf_lines) - vim.api.nvim_buf_set_option(bufnr, 'modifiable', false) - vim.api.nvim_buf_set_option(bufnr, 'filetype', 'lspinfo') - - vim.api.nvim_buf_set_keymap(bufnr, 'n', '<esc>', '<cmd>bd<CR>', { noremap = true }) - vim.api.nvim_command( - string.format('autocmd BufHidden,BufLeave <buffer> ++once lua pcall(vim.api.nvim_win_close, %d, true)', win_id) - ) - - vim.fn.matchadd( - 'Error', - error_messages.no_filetype_defined .. '.\\|' .. 'cmd not defined\\|' .. error_messages.cmd_not_found - ) - vim.cmd 'let m=matchadd("string", "true")' - vim.cmd 'let m=matchadd("error", "false")' - for _, config in pairs(configs) do - vim.fn.matchadd('Title', '\\%(Client\\|Config\\):.*\\zs' .. config.name .. '\\ze') - vim.fn.matchadd('Visual', 'list:.*\\zs' .. config.name .. '\\ze') - if config.filetypes then - for _, ft in pairs(config.filetypes) do - vim.fn.matchadd('Type', '\\%(filetypes\\|filetype\\):.*\\zs' .. ft .. '\\ze') - end - end - end -end diff --git a/start/lspconfig-0.1.3/lua/lspconfig/ui/windows.lua b/start/lspconfig-0.1.3/lua/lspconfig/ui/windows.lua deleted file mode 100644 index 8a39204..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/ui/windows.lua +++ /dev/null @@ -1,117 +0,0 @@ --- The following is extracted and modified from plenary.vnim by --- TJ Devries. It is not a stable API, and is expected to change --- -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 = { - winblend = 15, - percentage = 0.9, -} - -function win_float.default_opts(options) - options = apply_defaults(options, win_float.default_options) - - 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) - 1) - 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' }, - }, - } - - 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) / 2 - 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) - - 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 vim.api.nvim_create_buf(false, true) - local win_id = vim.api.nvim_open_win(bufnr, true, win_opts) - vim.api.nvim_win_set_buf(win_id, bufnr) - - vim.cmd 'setlocal nocursorcolumn ts=2 sw=2' - - return { - bufnr = bufnr, - win_id = win_id, - } -end - -return win_float diff --git a/start/lspconfig-0.1.3/lua/lspconfig/util.lua b/start/lspconfig-0.1.3/lua/lspconfig/util.lua deleted file mode 100644 index 3febafc..0000000 --- a/start/lspconfig-0.1.3/lua/lspconfig/util.lua +++ /dev/null @@ -1,426 +0,0 @@ -local vim = vim -local validate = vim.validate -local api = vim.api -local lsp = vim.lsp -local uv = vim.loop -local fn = vim.fn - -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, -} - --- global on_setup hook -M.on_setup = nil - -function M.bufname_valid(bufname) - if bufname and bufname ~= '' and (bufname:match '^([a-zA-Z]:).*' or bufname:match '^/') then - return true - else - return false - end -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 - -function M.create_module_commands(module_name, commands) - for command_name, def in pairs(commands) do - local parts = { 'command!' } - -- Insert attributes. - for k, v in pairs(def) do - if type(k) == 'string' and type(v) == 'boolean' and v then - table.insert(parts, '-' .. k) - elseif type(k) == 'number' and type(v) == 'string' and v:match '^%-' then - table.insert(parts, v) - end - end - table.insert(parts, command_name) - -- The command definition. - table.insert( - parts, - string.format("lua require'lspconfig'[%q].commands[%q][1](<f-args>)", module_name, command_name) - ) - api.nvim_command(table.concat(parts, ' ')) - end -end - -function M.has_bins(...) - for i = 1, select('#', ...) do - if 0 == fn.executable((select(i, ...))) then - return false - end - end - return true -end - -M.script_path = function() - local str = debug.getinfo(2, 'S').source:sub(2) - return str:match '(.*[/\\])' -end - --- Some path utilities -M.path = (function() - local is_windows = uv.os_uname().version:match 'Windows' - - local function sanitize(path) - if is_windows then - path = path:sub(1, 1):upper() .. path:sub(2) - path = path:gsub('\\', '/') - end - return path - end - - local function exists(filename) - local stat = uv.fs_stat(filename) - return stat and stat.type or false - end - - local function is_dir(filename) - return exists(filename) == 'directory' - end - - local function is_file(filename) - return exists(filename) == 'file' - end - - local function is_fs_root(path) - if is_windows then - return path:match '^%a:$' - else - return path == '/' - end - end - - local function is_absolute(filename) - if is_windows then - return filename:match '^%a:' or filename:match '^\\\\' - else - return filename:match '^/' - end - end - - local function dirname(path) - local strip_dir_pat = '/([^/]+)$' - local strip_sep_pat = '/$' - if not path or #path == 0 then - return - 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(vim.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 - - return { - 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, - } -end)() - --- Returns a function(root_dir), which, when called with a root_dir it hasn't --- seen before, will call make_config(root_dir) and start a new client. -function M.server_per_root_dir_manager(make_config) - local clients = {} - local single_file_clients = {} - local manager = {} - - function manager.add(root_dir, single_file) - local client_id - -- This is technically unnecessary, as lspconfig's path utilities should be hermetic, - -- however users are free to return strings in custom root resolvers. - root_dir = M.path.sanitize(root_dir) - if single_file then - client_id = single_file_clients[root_dir] - elseif root_dir and M.path.is_dir(root_dir) then - client_id = clients[root_dir] - else - return - end - - -- Check if we have a client already or start and store it. - if not client_id then - local new_config = make_config(root_dir) - -- 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 - new_config.on_exit = M.add_hook_before(new_config.on_exit, function() - clients[root_dir] = nil - single_file_clients[root_dir] = nil - 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 - client_id = lsp.start_client(new_config) - - -- Handle failures in start_client - if not client_id then - return - end - - if single_file then - single_file_clients[root_dir] = client_id - else - clients[root_dir] = client_id - end - end - return client_id - end - - function manager.clients() - local res = {} - for _, id in pairs(clients) do - local client = lsp.get_client_by_id(id) - if client then - table.insert(res, client) - end - end - return res - end - - return manager -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.root_pattern(...) - local patterns = vim.tbl_flatten { ... } - local function matcher(path) - for _, pattern in ipairs(patterns) do - for _, p in ipairs(vim.fn.glob(M.path.join(path, pattern), true, true)) do - if M.path.exists(p) then - return path - end - end - end - end - return function(startpath) - return M.search_ancestors(startpath, matcher) - 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_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.get_active_clients_list_by_ft(filetype) - local clients = vim.lsp.get_active_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_clients_from_cmd_args(arg) - local result = {} - for id in (arg or ''):gmatch '(%d+)' do - result[id] = vim.lsp.get_client_by_id(tonumber(id)) - end - if vim.tbl_isempty(result) then - return M.get_managed_clients() - end - return vim.tbl_values(result) -end - -function M.get_active_client_by_name(bufnr, servername) - for _, client in pairs(vim.lsp.buf_get_clients(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 - -return M diff --git a/start/lspconfig-0.1.3/plugin/lspconfig.vim b/start/lspconfig-0.1.3/plugin/lspconfig.vim deleted file mode 100644 index 5c52d4e..0000000 --- a/start/lspconfig-0.1.3/plugin/lspconfig.vim +++ /dev/null @@ -1,16 +0,0 @@ -if exists('g:lspconfig') - finish -endif -let g:lspconfig = 1 - -lua << EOF -lsp_complete_configured_servers = function() - return table.concat(require'lspconfig'.available_servers(), '\n') -end -lsp_get_active_client_ids = function() - return vim.tbl_map(function(client) - return ("%d (%s)"):format(client.id, client.name) - end, require'lspconfig.util'.get_managed_clients()) -end -require'lspconfig'._root._setup() -EOF |