Skip to content
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

Razor/cshtml syntax support #17

Open
jariz opened this issue Jul 9, 2024 · 16 comments
Open

Razor/cshtml syntax support #17

jariz opened this issue Jul 9, 2024 · 16 comments

Comments

@jariz
Copy link

jariz commented Jul 9, 2024

Support for razor files.

Going to try to get the ball rolling on this fork. See previous discussion..
As stated over there, roslyn should theoretically already support this.

@seblj
Copy link
Owner

seblj commented Jul 9, 2024

Personally, I am not interested in implementing this. I would however of course accept a PR for this :)

@kericsson-dotnet
Copy link

https://github.com/tris203/rzls.nvim/ may be of interest. Still in very early state ( see tris203/rzls.nvim#2 ) but I managed to get it to attach and provide some code actions.

@Crashdummyy
Copy link

https://github.com/tris203/rzls.nvim/ may be of interest. Still in very early state ( see tris203/rzls.nvim#2 ) but I managed to get it to attach and provide some code actions.

Looks kinda abandoned.
Nothing happened there in month and the discord is dead.

I just discovered this tho.
I'll check it out sometime next week and see if it's usable.
https://github.com/rpollard00/cutlass.nvim

@ramfattah
Copy link

hi @Crashdummyy,

did you have a chance to try cutlass.nvim to see if it works?

@Crashdummyy
Copy link

hi @Crashdummyy,

did you have a chance to try cutlass.nvim to see if it works?

sometime next week ( I am still on vacation and didn't bring my laptop with me )

@Crashdummyy
Copy link

hi @Crashdummyy,

did you have a chance to try cutlass.nvim to see if it works?

Okay I either configured it somewhat wrong or its not really usable at this point.

image

@ramfattah
Copy link

@Crashdummyy, it doesnt seem to be working from my end as well.

Running :LspInfo in neovim does not show any LSP clients inside a .Razor file. :(

@Crashdummyy
Copy link

Crashdummyy commented Sep 23, 2024

@Crashdummyy, it doesnt seem to be working from my end as well.

Running :LspInfo in neovim does not show any LSP clients inside a .Razor file. :(

You have to alter the hardcoded paths and compile the razor lsp to that location.
It takes a long time to start for me too tho

@ChuufMaster
Copy link

@Crashdummyy I've found a problem in your fork cutlass in that it uses vim.lsp.start_client instead of vim.lsp.start this causes a new client to be started regardless if there is a client that already exists

@Crashdummyy
Copy link

@Crashdummyy I've found a problem in your fork cutlass in that it uses vim.lsp.start_client instead of vim.lsp.start this causes a new client to be started regardless if there is a client that already exists

Yeah the fork is borked I need to remove it.
I already fixed some other things as well but theres currently not enough implemented-
At this moment this plugin can't be used as a daily driver :/

@ChuufMaster
Copy link

@Crashdummyy I've found a problem in your fork cutlass in that it uses vim.lsp.start_client instead of vim.lsp.start this causes a new client to be started regardless if there is a client that already exists

Yeah the fork is borked I need to remove it.

I already fixed some other things as well but theres currently not enough implemented-

At this moment this plugin can't be used as a daily driver :/

Yea I realized after a while that it just behaves unusually due to it using some weird stuff with virtual buffers and it also attaching multiple lsps to the same buffer. I did have a look at the c# dev kit extension for vscode to see if it's not possible to reverse engineer how the lsp works there or something along those lines

@neubaner
Copy link

I started working on my fork of https://github.com/tris203/rzls.nvim. I was able to make the Razor LSP communicate with the Roslyn LSP and got hover working properly 😄.

asciicast

I'm trying to tackle completions now but it's been a challenge...

@ramfattah
Copy link

ramfattah commented Oct 30, 2024

@neubaner whoa!!! nicely done!!!! I'll check it out to see if I can get it to work as well.

Right now without razor lsp, in my neovim i just set up my .razor markup file along with it's related code-behind .razor.cs file.

Example:

<some-component>.razor     <--- no lsp yet :(
<some-component>.razor.cs  <--- lsp works for the C# code-behind file of the component

The C# lsp works in the code-behind .razor.cs file. The last piece of the puzzle of perfect dotnet development neovim config is setting up razor lsp. Hopefully having a razor lsp work soon would greatly imporove the dotnet development experience in neovim.

btw, @neubaner you can use https://github.com/jlcrochet/vim-razor for razor syntax highlighting.
razor

@jdrupal-dev
Copy link

jdrupal-dev commented Nov 1, 2024

@neubaner How have you configured roslyn.nvim and rzls.nvim to get that to work?
More specifically, how do you get Roslyn initialized without first opening a C# file?

@neubaner
Copy link

neubaner commented Nov 1, 2024

@jdrupal-dev Take a look at the README of https://github.com/tris203/rzls.nvim. @tris203 have a PR open to address this 😄.

@jdrupal-dev
Copy link

Thank you, I provided some details here: tris203/rzls.nvim#3 (comment)
Maybe you can figure out why it's not working (I am using the latest version of both plugins)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants