dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.86k stars 673 forks source link

Omnisharp is not showing codelens in razor file #5749

Closed mikadumont closed 1 year ago

mikadumont commented 1 year ago

C# Extension Version: 190 image

arunchndr commented 1 year ago

@dibarbet This seems true of the C# extension as well for me (without the omnisharp option enabled)

image

dibarbet commented 1 year ago

Ah - I'm guessing Razor needs to add an LSP delegation handler to call the new Roslyn codelens endpoint? cc @davidwengier ?

arunchndr commented 1 year ago

Ok looking back at the codelens being green in @phil-allen-msft's status report, it looks like it was covering the C# codelens. So this may just not have been tested before?

davidwengier commented 1 year ago

new Roslyn codelens endpoint?

New?

Our code lens support is entirely in TypeScript, and we just call the VS Code command on the generated C# buffer: https://github.com/dotnet/vscode-csharp/blob/main/src/razor/src/CodeLens/RazorCodeLensProvider.ts#L67-L69 We don't have codelens support in our LSP server at the moment at all.

So this may just not have been tested before?

CodeLens on C# in Razor files definitely used to work. It's working in your screenshot even.

arunchndr commented 1 year ago

Argh, it snuck in between me seeing it realtime and the Ctrl+Shift+S. Just a delay in the C# 2.0, but it does show!

With the omnisharp option enabled, I also see below when I close and reopen the razor file: [Error - 4:48:39 PM] Request textDocument/foldingRange failed. Message: Error writing JSON RPC Message: ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'index') Code: -32003 [object Object]

dibarbet commented 1 year ago

Closing this as it appears to be working.