csharp-language-server icon indicating copy to clipboard operation
csharp-language-server copied to clipboard

Support for Razor pages

Open mphe opened this issue 11 months ago • 7 comments

Is support for Razor pages planned? I'm currently working on an ASP.NET Core Razor project and having LSP support in cshtml files would be awesome.

mphe avatar Feb 28 '24 16:02 mphe

I was working on a prototype at one point but left it abandoned due to lack of time :(

My initial dabblings at parser+lexer for razor: https://github.com/razzmatazz/fazor

razzmatazz avatar Mar 04 '24 06:03 razzmatazz

Not sure if that is the right approach. Ideally it should integrate with microsoft asp.net razor libs/parsers to not maintain our own.

razzmatazz avatar Mar 04 '24 06:03 razzmatazz

I have found https://github.com/dotnet/razor, which supposedly implements a LS "rzls", but apparently noone is using it. According to this comment, the integration of rzls seems to be non-trivial. Also just found this post related to the LS included with the vscode C# plugin.

mphe avatar Mar 04 '24 08:03 mphe

i found the rzls thing a while back as well and tried to build and then use it but failed even building it i might try building it again, setting up a script, then try to reverse enegineer how vscode uses it most probably not cuz im no expert and dont have that much time but ill post here and on that omnisharp-vim thread if i find anything

haras-unicorn avatar Mar 13 '24 17:03 haras-unicorn

ok so getting rzls to build and work wasnt so hard now but it seems it has a ton of custom LSP messages and that language server wont work with a general LSP client implementation

haras-unicorn avatar Mar 13 '24 18:03 haras-unicorn

☝🏻 that was exactly the result of my investigation of rzls, --you would need to implement additional behaviour and preserve a lot of state on the client to integrate it

razzmatazz avatar May 01 '24 06:05 razzmatazz

I am working on a plugin to hopefully work towards support for this is anyone is looking to collaborate

https://github.com/tris203/rzls.nvim

tris203 avatar Jun 03 '24 19:06 tris203