What may be causing custom server config to NOT be utilized? (Omnisharp on Linux) #232
Unanswered
Blake-LeBlanc
asked this question in
Q&A
Replies: 1 comment 7 replies
-
Hello! So the duality of Omnisharp's different runtimes (Mono vs .NET) is a bit messy. By default, the .NET variant will be used if you request If you want to use the Mono variant, I'd recommend doing the following:
local servers = {
"bashls",
"sumneko_lua",
"tsserver",
}
mason_lspconfig.setup({
ensure_installed = servers,
})
for _, server in pairs(servers) do
local opts = {
on_attach = require("user.lsp.handlers").on_attach,
capabilities = require("user.lsp.handlers").capabilities,
}
local has_custom_opts, server_custom_opts = pcall(require, "user.lsp.settings." .. server)
if has_custom_opts then
opts = vim.tbl_deep_extend("force", opts, server_custom_opts)
end
lspconfig[server].setup(opts)
end
lspconfig.omnisharp.setup {
use_modern_net = false
} I also noticed you're calling: mason_lspconfig.setup({
lspconfig[server].setup(opts)
}) It's a bit of a weird expression that I'm not gonna describe in detail - but, remove it :D |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
(This question may relate more to
mason-lspconfig.nvim
, the issue form on that repo directed me here)I've noticed that regardless of what I include in the custom
omnisharp.lua
file, the configuration outlined in:LspInfo
seems to indicate the defaultcmd
that is cobbled together innvim-lspconfig
.I suspect there's something I'm not doing right in setting up
mason.nvim
andmason-lspconfig.nvim
since thecmd
output updates when I usewilliamboman/nvim-lsp-installer
.That said, I haven't been able to get omnisharp to work in either case. This is on Linux (Ubuntu 20.04.4), trying to get it up and running for Unity C# Mono scripts.
Any ideas where I might be going wrong?
As you can see in the code below in the
configs.lua
file, I've tried making using the omnisharp-roslyn that comes with:MasonInstall
as well as a direct reference to the mono complete package I installed separately per the instructions at https://www.mono-project.com/download/stable/ .I wouldn't be surprised if I need to somehow integrate Mason's
omnisharp-mono
server rather thanomnisharp
, but whenever I try that route, it rightly complains thatnvim-lspconfig
does not have a corresponding "match" to refer to.Thanks in advance for any help!
/home/linux/dotfiles/neovim/.config/nvim/lua/user/lsp/configs.lua
plugins
Treemap of directory structure, just to help give some context
And just ignore those extra
omnisharp_MASON.lua
, etc files, those are just where I'm backing up my various trial-and-error attemptslsp/settings/omnisharp.lua
:LspInfo
That
cmd
output seems to come from how thecmd
is built in the following.../nvim-lspconfig/lua/lspconfig/server_configurations/omnisharp.lua
Beta Was this translation helpful? Give feedback.
All reactions