Open source LSP with dependency injection aware implementation finding?
I got OmniSharp working in Neovim but it doesn't find implementations for services that are DId into controllers. Has anyone got this working?
21 Replies
Well, the text editor/IDE you're using has nothing to do with the code working or not
So not an O# issue
i assume the question is about Go To Implementation
^
Ah, well, that makes sense
yeah actually mssing with that now
you will have to change
roslyn_version
to something else
the latest version seems to be 4.11.0-3.24307.2
heyy this one worked
thanks
I just installed the roslyn based ls directly without that plugin
I had actually tried this one first, but it required dotnet sdk 8 so I gave up on it since my project is 7
but installing sdk 8 alongside and using it for lsp seems to work fine
Just FYI, updating from 7 to 8 is one change in the
.csproj
Also, 7 is already EOLindeed, .NET 7 is no longer supported
and you can use the .NET 8 SDK to build .NET 7/6/etc. projects anyway, typically
but I looked at the docs and it had some list of changes, I assumed those were breaking
Well, yes, it's a new version, there will be changes
Are they changes to the code you have written?
Are they breaking?
That's up to you to determine
Chances are, your project will just work on 8, though. Whatever breaking changes there are, tend to be minimal
Nah this one is out of date and abandonware, Omnisharp has been improved a lot in the past couple months
no
the roslyn LSP is not abandonware
and you should not use O#
no the nvim plugin
the nvim plugin is just a wrapper over the roslyn LSP
it doesn't do anything
it does indeed
you'll notice if you take a look I also personally have some tickets open on it, and I even have a fork of it 🙂
and even then I went back to omnisharp plugin instead
Roslyn has several LSP capabilities that are "non core" for
lsp-config
for neovim, which requires additional work done by a plugin to support them
theres a good 10? 12? features roslyn has that are "extra"
beyond what the community has as default supported in lsp-config
So as a result... I currently recommend this combo which I find has both the maximum amount of supported features while also not having terrible performance:
1. lsp-config
utilizing the omnisharp
config from their wiki: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#omnisharp
2. On top of that, you also want omnisharp-extended-lsp
that I just recently bumped into a couple days ago and it adds 2 extra features of support. Decompiled file browsing and Roslyn Source Generated file browsing, both are pretty awesome to have back in the toolbelt 🙂 https://github.com/Hoffs/omnisharp-extended-lsp.nvim
And for keybinding which version to use for go to imp
/ go to def
and find usages
, I have this snippet you can feel free to use:
Snippets: https://github.com/SteffenBlake/pixxel-nvim/blob/main/lua/keybinds/default.lua#L34-L59
Binding them: https://github.com/SteffenBlake/pixxel-nvim/blob/main/lua/keybinds/default.lua#L89-L91
Or if you wish, you also can 100% feel free to completely yoink my entire nvim config if you wish, it's got nearly a year now of work putting into min-maxing it for specifically dotnet development :3
including a full guide in the README on everything you need to install and setup to get it workinganything that involves O# is the wrong solution
it is a dead project for any practical purpose
Nah Ive used all the options extensively, Omnisharp is the clear winner atm
well then you are bad at evaluating options
by like a large margin
the one you linked is lacking almost all the features roslyn actually supports
its abandonware
it also broke recently on the latest version of neovim
What you gotta understand is theres a dump truck of work building the adapter between Neovim LspConfig <-> Lsp Server to handle any "extra" features it supports, and a fair chunk of what we expect roslyn to do is in that category
nvim-roslyn
was starting to try and do that, and then just like... stopped shortly after and its been radio silence since then
a couple people have forked it and tried to take up continuing it, I tried out their forks, most of them didnt even run out of the box