-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Fix razor redirect #78448
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
Fix razor redirect #78448
Conversation
src/Tools/ExternalAccess/Razor/Features/RazorAnalyzerAssemblyResolver.cs
Show resolved
Hide resolved
...Server/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/HostDiagnosticAnalyzerProvider.cs
Outdated
Show resolved
Hide resolved
@@ -17,7 +18,16 @@ internal sealed class HostDiagnosticAnalyzerProvider(string? razorSourceGenerato | |||
{ | |||
if (File.Exists(razorSourceGenerator)) | |||
{ | |||
return [(razorSourceGenerator, ProjectSystemProject.RazorVsixExtensionId)]; | |||
// we also have to redirect the utilities and object pool assemblies | |||
var razorDir = Path.GetDirectoryName(razorSourceGenerator) ?? ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the CWD for the OOP process? Cause I believe the code below will end up using CWD to resolve the relative paths. Is that going to work or fail due to missing files, etc ... Cause if it's going to fail would prefer we just throw an exception with a good message here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made it an exception if we can't find the dependencies
src/Tools/ExternalAccess/Razor/Features/RazorAnalyzerAssemblyResolver.cs
Show resolved
Hide resolved
src/Tools/ExternalAccess/Razor/Features/RazorAnalyzerAssemblyResolver.cs
Show resolved
Hide resolved
@dotnet/razor-compiler for a second review please :) |
@chsienki the next C# ext prerelease is going out soon, which will become the next full release. Does this change need to make it in for the full (monthly) release? What is the impact of not having it? |
@dibarbet Yes, we'll need to take this, Razor is currently broken without it. |
@jjonescz, @333fred, @RikkiGibson PTAL |
This fixes the FileNotFound exceptions in VSCode by ensuring the right versions of razor are all mapped and loaded together.
This is ultimately an ugly hack on top of a pile of already ugly hacks, but I'm planning on changing the way this works by using a custom ALC tracked here: #76868 so this should be very short lived and just enough to unblock VSCode for now.
Whitespace off makes the diff much clearer.