-
Notifications
You must be signed in to change notification settings - Fork 229
Pre-snap Code Clean Up #11675
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
Pre-snap Code Clean Up #11675
Conversation
davidwengier
left a comment
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.
Funny, I ran across the Unsupported stuff when doing completion resolve, and I made a note to check if it was still necessary and remove it if not. Thanks for doing the hard work :)
(probably would have been better as a separate PR though, just in case some weird legacy thing goes wrong 😛)
| } | ||
|
|
||
| [Fact] | ||
| public async Task Handle_AfterLastLineCharacterZero() |
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.
This seems like a good test, despite the call to SetUnsupported.
I thought about that, but decided it wasn't worth a second PR. The code is truly dead and I couldn't imagine how something would ever call it. We started defaulting to MVC-3.0 a long while ago to match the source generator, and there's no such thing as a custom Razor extension anymore. So, anything that would be broken is already broken. |
You're just gonna tempt fate like that?! |
Point taken, though I wish you'd be clearer about making it instead of using passive aggressive 😛 emojis 😀. I'll pull those commits into a separate PR. Rebase incoming... |
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move DocumentKey to Microsoft.CodeAnalysis.Razor.ProjectSystem namespace
These tests were recently marked with "#nullable disable" unnecessarily.
This nullability annotations in this file are accurate.
These tests were recently marked with "#nullable disable" unnecessarily.
GeneratedDocumentTextLoader is only used by the DynamicFileInfo system in the VS layer, so this change moves it there and puts it in the Microsoft.VisualStudio.Razor.DynamicFiles namespace. This includes test updates to move tests to the correct locations as well.
This change moves two tests from MS.VS.LanguageServices.Razor.Test\LanguageClient\DynamicFiles to MS.VS.LanguageServices.Razor.Test\DynamicFiles and updates their namespaces.
IDocumentContextFactory and IDocumentContextFactoryExtensions are only used by the language server and can safely live there. Both have been moved to the Microsoft.AspNetCore.Razor.LanguageServer.ProjectSystem namespace.
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move IDocumentSnapshot to the Microsoft.CodeAnalysis.Razor.ProjectSystem namespace
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move IProjectSnapshot to the Microsoft.CodeAnalysis.Razor.ProjectSystem namespace
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move ProjectKey to the Microsoft.CodeAnalysis.Razor.ProjectSystem namespace
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move ProjectWorkspaceState to the Microsoft.CodeAnalysis.Razor.ProjectSystem namespace
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move RazorProjectInfo to the Microsoft.CodeAnalysis.Razor.ProjectSystem namespace
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move DefaultProjectEngineFactory to the Microsoft.CodeAnalysis.Razor.ProjectEngineHost namespace
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move EmptyProjectEngineFactory to the Microsoft.CodeAnalysis.Razor.ProjectEngineHost namespace. In addition, clean up a bit and use ArgHelper.
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move IProjectEngineFactory to the Microsoft.CodeAnalysis.Razor.ProjectEngineHost namespace.
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move IProjectEngineFactoryExtensions to the Microsoft.CodeAnalysis.Razor.ProjectEngineHost namespace.
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move IProjectEngineFactoryProvider to the Microsoft.CodeAnalysis.Razor.ProjectEngineHost namespace.
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move ProjectEngineFactories to the Microsoft.CodeAnalysis.Razor.ProjectEngineHost namespace.
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move ProjectEngineFactory to the Microsoft.CodeAnalysis.Razor.ProjectEngineHost namespace.
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move ProjectEngineFactory_Unsupported to the Microsoft.CodeAnalysis.Razor.ProjectEngineHost namespace.
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move ProjectEngineFactoryProvider to the Microsoft.CodeAnalysis.Razor.ProjectEngineHost namespace.
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move UnsupportedCSharpLoweringPhase to the Microsoft.CodeAnalysis.Razor.ProjectEngineHost namespace.
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move UnsupportedRazorConfiguration to the Microsoft.CodeAnalysis.Razor.ProjectEngineHost namespace.
This change updates all of the namespaces in the Microsoft.CodeAnalysis.Razor.Workspaces\Serialization folder to Microsoft.CodeAnalysis.Razor.Serialization.*.
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move UrlDecoder to the Microsoft.CodeAnalysis.Razor.Utilities namespace.
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move TagHelperCache to the Microsoft.CodeAnalysis.Razor.Utilities namespace.
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move StreamExtensions to the Microsoft.CodeAnalysis.Razor.Utilities namespace.
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move RazorProjectInfoFactory to the Microsoft.CodeAnalysis.Razor.Utilities namespace.
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, rename ProjectInfoAction to RazorProjectInfoAction and move it to the Microsoft.CodeAnalysis.Razor.Utilities namespace.
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move MemoryCache<TKey, TValue> to the Microsoft.CodeAnalysis.Razor.Utilities namespace.
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move FilePathNormalizer and FilePathNormalizingComparer to the Microsoft.CodeAnalysis.Razor.Utilities namespace.
These should not be in the ProjectEngineHost folder or namespace
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move AsyncBatchingWorkQueue to the Microsoft.CodeAnalysis.Razor.Utilities namespace.
Now that they've been moved to Microsoft.CodeAnalysis.Razor.Workspaces, this change moves all types from the Microsoft.AspNetCore.Razor.Utilities namespace to Microsoft.CodeAnalysis.Razor.Utilities.
Now that it is in Microsoft.CodeAnalysis.Razor.Workspaces, move Extensions from the Microsoft.AspNetCore.Razor.ProjectSystem namespace to Microsoft.CodeAnalysis.Razor.ProjectSystem
Now that they've been moved to Microsoft.CodeAnalysis.Razor.Workspaces, this change moves all types from the Microsoft.AspNetCore.Razor.Telemetry namespace to Microsoft.CodeAnalysis.Razor.Telemetry.
Now that they've been moved to Microsoft.CodeAnalysis.Razor.Workspaces, this change moves all types from the Microsoft.AspNetCore.Razor.TextDifferencing namespace to Microsoft.CodeAnalysis.Razor.TextDifferencing.
b56c092 to
38b3d1b
Compare
src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentKey.cs
Show resolved
Hide resolved
#11685 now includes those commits. |
This is a follow up to #11675 that cleans up and removes some code in the "ProjectEngineHost" folder. Notably, it turns out that the system for marking projects as "unsupported" is no longer used. So, checks for `RazorCodeDocument.IsUnsupported()` can be removed from the language server and tests for this scenario can be removed. ~~**NOTE**: This PR is currently based on `pre-snap-code-clean-up` to aid code reviews. I'll rebase it to `main` once #11675 is merged.~~ Changed the base to `main`
This change moves types that were recently moved to
Microsoft.CodeAnalysis.Razor.Workspacesto the appropriate namespaces. The intent is to get this in before the snap so that future cherry-picks are a bit easier. It's a big change, but it's almost completely mechanical. I recommend reviewing commit-by-commit, though there's a lot of commits too!Note that this PR doesn't actually require a review from @dotnet/razor-compiler. It seems that tweaks to the tooling-specific JSON serialization files are causing that reviewer to be included.