jmederosalvarado / roslyn.nvim

Roslyn LSP plugin for neovim
MIT License
192 stars 33 forks source link

Question: implementation / planned support for Blazor & Razor Pages #20

Open gpfaucher opened 6 months ago

gpfaucher commented 6 months ago

Hi! Thanks for the awesome plugin. Really impressed with the speed of the LSP. I'm trying to migrate my workflow to NeoVim from the classic IDE's. Old Vim user, but had to switch to IDE's to get started at a new job. I've got everything working, except for Blazor support. I found a whole bunch of issues and threads saying how horrible the LSP's for C# are, and I've had similar issues even in VSCode. Now to my question: do you have any idea if it's even possible to implement support for Blazor & Razor Pages? If so, I'd love to get an idea of how you would go about it. I'd be more than happy to make a PR with the implementation, but I've got no idea where to even begin of starting right now. Thanks in advance!

For reference:

jmederosalvarado commented 5 months ago

I would have to look into it, I'm not sure how razor support works in the vscode extension but I believe it's a separate language server managed within the same extension. To be honest at the moment it's very unlikely I would prioritize razor support if it requires adding a separate language server. Although I'd be happy to accept a PR for it.

tris203 commented 5 months ago

I've got the Razor LSP working within neovim, but only parsing the Razor parts, not the C# parts.

I think this is where it would interface with roslyn to hand over the virtual document, but I can't get roslyn to stay up. I am just running the LSPs raw, so later on tonight I will fork this repo and see if I can get it to run nicer using the wrapper

But, I think it's possible, and famous last words, it doesn't seem that hard...

WillEhrendreich commented 4 months ago

hey @tris203 I'm really interested in how you did it. would you point me to where you have this working?

tris203 commented 4 months ago

hey @tris203 I'm really interested in how you did it. would you point me to where you have this working?

hey @WillEhrendreich it's really hacky at the moment.

Essentially, I've got as far as running the razor lsp, attaching it to the buffer, and generating the virtual html and virtual cs files in neovim (it uses a lot of custom LSP events)

Although, I need to go diving through the VsCode extension code more to work out what we do next. Which LSPs we attach to what and how do we amalgamate the results back to show in the source file

tris203 commented 1 month ago

This is how far I got with the implementation, I have made it public and am willing to work on it again if anybody wants to collaborate

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