-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LSP features not working in second dotnet solution with OmniSharp #2392
Comments
to be honest I don't find the |
Sorry, wrong log file. I've updated the gist as well as NeoVim/lspconfig revisions in bug description (just updated everything to the latest |
I believe I figured out part of the problem. The on_new_config function for omnisharp inserts the extra configurations to the cmd table. The issue with this is that it doesn't seem like the cmd table is ever cleared or recreated. This is what causing the repeating config options at the end of the command. This section gets repeated many times. I've noticed on Windows this happens as soon as I open one solution I created a temporary solution that works for my use case here. I'm just setting the new_config.cmd to a completely new table and setting the omnisharp dll elsewhere. Someone would have to come up with a proper solution. I'm open to helping out when I can |
@glepnir, were you able to reproduce this? Can I help here somehow? |
sry a little busy recently . I don't write dotnet. so need some time to install env and try to reproduce it. |
@waynebowie99 You've certainly identified the problem! I've spent countless hours and have come across multiple Issues (the GitHub kind) in other repos that have been opened—and subsequently closed—that were ultimately the fault of this bug. Shoot, I've spend dozens of hours just trying to learn Lua in hopes of troubleshooting this. I think this is what's preventing me from using Does anybody more experienced than me have some time to work on this? |
@glepnir As I'm looking over the code @waynebowie99 shared back on Feb 2, it seems he's on the right track by resetting Second, is it even correct for us to be trying to set |
This issue #2018 was the one that caused this breaking change. Maybe @williamboman has some insight on this and how to fix the problem Thanks @JustALawnGnome7 for continuing this work on this! |
I've submitted a PR that updates the logic behind It should be noted, however, that this still doesn't cause OmniSharp to work with multiple projects at the same time. |
Whoops, looks like I botched the commit messages and created quite a mess. I've re-submitted the change under a new PR. (#2692) |
So this required some extensive debugging. There seems to be two problems here:
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if client.name == "omnisharp" then
client.server_capabilities.semanticTokensProvider = nil
client.server_capabilities.workspace.workspaceFolders.supported = false
end
end,
})
-- (the better way would probably be to try to configure this via client capabilities, but I haven't given that a try yet) The above could potentially also be somehow included directly in nvim-lspconfig for a better out-of-the-box experience. |
Description
I'm not sure if it's lspconfig-related or omnisharp-related, so posting it here to start with.
Neovim version
NVIM v0.9.0-dev-774+g151b9fc52-dirty
Build type: Release
LuaJIT 2.1.0-beta3
Nvim-lspconfig version
85cd2ec
Operating system and version
macOs 13.1
Affected language servers
omnisharp
Steps to reproduce
Step 1: open file from solution 1
LspInfo:
Step 2: check whether things like goto definition work within solution 1
Step 3: open file from solution 2
LspInfo:
Step 4: check whether things like goto definition work within solution 2
Step 5: issue
ps -A
to verify how many instances ofomnisharp
are started and with which parametersActual behavior
Goto definition from step 2 work within solution 1.
Goto definition from step 4 do not work within solution 2.
LspInfo in step 4 show suspicious
cmd
value that expands even further as I open subsequent buffers.cmd
value in step 4 does not match the output fromps -A
in step 5Expected behavior
Goto definition from step 2 work within solution 1.
Goto definition from step 4 work within solution 2.
LspInfo in step 4 shows adequate
cmd
value that matches the output ofps -A
.Minimal config
LSP log
https://gist.github.com/starteleport/055fedceaea9e2ef22dd2ff9e6be43d9
The text was updated successfully, but these errors were encountered: