aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-08-12 22:17:23 +0200
committerGitHub <noreply@github.com>2022-08-12 22:17:23 +0200
commit3364c6bbddfb5ffdc56a6688ce1865e23cf327d4 (patch)
tree71a6fd0f6a7e10ea14ce7a2eba11200a7abd23c5 /lua
parentdocs: clarify how setup_handlers() deals with already installed servers (#29) (diff)
downloadmason-lspconfig-3364c6bbddfb5ffdc56a6688ce1865e23cf327d4.tar
mason-lspconfig-3364c6bbddfb5ffdc56a6688ce1865e23cf327d4.tar.gz
mason-lspconfig-3364c6bbddfb5ffdc56a6688ce1865e23cf327d4.tar.bz2
mason-lspconfig-3364c6bbddfb5ffdc56a6688ce1865e23cf327d4.tar.lz
mason-lspconfig-3364c6bbddfb5ffdc56a6688ce1865e23cf327d4.tar.xz
mason-lspconfig-3364c6bbddfb5ffdc56a6688ce1865e23cf327d4.tar.zst
mason-lspconfig-3364c6bbddfb5ffdc56a6688ce1865e23cf327d4.zip
fix(omnisharp_mono): add dedicated server entry for omnisharp_mono (#32)
This is done in order to separate the .NET and Mono variants, making them both equally accessible (you have to jump through hoops to use the non-default [Mono] variant atm).
Diffstat (limited to 'lua')
-rw-r--r--lua/mason-lspconfig/init.lua8
-rw-r--r--lua/mason-lspconfig/mappings/filetype.lua4
-rw-r--r--lua/mason-lspconfig/mappings/server.lua1
-rw-r--r--lua/mason-lspconfig/server_config_extensions.lua5
-rw-r--r--lua/mason-lspconfig/server_configurations/julials/init.lua12
-rw-r--r--lua/mason-lspconfig/server_configurations/omnisharp/README.md13
-rw-r--r--lua/mason-lspconfig/server_configurations/omnisharp/init.lua4
-rw-r--r--lua/mason-lspconfig/server_configurations/omnisharp_mono/init.lua5
8 files changed, 29 insertions, 23 deletions
diff --git a/lua/mason-lspconfig/init.lua b/lua/mason-lspconfig/init.lua
index d6482b3..b57effe 100644
--- a/lua/mason-lspconfig/init.lua
+++ b/lua/mason-lspconfig/init.lua
@@ -11,7 +11,13 @@ function M.setup(config)
settings.set(config)
end
- require "mason-lspconfig.lspconfig_hook"()
+ local ok, err = pcall(function()
+ require "mason-lspconfig.lspconfig_hook"()
+ require "mason-lspconfig.server_config_extensions"()
+ end)
+ if not ok then
+ log.error("Failed to set up lspconfig integration.", err)
+ end
if #settings.current.ensure_installed > 0 then
require "mason-lspconfig.ensure_installed"()
diff --git a/lua/mason-lspconfig/mappings/filetype.lua b/lua/mason-lspconfig/mappings/filetype.lua
index 959ecb8..fe3ba6b 100644
--- a/lua/mason-lspconfig/mappings/filetype.lua
+++ b/lua/mason-lspconfig/mappings/filetype.lua
@@ -22,7 +22,7 @@ return {
cmake = { "cmake" },
cpp = { "clangd" },
crystal = { "crystalline" },
- cs = { "csharp_ls", "omnisharp" },
+ cs = { "csharp_ls", "omnisharp", "omnisharp_mono" },
css = { "cssls", "emmet_ls", "stylelint_lsp", "tailwindcss" },
cucumber = { "cucumber_language_server" },
cuda = { "clangd" },
@@ -144,7 +144,7 @@ return {
["typescript.tsx"] = { "angularls", "denols", "eslint", "rome", "tsserver" },
typescriptreact = { "angularls", "cssmodules_ls", "denols", "emmet_ls", "eslint", "graphql", "rome", "stylelint_lsp", "tailwindcss", "tsserver" },
vala = { "vala_ls" },
- vb = { "omnisharp" },
+ vb = { "omnisharp", "omnisharp_mono" },
verilog = { "svlangserver", "svls", "verible" },
vim = { "vimls" },
visualforce = { "visualforce_ls" },
diff --git a/lua/mason-lspconfig/mappings/server.lua b/lua/mason-lspconfig/mappings/server.lua
index d4cb423..518c5a9 100644
--- a/lua/mason-lspconfig/mappings/server.lua
+++ b/lua/mason-lspconfig/mappings/server.lua
@@ -68,6 +68,7 @@ M.lspconfig_to_package = {
["nimls"] = "nimlsp",
["ocamllsp"] = "ocaml-lsp",
["omnisharp"] = "omnisharp",
+ ["omnisharp_mono"] = "omnisharp-mono",
["opencl_ls"] = "opencl-language-server",
["perlnavigator"] = "perlnavigator",
["phpactor"] = "phpactor",
diff --git a/lua/mason-lspconfig/server_config_extensions.lua b/lua/mason-lspconfig/server_config_extensions.lua
new file mode 100644
index 0000000..2bdffc9
--- /dev/null
+++ b/lua/mason-lspconfig/server_config_extensions.lua
@@ -0,0 +1,5 @@
+return function()
+ local configs = require "lspconfig.configs"
+
+ configs.omnisharp_mono = require "lspconfig.server_configurations.omnisharp"
+end
diff --git a/lua/mason-lspconfig/server_configurations/julials/init.lua b/lua/mason-lspconfig/server_configurations/julials/init.lua
index 6166e35..e5bc6c4 100644
--- a/lua/mason-lspconfig/server_configurations/julials/init.lua
+++ b/lua/mason-lspconfig/server_configurations/julials/init.lua
@@ -31,20 +31,10 @@ return function(install_dir)
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" },
+ "julia-lsp",
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/omnisharp/README.md b/lua/mason-lspconfig/server_configurations/omnisharp/README.md
index 7825578..2b7e601 100644
--- a/lua/mason-lspconfig/server_configurations/omnisharp/README.md
+++ b/lua/mason-lspconfig/server_configurations/omnisharp/README.md
@@ -1,16 +1,15 @@
# omnisharp
-## How to enable Omnisharp Mono
+## How to use 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:
+The `omnisharp` server will use the `dotnet` (NET6) runtime to run the server. To run the server using the Mono runtime,
+use the `omnisharp_mono` server instead (**this requires the `omnisharp-mono` package to be installed**).
-__This requires the `omnisharp-mono` package to be installed.__
+**Note:** The `omnisharp_mono` server configuration doesn't exist in `lspconfig` but is provided by `mason-lspconfig`.
+This is done in order to separate the .NET and Mono variants, making both easily accessible.
```lua
local lspconfig = require("lspconfig")
-lspconfig.omnisharp.setup {
- use_modern_net = false
-}
+lspconfig.omnisharp_mono.setup {}
```
diff --git a/lua/mason-lspconfig/server_configurations/omnisharp/init.lua b/lua/mason-lspconfig/server_configurations/omnisharp/init.lua
index 274ff18..466bdfc 100644
--- a/lua/mason-lspconfig/server_configurations/omnisharp/init.lua
+++ b/lua/mason-lspconfig/server_configurations/omnisharp/init.lua
@@ -1,5 +1,5 @@
-return function(install_dir, config)
+return function()
return {
- cmd = { config.use_modern_net == false and "omnisharp-mono" or "omnisharp" },
+ cmd = { "omnisharp" },
}
end
diff --git a/lua/mason-lspconfig/server_configurations/omnisharp_mono/init.lua b/lua/mason-lspconfig/server_configurations/omnisharp_mono/init.lua
new file mode 100644
index 0000000..9512146
--- /dev/null
+++ b/lua/mason-lspconfig/server_configurations/omnisharp_mono/init.lua
@@ -0,0 +1,5 @@
+return function()
+ return {
+ cmd = { "omnisharp-mono" },
+ }
+end