-
Notifications
You must be signed in to change notification settings - Fork 217
Update to 2.72.27 #11732
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
Merged
Merged
Update to 2.72.27 #11732
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Make MS.ANC.Mvc.Razor.Extensions.Test\PageDirectiveTest inherit from RazorProjectEngineTestBase and update tests to call CreateAndInitializeCodeDocument(...).
Update all "pass" tests in MS.ANC.Mvc.Razor.Extensions.Version1_X to create code documents from a project engine to ensure that options flow correctly. Note: ModelDirectiveTest contains a tweak to a couple of test assertions to be correct, now that design-time code paths are taken.
Update all "pass" tests in MS.ANC.Mvc.Razor.Extensions.Version2_X to create code documents from a project engine to ensure that options flow correctly. Note: ModelDirectiveTest contains a tweak to a couple of test assertions to be correct, now that design-time code paths are taken.
Update all "pass" tests in MS.ANC.Mvc.Razor.Extensions to create code documents from a project engine to ensure that options flow correctly.
Remove several helper methods from RazorProjectEngineTestBase and clean up the API.
These removes the remaining calls to RazorCodeDocument.Create(RazorSourceDocument) and RazorCodeDocument.Create(RazorSourceDocument, ImmutableArray<RazorSourceDocument>) from compiler test code. Each affected test or helper has either been updated to create RazorCodeDocuments through a RazorProjectEngine, or using the Create(...) overload that also takes options. (Currently, that overload allows null to be passed for the options, but that will change in a later commit.)
These removes the remaining calls to RazorCodeDocument.Create(RazorSourceDocument) and RazorCodeDocument.Create(RazorSourceDocument, ImmutableArray<RazorSourceDocument>) from tooling code and tests. Each call has been updated to use the Create(...) overload that also takes options. (Currently, that overload allows null to be passed for the options, but that will change in a later commit.)
This change ensures that RazorCodeDocument.ParserOptions is never null. This allows the legacy IRazorParserOptionsFeature to be completely removed. This was used as a fallback in some places in the compiler when a RazorCodeDocument didn't contain RazorParserOptions and is no longer needed.
This change ensures that RazorCodeDocument.CodeGenerationOptions is never null. This allows the legacy IRazorCodeGenerationOptionsFeature to be completely removed. This was used as a fallback in some places in the compiler when a RazorCodeDocument didn't contain RazorCodeGenerationOptions and is no longer needed. This also means that it should now be an invariant in the compiler that DocumentIntermediateNode.Options is the same as the code-gen options from the RazorCodeDocument that produced it. In addition, code that used DocumentIntermediateNode.Options as a fallback when RazorCodeDocument.CodeGenerationOptions was null can now be adjusted. This affects the TryComputeNamespace(...) method. That API has tests to verify the behavior when DocumentIntermediateNode.Options differs from RazorCodeDocument.CodeGenerationOptions. This change adjusts or removes those tests.
The primary goal of this change is to document RazorProjectEngineTestBase, now that is core test infrastructure used by many tests. In addition, RazorParserOptions.UseRoslynTokenizer to true by default. If needed, tests can provide configuration to set it to false.
RazorCodeDocument.Create(...) now has two overloads: One that takes the source, and one that takes the source + imports. Both overloads optionally take parser and codegen options. If options aren't provided, defaults will be used.
* Disable existing language server and project system if cohosting is on * Configure source generator when in cohost mode * Save razor documents to host outputs via a dedicated output object * Extract the documents from the razor compiler instead of generating them directly. * Update tests to use generator and skip failing tests --------- Co-authored-by: David Wengier <[email protected]>
Without this fix, depending on where in the line the cursor is, sometimes the first code action is "Extract to Code Behind", and sometimes its "Extract to New Component". The difference is pretty jarring. Before we had "Extract to New Component", there would simply be nothing offered sometimes, but now people see the lightbulb and muscle-memory their way to the wrong action.
Missed these on the first pass because they didn't fail. Hopefully I got the fixes right :D
There was some feedback on Reddit this morning about code action ordering and Extract to Component being a little "in your face". See https://www.reddit.com/r/Blazor/comments/1jjg3bh/am_i_doing_something_wrong_or_is_intellisense_and/mjq7jp3/?context=3 and the rest of the thread in general. This PR: * Makes sure Extract to Component always last, since it is offered basically everywhere * Makes sure Add Using and Fully Qualify are always first, since they're the most likely code actions people want * Ensures Extract to Code Behind is offered at `$$@code` since previously there would be no light bulb in that situation, but now there is and muscle-memory makes people hit it, which extract the code block to a new component, which is not what they want. Note that the ordering here is only among the Razor code actions. All C# and Html code actions are always still after the Razor code actions, even Extract to Component.
Avoids the SDK setting this to dotnet/dotnet automatically, which is generally not useful for customers.
* Add a suppressor for CS8618 on editor required component parameters * Add suppressor tests * Update to latest ms.cs.analyzer.testing: - remove XunitVerifiers and use default verifier instead (see https://github.com/dotnet/roslyn-sdk/blob/main/src/Microsoft.CodeAnalysis.Testing/README.md#obsolete-packages) - Remove unneeded .xunit package references --------- Co-authored-by: Jan Jones <[email protected]> Co-authored-by: Fred Silberberg <[email protected]>
Razor side of dotnet/roslyn#77715 * Remove `Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace`, we no longer ship an EA for Roslyn * Add a new `Microsoft.VisualStudioCode.RazorExtension` and package that will be put in `.razorExtension` in VS Code * This will contain endpoints and LSP services that will be loaded in the roslyn language server for VS Code. * Remove `Microsoft.AspNetCore.Razor.ProjectEngineHost` as that layer of separation is no longer needed Copilot description below ----------------------------------------------------------------------------------- This pull request includes several changes to the `Razor` project, focusing on project restructuring and dependency updates. The most important changes include adding a new package version, renaming and removing projects, and updating the `RazorWorkspaceListenerBase` class. ### Project restructuring: * [`Razor.sln`](diffhunk://#diff-2561476bb155e6bc1eba8028e5a49517b814ef36031e472459611e82a894b7baL109-R111): Renamed `Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace` to `Microsoft.VisualStudioCode.RazorExtension` and removed `Microsoft.AspNetCore.Razor.ProjectEngineHost` and its test project. [[1]](diffhunk://#diff-2561476bb155e6bc1eba8028e5a49517b814ef36031e472459611e82a894b7baL109-R111) [[2]](diffhunk://#diff-2561476bb155e6bc1eba8028e5a49517b814ef36031e472459611e82a894b7baL421-L428) [[3]](diffhunk://#diff-2561476bb155e6bc1eba8028e5a49517b814ef36031e472459611e82a894b7baL594) * [`docs/ProjectsAndLayering.md`](diffhunk://#diff-719f03eb5eb40ba6369e5c7987571576b6a119f40667a0fffc63667c55f2928cL108-R108): Updated documentation to reflect the new project name. ### Code updates: * [`RazorWorkspaceListenerBase.cs`](diffhunk://#diff-30acd8a866ed49034848667c8d9bc0def03390f1ffe494fae192cb667028b497R45-L60): Replaced `_disposed` with `_disposeTokenSource.IsCancellationRequested` for better disposal handling and added `_tagHelperResolver` and `_projectChecksums` fields. [[1]](diffhunk://#diff-30acd8a866ed49034848667c8d9bc0def03390f1ffe494fae192cb667028b497R45-L60) [[2]](diffhunk://#diff-30acd8a866ed49034848667c8d9bc0def03390f1ffe494fae192cb667028b497L96-R95) [[3]](diffhunk://#diff-30acd8a866ed49034848667c8d9bc0def03390f1ffe494fae192cb667028b497L176-R175) [[4]](diffhunk://#diff-30acd8a866ed49034848667c8d9bc0def03390f1ffe494fae192cb667028b497L238-R267) ### Project removals: * Removed `Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace` project and its related files. [[1]](diffhunk://#diff-0accfb04f401ca4d46e88623878593903f55f5dd25885a95668f3f6d0dc98da9L1-L46) [[2]](diffhunk://#diff-9ef9168b7e136073656fa86159c46abf47a068f616c37046de8facd164c10c64L1-L6) [[3]](diffhunk://#diff-30acd8a866ed49034848667c8d9bc0def03390f1ffe494fae192cb667028b497R6-L30)
… Build ID 2672960
… Build ID 2672960 (dotnet#11664)
dibarbet
approved these changes
Apr 11, 2025
phil-allen-msft
approved these changes
Apr 11, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@codeblock