-
Notifications
You must be signed in to change notification settings - Fork 419
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
textDocument/definition URI is incompatible with (...)ExternalSourceService cache #2238
Comments
Hi, not sure if this is helpful, but I'm also trying to get metadata working in a non-VSCode LSP client, and for your example, I think |
Is there a way to at least disable this |
is it reasonable to say that omnisharp-roslyn lsp should not return any URI that contains I’m using vim-lsp and also bump into this. |
And, for good measure here's my +1 to this issue. In the Eglot client, I get a nonsensical URL like |
+1 |
Just would like to say, I started a new job in a dotnet shop, and would love to be able to have this support with my neovim editor |
+1. This is also problematic on Helix editor. helix-editor/helix#2430 Helix also dumped out a lot of |
Hey, guys, do we have any updates? |
I have just installed and configured https://github.com/Hoffs/omnisharp-extended-lsp.nvim and it seems to be working well for me. I have only used it for around 30 minutes so far, but so far, so good... Edit: I did find that if I bind straight to this, my goto definition stops working for other file types. I've added an ftplugin specific binding just for cs files. As per https://github.com/KiLLeRRaT/.dotfiles/blob/65839bcdb41558d543395c0efa329f2fab6cc644/nvim-lua/.config/nvim/after/ftplugin/cs.lua#L9C1-L9C96 |
Yes, it works, but if you try to |
+1 on this using https://github.com/Hoffs/omnisharp-extended-lsp.nvim |
See my edit on my first post about this and the ftplugin binding. |
Hi,
I've been working on extending LSP client to pull metadata/file source when
textDocument/definition
returns result with$metadata$
URI (e.g.uri = "file:///%24metadata%24/Project/nvim-csharp-metadata/Assembly/System/Console/Symbol/System/Console.cs"
).The problem I encountered that it seems to be impossible to get subsequent results using
textDocument/definition
when being run from$metadata$
file. For example, first definition request is done from normal file and gets:Then that file can be fetched with custom call to
o#/metadata
, but then once in that temporary/pseudo file buffer, named$metadata$/Project/nvim-csharp-metadata/Assembly/System/Console/Symbol/System/Console.cs
anytextDocument/definition
request is incompatible to properly resolve to cached document.I believe the issue lies at
FromUri
call at:omnisharp-roslyn/src/OmniSharp.LanguageServerProtocol/Handlers/OmniSharpDefinitionHandler.cs
Lines 35 to 40 in 657b064
As this
Uri->FileName
gets translated to incompatible string forFindDocumentInCache
.omnisharp-roslyn/src/OmniSharp.Roslyn.CSharp/Services/Navigation/GotoDefinitionServiceV2.cs
Lines 33 to 34 in 657b064
omnisharp-roslyn/src/OmniSharp.Roslyn/BaseExternalSourceService.cs
Lines 17 to 25 in 657b064
file://$metadata$/Project/nvim-csharp-metadata/Assembly/System/Console/Symbol/System/Console.cs
\\\\$metadata$\\Project\\nvim-csharp-metadata\\Assembly\\System\\Console\\Symbol\\System\\Console.cs
file:///$metadata$/Project/nvim-csharp-metadata/Assembly/System/Console/Symbol/System/Console.cs
/$metadata$/Project/nvim-csharp-metadata/Assembly/System/Console/Symbol/System/Console.cs
The desired cache key is
$metadata$/Project/nvim-csharp-metadata/Assembly/System/Console/Symbol/System/Console.cs
which I believe is impossible to get when going throughFromUri
.So while the metadata functionality is a bit outside the standard LSP spec, since it already returns and saves the
$metadata$
documents in cache (without even callingo#/metadata
), I believe it would be nice if it would properly work iftextDocument/definition
requests come from$metadata$
file.If thats fine, this could either be done by not using
FromUri
or having special case for when URI is for$metadata$
file. IMO 2nd row in the table, where$metadata$
is supposedly under root (/$metadata$/...
) should be the happy scenario when providing URI for$metadata$
documents, so then in the handler it could just have a check forStartsWith('/$metadata$/'...
or something.The text was updated successfully, but these errors were encountered: