aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-lspconfig/server_configurations
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-07-22 03:15:43 +0200
committerGitHub <noreply@github.com>2022-07-22 03:15:43 +0200
commit11c0af44e69a165df41e5fe6681b47f4204d3623 (patch)
tree28bc4c9c6e7295996924d6b2ce8e620b2a963fa2 /lua/mason-lspconfig/server_configurations
parentfeat: add markdownlint linter (#107) (diff)
downloadmason-11c0af44e69a165df41e5fe6681b47f4204d3623.tar
mason-11c0af44e69a165df41e5fe6681b47f4204d3623.tar.gz
mason-11c0af44e69a165df41e5fe6681b47f4204d3623.tar.bz2
mason-11c0af44e69a165df41e5fe6681b47f4204d3623.tar.lz
mason-11c0af44e69a165df41e5fe6681b47f4204d3623.tar.xz
mason-11c0af44e69a165df41e5fe6681b47f4204d3623.tar.zst
mason-11c0af44e69a165df41e5fe6681b47f4204d3623.zip
refactor!: extract mason-lspconfig to separate plugin (#109)
The rationale behind this is to make boundaries clearer as mason.nvim has no direct relation with lspconfig per se. Also, hopefully, by having it as a separate package like this would encourage more people to write similar extensions (think mason-dap and mason-null-ls). Ideally such extensions wouldn't be required at all, but there are definitely gaps to fill as of today. From now on you'll need to add `williamboman/mason-lspconfig.nvim` as a plugin if you want to use the `mason-lspconfig` extension: ```lua use { { "williamboman/mason.nvim", branch = "alpha" }, "williamboman/mason-lspconfig.nvim", "neovim/nvim-lspconfig", } ``` ```lua Plug "williamboman/mason.nvim", { 'branch': 'alpha' } Plug "williamboman/mason-lspconfig.nvim" Plug "neovim/nvim-lspconfig" ```
Diffstat (limited to 'lua/mason-lspconfig/server_configurations')
-rw-r--r--lua/mason-lspconfig/server_configurations/angularls/init.lua39
-rw-r--r--lua/mason-lspconfig/server_configurations/apex_ls/init.lua8
-rw-r--r--lua/mason-lspconfig/server_configurations/bicep/init.lua5
-rw-r--r--lua/mason-lspconfig/server_configurations/bsl_ls/init.lua5
-rw-r--r--lua/mason-lspconfig/server_configurations/elixirls/init.lua5
-rw-r--r--lua/mason-lspconfig/server_configurations/esbonio/init.lua5
-rw-r--r--lua/mason-lspconfig/server_configurations/groovyls/init.lua3
-rw-r--r--lua/mason-lspconfig/server_configurations/julials/README.md9
-rw-r--r--lua/mason-lspconfig/server_configurations/julials/init.lua50
-rw-r--r--lua/mason-lspconfig/server_configurations/kotlin_language_server/init.lua5
-rw-r--r--lua/mason-lspconfig/server_configurations/ltex/init.lua5
-rw-r--r--lua/mason-lspconfig/server_configurations/omnisharp/README.md16
-rw-r--r--lua/mason-lspconfig/server_configurations/omnisharp/init.lua5
-rw-r--r--lua/mason-lspconfig/server_configurations/perlnavigator/init.lua5
-rw-r--r--lua/mason-lspconfig/server_configurations/powershell_es/init.lua6
-rw-r--r--lua/mason-lspconfig/server_configurations/psalm/init.lua5
-rw-r--r--lua/mason-lspconfig/server_configurations/pylsp/README.md16
-rw-r--r--lua/mason-lspconfig/server_configurations/pylsp/init.lua51
-rw-r--r--lua/mason-lspconfig/server_configurations/r_language_server/init.lua5
-rw-r--r--lua/mason-lspconfig/server_configurations/rescriptls/init.lua5
-rw-r--r--lua/mason-lspconfig/server_configurations/solang/init.lua14
-rw-r--r--lua/mason-lspconfig/server_configurations/tflint/README.md14
-rw-r--r--lua/mason-lspconfig/server_configurations/visualforce_ls/init.lua5
-rw-r--r--lua/mason-lspconfig/server_configurations/volar/init.lua27
24 files changed, 0 insertions, 313 deletions
diff --git a/lua/mason-lspconfig/server_configurations/angularls/init.lua b/lua/mason-lspconfig/server_configurations/angularls/init.lua
deleted file mode 100644
index 813e5258..00000000
--- a/lua/mason-lspconfig/server_configurations/angularls/init.lua
+++ /dev/null
@@ -1,39 +0,0 @@
-local platform = require "mason-core.platform"
-local _ = require "mason-core.functional"
-local path = require "mason-core.path"
-
----@param install_dir string
-return function(install_dir)
- local append_node_modules = _.map(function(dir)
- return path.concat { dir, "node_modules" }
- end)
-
- local function get_cmd(workspace_dir)
- local cmd = {
- "ngserver",
- "--stdio",
- "--tsProbeLocations",
- table.concat(append_node_modules { install_dir, workspace_dir }, ","),
- "--ngProbeLocations",
- table.concat(
- append_node_modules {
- path.concat { install_dir, "node_modules", "@angular", "language-server" },
- workspace_dir,
- },
- ","
- ),
- }
- if platform.is_win then
- cmd[1] = vim.fn.exepath(cmd[1])
- end
-
- return cmd
- end
-
- return {
- cmd = get_cmd(vim.loop.cwd()),
- on_new_config = function(new_config, root_dir)
- new_config.cmd = get_cmd(root_dir)
- end,
- }
-end
diff --git a/lua/mason-lspconfig/server_configurations/apex_ls/init.lua b/lua/mason-lspconfig/server_configurations/apex_ls/init.lua
deleted file mode 100644
index 6251dc73..00000000
--- a/lua/mason-lspconfig/server_configurations/apex_ls/init.lua
+++ /dev/null
@@ -1,8 +0,0 @@
-local path = require "mason-core.path"
-
----@param install_dir string
-return function(install_dir)
- return {
- apex_jar_path = path.concat { install_dir, "apex-jorje-lsp.jar" },
- }
-end
diff --git a/lua/mason-lspconfig/server_configurations/bicep/init.lua b/lua/mason-lspconfig/server_configurations/bicep/init.lua
deleted file mode 100644
index ddc0a2af..00000000
--- a/lua/mason-lspconfig/server_configurations/bicep/init.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-return function()
- return {
- cmd = { "bicep-lsp" },
- }
-end
diff --git a/lua/mason-lspconfig/server_configurations/bsl_ls/init.lua b/lua/mason-lspconfig/server_configurations/bsl_ls/init.lua
deleted file mode 100644
index 62dfa5c0..00000000
--- a/lua/mason-lspconfig/server_configurations/bsl_ls/init.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-return function()
- return {
- cmd = { "bsl-language-server" },
- }
-end
diff --git a/lua/mason-lspconfig/server_configurations/elixirls/init.lua b/lua/mason-lspconfig/server_configurations/elixirls/init.lua
deleted file mode 100644
index 0c424b18..00000000
--- a/lua/mason-lspconfig/server_configurations/elixirls/init.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-return function()
- return {
- cmd = { "elixir-ls" },
- }
-end
diff --git a/lua/mason-lspconfig/server_configurations/esbonio/init.lua b/lua/mason-lspconfig/server_configurations/esbonio/init.lua
deleted file mode 100644
index e9d8d988..00000000
--- a/lua/mason-lspconfig/server_configurations/esbonio/init.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-return function()
- return {
- cmd = { "esbonio" },
- }
-end
diff --git a/lua/mason-lspconfig/server_configurations/groovyls/init.lua b/lua/mason-lspconfig/server_configurations/groovyls/init.lua
deleted file mode 100644
index 495c7592..00000000
--- a/lua/mason-lspconfig/server_configurations/groovyls/init.lua
+++ /dev/null
@@ -1,3 +0,0 @@
-return function()
- return { cmd = "groovy-language-server" }
-end
diff --git a/lua/mason-lspconfig/server_configurations/julials/README.md b/lua/mason-lspconfig/server_configurations/julials/README.md
deleted file mode 100644
index 18e6880d..00000000
--- a/lua/mason-lspconfig/server_configurations/julials/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# julials
-
-## Configuring the Julia Environment
-
-The Julia Environment will be identified in the following order:
-
-1) user configuration (`lspconfig.julials.setup { julia_env_path = "/my/env" }`)
-2) if the `Project.toml` & `Manifest.toml` (or `JuliaProject.toml` & `JuliaManifest.toml`) files exists in the current project working directory, the current project working directory is used as the environment
-3) the result of `Pkg.Types.Context().env.project_file`
diff --git a/lua/mason-lspconfig/server_configurations/julials/init.lua b/lua/mason-lspconfig/server_configurations/julials/init.lua
deleted file mode 100644
index 6166e35d..00000000
--- a/lua/mason-lspconfig/server_configurations/julials/init.lua
+++ /dev/null
@@ -1,50 +0,0 @@
-local path = require "mason-core.path"
-local platform = require "mason-core.platform"
-local fs = require "mason-core.fs"
-local _ = require "mason-core.functional"
-
----@param install_dir string
-return function(install_dir)
- return {
- on_new_config = function(config, workspace_dir)
- local env_path = config.julia_env_path and vim.fn.expand(config.julia_env_path)
- if not env_path then
- local file_exists = _.compose(fs.sync.file_exists, path.concat, _.concat { workspace_dir })
- if file_exists { "Project.toml" } and file_exists { "Manifest.toml" } then
- env_path = workspace_dir
- elseif file_exists { "JuliaProject.toml" } and file_exists { "JuliaManifest.toml" } then
- env_path = workspace_dir
- end
- end
-
- if not env_path then
- local ok, env = pcall(vim.fn.system, {
- "julia",
- "--startup-file=no",
- "--history-file=no",
- "-e",
- "using Pkg; print(dirname(Pkg.Types.Context().env.project_file))",
- })
- if ok then
- env_path = env
- end
- end
-
- config.cmd = {
- "julia",
- "--startup-file=no",
- "--history-file=no",
- "--depwarn=no",
- ("--project=%s"):format(path.concat { install_dir, "scripts", "environments", "languageserver" }),
- path.concat { install_dir, "nvim-lsp.jl" },
- vim.env.JULIA_DEPOT_PATH or "",
- path.concat { install_dir, "symbolstorev5" },
- env_path,
- }
- end,
- cmd_env = {
- JULIA_DEPOT_PATH = path.concat { install_dir, "lsdepot" },
- JULIA_LOAD_PATH = platform.is.win and ";" or ":",
- },
- }
-end
diff --git a/lua/mason-lspconfig/server_configurations/kotlin_language_server/init.lua b/lua/mason-lspconfig/server_configurations/kotlin_language_server/init.lua
deleted file mode 100644
index 585797fc..00000000
--- a/lua/mason-lspconfig/server_configurations/kotlin_language_server/init.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-return function()
- return {
- cmd = { "kotlin-language-server" },
- }
-end
diff --git a/lua/mason-lspconfig/server_configurations/ltex/init.lua b/lua/mason-lspconfig/server_configurations/ltex/init.lua
deleted file mode 100644
index f24d86f7..00000000
--- a/lua/mason-lspconfig/server_configurations/ltex/init.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-return function()
- return {
- cmd = { "ltex-ls" },
- }
-end
diff --git a/lua/mason-lspconfig/server_configurations/omnisharp/README.md b/lua/mason-lspconfig/server_configurations/omnisharp/README.md
deleted file mode 100644
index 78255785..00000000
--- a/lua/mason-lspconfig/server_configurations/omnisharp/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# omnisharp
-
-## How to enable Omnisharp Mono
-
-By default, the `omnisharp` server will use the `dotnet` (NET6) runtime to run the server.
-To run the server using the Mono runtime, set the `use_modern_net` setting to `false`, like so:
-
-__This requires the `omnisharp-mono` package to be installed.__
-
-```lua
-local lspconfig = require("lspconfig")
-
-lspconfig.omnisharp.setup {
- use_modern_net = false
-}
-```
diff --git a/lua/mason-lspconfig/server_configurations/omnisharp/init.lua b/lua/mason-lspconfig/server_configurations/omnisharp/init.lua
deleted file mode 100644
index 274ff182..00000000
--- a/lua/mason-lspconfig/server_configurations/omnisharp/init.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-return function(install_dir, config)
- return {
- cmd = { config.use_modern_net == false and "omnisharp-mono" or "omnisharp" },
- }
-end
diff --git a/lua/mason-lspconfig/server_configurations/perlnavigator/init.lua b/lua/mason-lspconfig/server_configurations/perlnavigator/init.lua
deleted file mode 100644
index c376dc77..00000000
--- a/lua/mason-lspconfig/server_configurations/perlnavigator/init.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-return function()
- return {
- cmd = { "perlnavigator", "--stdio" },
- }
-end
diff --git a/lua/mason-lspconfig/server_configurations/powershell_es/init.lua b/lua/mason-lspconfig/server_configurations/powershell_es/init.lua
deleted file mode 100644
index d36a580b..00000000
--- a/lua/mason-lspconfig/server_configurations/powershell_es/init.lua
+++ /dev/null
@@ -1,6 +0,0 @@
----@param install_dir string
-return function(install_dir)
- return {
- bundle_path = install_dir,
- }
-end
diff --git a/lua/mason-lspconfig/server_configurations/psalm/init.lua b/lua/mason-lspconfig/server_configurations/psalm/init.lua
deleted file mode 100644
index 8dd3645a..00000000
--- a/lua/mason-lspconfig/server_configurations/psalm/init.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-return function()
- return {
- cmd = { "psalm-language-server" },
- }
-end
diff --git a/lua/mason-lspconfig/server_configurations/pylsp/README.md b/lua/mason-lspconfig/server_configurations/pylsp/README.md
deleted file mode 100644
index 2434bb4b..00000000
--- a/lua/mason-lspconfig/server_configurations/pylsp/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# Pylsp
-
-## Installing pylsp plugins
-
-Pylsp has [third party plugins](https://github.com/python-lsp/python-lsp-server#3rd-party-plugins) which are not installed by default.
-
-In order for these plugins to work with the `pylsp` server managed by this plugin, they need to be installed in the same [virtual environment](https://docs.python.org/3/library/venv.html) as `pylsp`. For these reasons, there's a convenient `:PylspInstall <packages>` command that does this for you, for example:
-
-```vim
-:PylspInstall pyls-flake8 pylsp-mypy pyls-isort
-```
-
-The `:PylspInstall` command will only be available once the `pylsp` server has been set up.
-
-**Note that these extra pylsp plugins will not be reinstalled if you update/reinstall the `pylsp` server, you will have to manage
-them manually.**
diff --git a/lua/mason-lspconfig/server_configurations/pylsp/init.lua b/lua/mason-lspconfig/server_configurations/pylsp/init.lua
deleted file mode 100644
index 9626fdca..00000000
--- a/lua/mason-lspconfig/server_configurations/pylsp/init.lua
+++ /dev/null
@@ -1,51 +0,0 @@
-local a = require "mason-core.async"
-local _ = require "mason-core.functional"
-local pip3 = require "mason-core.managers.pip3"
-local process = require "mason-core.process"
-local notify = require "mason-core.notify"
-local spawn = require "mason-core.spawn"
-
----@param install_dir string
-return function(install_dir)
- vim.api.nvim_create_user_command(
- "PylspInstall",
- a.scope(function(opts)
- local plugins = opts.fargs
- local plugins_str = table.concat(plugins, ", ")
- notify(("Installing %s..."):format(plugins_str))
- local result = spawn.pip {
- "install",
- "-U",
- "--disable-pip-version-check",
- plugins,
- stdio_sink = process.simple_sink(),
- with_paths = { pip3.venv_path(install_dir) },
- }
- if vim.in_fast_event() then
- a.scheduler()
- end
- result
- :on_success(function()
- notify(("Successfully installed pylsp plugins %s"):format(plugins_str))
- end)
- :on_failure(function()
- notify("Failed to install requested pylsp plugins.", vim.log.levels.ERROR)
- end)
- end),
- {
- desc = "[mason.nvim] Installs the provided packages in the same venv as pylsp.",
- nargs = "+",
- complete = _.always {
- "pyls-flake8",
- "pylsp-mypy",
- "pyls-spyder",
- "pyls-isort",
- "python-lsp-black",
- "pyls-memestra",
- "pylsp-rope",
- },
- }
- )
-
- return {}
-end
diff --git a/lua/mason-lspconfig/server_configurations/r_language_server/init.lua b/lua/mason-lspconfig/server_configurations/r_language_server/init.lua
deleted file mode 100644
index 84b004c5..00000000
--- a/lua/mason-lspconfig/server_configurations/r_language_server/init.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-return function()
- return {
- cmd = { "r-languageserver" },
- }
-end
diff --git a/lua/mason-lspconfig/server_configurations/rescriptls/init.lua b/lua/mason-lspconfig/server_configurations/rescriptls/init.lua
deleted file mode 100644
index 2f55cc30..00000000
--- a/lua/mason-lspconfig/server_configurations/rescriptls/init.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-return function()
- return {
- cmd = { "rescript-lsp", "--stdio" },
- }
-end
diff --git a/lua/mason-lspconfig/server_configurations/solang/init.lua b/lua/mason-lspconfig/server_configurations/solang/init.lua
deleted file mode 100644
index 2d8dcf79..00000000
--- a/lua/mason-lspconfig/server_configurations/solang/init.lua
+++ /dev/null
@@ -1,14 +0,0 @@
-local path = require "mason-core.path"
-local process = require "mason-core.process"
-
----@param install_dir string
-return function(install_dir)
- return {
- cmd_env = {
- PATH = process.extend_path {
- path.concat { install_dir, "llvm13.0", "bin" },
- path.concat { install_dir, "llvm12.0", "bin" }, -- kept for backwards compatibility
- },
- },
- }
-end
diff --git a/lua/mason-lspconfig/server_configurations/tflint/README.md b/lua/mason-lspconfig/server_configurations/tflint/README.md
deleted file mode 100644
index 51298d69..00000000
--- a/lua/mason-lspconfig/server_configurations/tflint/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# tflint
-
-## Installing TFLint plugins
-
-TFLint has [third party plugins](https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md) which are not installed by default.
-
-To install TFLint plugins, there's a convenient `:TFLintInit` command that does this for you. It will use Neovim's
-current working directory to locate the plugins to install (according to `tflint --init`):
-
-```
-:TFLintInit
-```
-
-The `:TFLintInit` command will only be available once the `tflint` server has been set up.
diff --git a/lua/mason-lspconfig/server_configurations/visualforce_ls/init.lua b/lua/mason-lspconfig/server_configurations/visualforce_ls/init.lua
deleted file mode 100644
index 7d4c0ec3..00000000
--- a/lua/mason-lspconfig/server_configurations/visualforce_ls/init.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-return function()
- return {
- cmd = { "visualforce-language-server", "--stdio" },
- }
-end
diff --git a/lua/mason-lspconfig/server_configurations/volar/init.lua b/lua/mason-lspconfig/server_configurations/volar/init.lua
deleted file mode 100644
index e1d98e77..00000000
--- a/lua/mason-lspconfig/server_configurations/volar/init.lua
+++ /dev/null
@@ -1,27 +0,0 @@
-local fs = require "mason-core.fs"
-local path = require "mason-core.path"
-
----@param install_dir string
-return function(install_dir)
- ---@param dir string
- local function get_tsserverlib_path(dir)
- return path.concat { dir, "node_modules", "typescript", "lib", "tsserverlibrary.js" }
- end
-
- ---@param workspace_dir string|nil
- local function get_typescript_server_path(workspace_dir)
- local local_tsserverlib = workspace_dir ~= nil and get_tsserverlib_path(workspace_dir)
- local vendored_tsserverlib = get_tsserverlib_path(install_dir)
- if local_tsserverlib and fs.sync.file_exists(local_tsserverlib) then
- return local_tsserverlib
- else
- return vendored_tsserverlib
- end
- end
-
- return {
- on_new_config = function(new_config, new_install_dir)
- new_config.init_options.typescript.serverPath = get_typescript_server_path(new_install_dir)
- end,
- }
-end