You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update ProjectWorkspaceState and HostProject at the same time (dotnet#11191)
Preparation for ongoing work to hook up the Roslyn tokenizer and
dotnet#11182 I suppose.
There were three places that `UpdateProjectWorkspaceState` was called:
1. In `RazorProjectService`, just before calling
`UpdateProjectConfiguration`
2. In `ProjectWorkspaceStateGenerator`, where we will need to add a call
to `UpdateProjectConfiguration` in future, to wire up the tokenizer
3. In our LiveShare bits, in response to events from the above.
Previous attempts to plumb through more things for `RazorConfiguration`
resulted in RPS failures, that appeared to be simply more compilations
of closed files. This makes sense because we were adding another update,
which would have triggered another set of `ProjectChanged` events. I
thought it would make more sense to combine these two updates together,
so no matter which part of the project was being updated, there could be
a single `ProjectChanged` notification. This is that.
Copy file name to clipboardExpand all lines: src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorLanguageServerBenchmarkBase.cs
_logger.LogInformation($"Updating project '{project.Key}' TagHelpers ({projectWorkspaceState.TagHelpers.Length}) and C# Language Version ({projectWorkspaceState.CSharpLanguageVersion}).");
_logger.LogTrace($"Updating project '{project.Key}'. The project is already using configuration '{configuration.ConfigurationName}' and root namespace '{rootNamespace}'.");
380
-
return;
381
-
}
382
-
383
374
if(configurationisnull)
384
375
{
385
376
configuration=FallbackRazorConfiguration.Latest;
386
377
_logger.LogInformation($"Updating project '{project.Key}' to use the latest configuration ('{configuration.ConfigurationName}')'.");
_logger.LogInformation($"Updating project '{project.Key}' to Razor configuration '{configuration.ConfigurationName}' with language version '{configuration.LanguageVersion}'.");
391
-
}
392
-
393
-
if(currentRootNamespace!=rootNamespace)
379
+
elseif(currentConfiguration==configuration&&
380
+
currentRootNamespace==rootNamespace)
394
381
{
395
-
_logger.LogInformation($"Updating project '{project.Key}''s root namespace to '{rootNamespace}'.");
382
+
_logger.LogTrace($"Updating project '{project.Key}'. The project is already using configuration '{configuration.ConfigurationName}' and root namespace '{rootNamespace}'.");
0 commit comments