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

Omnisharp + Razor Source generator = sad face #30750

Closed
pranavkm opened this issue Mar 8, 2021 · 5 comments
Closed

Omnisharp + Razor Source generator = sad face #30750

pranavkm opened this issue Mar 8, 2021 · 5 comments
Labels
area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI bug This issue describes a behavior which is not expected - a bug. External This is an issue in a component not contained in this repository. It is open for tracking purposes. feature-source-generators
Milestone

Comments

@pranavkm
Copy link
Contributor

pranavkm commented Mar 8, 2021

Noticed this as part of my dotnet-watch work. This was reproduced on a Windows machine, I'm not sure what the behavior is like on xplat. With With O# sharp enabled, the generated editorconfig has lower cased paths. For e.g.

[d:/temp/watch-apps/blazorserver1/Pages/FetchData.razor]
build_metadata.AdditionalFiles.TargetPath = Pages\FetchData.razor

If I disable it and rebuild, the editorconfig uses the casing from the path as-is:

[D:/temp/watch-apps/blazorserver1/App.razor]
build_metadata.AdditionalFiles.TargetPath = App.razor

Notice the difference in casing - D:/ vs d:/

In dotnet-watch, I'm hosting Roslyn in-proc. I use an MSBuildWorkspace, which uses the path with the same casing as $PWD i.e. in my case D:\. When the in-proc compiler runs Razor source generator, it fails unable to find the metadata that it expects to be present because AnalyzerOptions lookups are case sensitive.

In fact, if I open up the generated editor config file in VSCode and build, I can see it flash (I guess first when msbuild updates it and then immediately when O# does it's thing). Occasionally building the app will fail since there's a race between MSBuild generating an editorconfig and O#.

@pranavkm pranavkm added the area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI label Mar 8, 2021
@pranavkm pranavkm changed the title Omnisharp + Razor Source generator + dotnet-watch = sad face Omnisharp + Razor Source generator = sad face Mar 8, 2021
@pranavkm
Copy link
Contributor Author

pranavkm commented Mar 8, 2021

FYI @captainsafia

@captainsafia
Copy link
Member

Follow-up: it looks like this only repros on Windows and pertains specifically to the casing used in the drive letter.

The same issue doesn't repro on macOS.

@mkArtakMSFT mkArtakMSFT added the bug This issue describes a behavior which is not expected - a bug. label Mar 9, 2021
@mkArtakMSFT mkArtakMSFT added this to the Next sprint planning milestone Mar 9, 2021
@ghost
Copy link

ghost commented Mar 9, 2021

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@captainsafia
Copy link
Member

Marking this as external. Part of this is also being tracked in dotnet/roslyn#51768 in addition to the issue referenced above.

@captainsafia captainsafia added the External This is an issue in a component not contained in this repository. It is open for tracking purposes. label Mar 18, 2021
pranavkm added a commit to dotnet/sdk that referenced this issue Mar 19, 2021
pranavkm added a commit to dotnet/sdk that referenced this issue Mar 19, 2021
pranavkm added a commit to dotnet/sdk that referenced this issue Mar 19, 2021
pranavkm added a commit to dotnet/sdk that referenced this issue Mar 19, 2021
pranavkm added a commit to dotnet/sdk that referenced this issue Mar 19, 2021
pranavkm added a commit to dotnet/sdk that referenced this issue Mar 20, 2021
@mkArtakMSFT
Copy link
Member

Closing this as we don't have control over this. We're following up with the OmniSharp team internally to get to some resolution on this from them.

pranavkm added a commit to dotnet/sdk that referenced this issue Oct 6, 2021
As part of addressing dotnet/aspnetcore#30750, we had added
a workaround to the RazorSDK to ensure building inside O# worked. This issue is being
resolved as part of the upcoming O# v1.37.16. In the meanwhile, the workaround affects
sourcelink for razor files.

Fixes dotnet/aspnetcore#37182
pranavkm added a commit to dotnet/sdk that referenced this issue Oct 7, 2021
As part of addressing dotnet/aspnetcore#30750, we had added
a workaround to the RazorSDK to ensure building inside O# worked. This issue is being
resolved as part of the upcoming O# v1.37.16. In the meanwhile, the workaround affects
sourcelink for razor files.

Fixes dotnet/aspnetcore#37182
filipnavara pushed a commit to filipnavara/dotnet-hotrewatch that referenced this issue Oct 23, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI bug This issue describes a behavior which is not expected - a bug. External This is an issue in a component not contained in this repository. It is open for tracking purposes. feature-source-generators
Projects
None yet
Development

No branches or pull requests

3 participants