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

C# LSP can't provide diagnostics for Razor files in .NET 6 Preview4+ #52980

Closed
NTaylorMullen opened this issue Apr 27, 2021 · 2 comments
Closed

Comments

@NTaylorMullen
Copy link
Contributor

Version Used: VSMain

Steps to Reproduce:

  1. Download latest .NET 6 Preview4 SDK
  2. Use VSMain latest
  3. Create a new Blazor Server App .NET 6
  4. Open FetchData.razor
  5. Make a C# error and wait (none will appear):

Expected Behavior:
You get an error, and one that can be resolved after fixing it.

Actual Behavior:
image

And any new errors/attempts to fix errors get ignored.

Notes

@jasonmalinowski @CyrusNajmabadi and I investigated the issue and here's what we found:

  1. C# LSP creates request handlers which operate on various flavors of the C# solution. For EnC there was recently a change to migrate diagnostic understanding to the source generated enabled solution. These changes weren't reflected on the LSP front when creating RequestContext's / handlers.
  2. SourceGenerators generate content in relative file paths whereas LSP speaks absolute FilePaths. Meaning, even if the above was fixed looking up an LSP Uri/filepath wouldn't actually locate a SourceGenerated file due to the path mismatch.
  3. (This is longer leaded) We can fix the first two issues via code changes in Roslyn but the third is a fundamental design issue related to the Razor compilers dual generated output modes.

Investigatory Razor issue: https://github.com/dotnet/aspnetcore/issues/32188

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Analyzers untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 27, 2021
@tmat
Copy link
Member

tmat commented Apr 27, 2021

Re [2]: suggestions that would address this were made in #51998. A suggestion in a comment on this issue would also imo result in more consistent compiler/msbuild interface regarding the directory to place generated files under

@jinujoseph jinujoseph added Investigation Required Bug Urgency-Soon and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 28, 2021
@jinujoseph jinujoseph added this to the 16.10.P3 milestone Apr 28, 2021
@NTaylorMullen
Copy link
Contributor Author

Fixed by #53027

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

No branches or pull requests

3 participants