Skip to content

languages/csharp: add razor support#1498

Open
CaueAnjos wants to merge 1 commit intoNotAShelf:mainfrom
CaueAnjos:feat/razor-support
Open

languages/csharp: add razor support#1498
CaueAnjos wants to merge 1 commit intoNotAShelf:mainfrom
CaueAnjos:feat/razor-support

Conversation

@CaueAnjos
Copy link
Copy Markdown

Adds razor support for roslyn and csharp_ls servers

Sanity Checking

  • I have updated the changelog as per my changes
  • I have tested, and self-reviewed my code
  • My changes fit guidelines found in hacking nvf
  • Style and consistency
    • I ran Alejandra to format my code (nix fmt)
    • My code conforms to the editorconfig configuration of the project
    • My changes are consistent with the rest of the codebase
  • If new changes are particularly complex:
    • My code includes comments in particularly complex areas
    • I have added a section in the manual
    • (For breaking changes) I have included a migration guide
  • Package(s) built:
    • .#nix (default package)
    • .#maximal
    • .#docs-html (manual, must build)
    • .#docs-linkcheck (optional, please build if adding links)
  • Tested on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin

@CaueAnjos
Copy link
Copy Markdown
Author

CaueAnjos commented Apr 5, 2026

This pull request is the same as #1271, but with updated code. The branch feat/roslyn-ls was deleted by GitHub Actions, so I had to recreate the changes on a new branch and open a new pull request.

Sorry for the inconvenience.

@CaueAnjos CaueAnjos mentioned this pull request Apr 5, 2026
17 tasks
github-actions bot pushed a commit that referenced this pull request Apr 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

🚀 Live preview deployed from ba1fcf1

View it here:

Debug Information

Triggered by: CaueAnjos

HEAD at: feat/razor-support

Reruns: 2480

# functionality, this will be the default.
defaultServers = ["csharp_ls"];
# NOTE: roslyn is the most feature-rich option, and its Razor integration is better than csharp-ls (which only supports .cshtml).
defaultServers = ["roslyn_ls"];
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason for changing the default server anymore? since roslyn_ls alone also doesn't support razor right?

github-actions bot pushed a commit that referenced this pull request Apr 7, 2026
@CaueAnjos CaueAnjos force-pushed the feat/razor-support branch from 00ccf7a to 0222767 Compare April 8, 2026 13:58
github-actions bot pushed a commit that referenced this pull request Apr 8, 2026
Copy link
Copy Markdown
Collaborator

@horriblename horriblename left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last change, I promise :)

thanks for the work so far

Comment on lines +306 to +311
event = [
{
event = "BufEnter";
pattern = ["*.cs" "*.razor"];
}
];
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should be lazy loaded, as upstream don't seem to recommend it themselves, and the plugin doesn't seem to do a whole lot at startup anyways

if you still think it's necessary, ft = ["c_sharp" "razor" "cshtml"] should be used I believe (spelling for c_sharp may be wrong idk)

@CaueAnjos CaueAnjos force-pushed the feat/razor-support branch from 0222767 to e0ff93e Compare April 8, 2026 17:30
github-actions bot pushed a commit that referenced this pull request Apr 8, 2026
@CaueAnjos CaueAnjos force-pushed the feat/razor-support branch from e0ff93e to cbcd82a Compare April 9, 2026 14:17
github-actions bot pushed a commit that referenced this pull request Apr 9, 2026
@CaueAnjos CaueAnjos force-pushed the feat/razor-support branch from cbcd82a to 8b7f710 Compare April 9, 2026 14:39
Adds razor support for `roslyn` and `csharp_ls` servers
@CaueAnjos CaueAnjos force-pushed the feat/razor-support branch from 8b7f710 to 9f8a0fd Compare April 9, 2026 14:42
github-actions bot pushed a commit that referenced this pull request Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants