-
Notifications
You must be signed in to change notification settings - Fork 199
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
Use Roslyn LSP library instead of Visual Studio #10682
Conversation
I'm assuming the Vs versions of these are more complete than the Roslyn ones
This commit done entirely via Replace In Files
This is to make things easier in future, as we'll be getting a global using for all protocol types
Not a mechanical commit, but my word is it doing a good job cosplaying as one
src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DelegatedTypes.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListOptimizer.cs
Outdated
Show resolved
Hide resolved
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.
Love this change! Looking forward to seeing it merged once all the dependencies are updated.
Hey @davidwengier, any word on Web Tools? I'm still excited to see this go in someday. 😄 |
@vzarytovskii is web tools moving to STJ still scheduled for this sprint? Or did I miss it and it's already gone in? |
@abonie is working on it currently |
# Conflicts: # src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensScrollingBenchmark.cs # src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks.csproj # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CodeActionEndpoint.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CodeActionResolveEndpoint.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Html/DefaultHtmlCodeActionResolver.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Models/CodeActionResolveParams.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/ExtractToCodeBehindCodeActionResolver.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionItemResolver.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionListProvider.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionResponseRewriter.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/SnippetResponseRewriter.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionResolveEndpoint.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentContextFactory.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverEndpoint.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.TestAccessor.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/IHoverService.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Implementation/ImplementationEndpoint.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/SemanticTokensRangeEndpoint.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/LSPTagHelperTooltipFactory.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/VSLSPTagHelperTooltipFactory.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/CodeActions/CSharp/CSharpCodeActionResolver.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/CodeActions/CSharp/TypeAccessibilityCodeActionProvider.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/CodeActions/CSharp/UnformattedRemappingCSharpCodeActionResolver.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/CodeActions/Html/HtmlCodeActionProvider.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/CodeActions/Models/CodeActionExtensions.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/CodeActions/Razor/AddUsingsCodeActionResolver.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/CodeActions/Razor/GenerateMethodCodeActionResolver.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/CodeActions/Razor/IRazorCodeActionResolver.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/CodeActions/Razor/RazorCodeActionFactory.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/AggregateCompletionItemResolver.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/CompletionItemResolver.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/CompletionListMerger.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/HtmlCommitCharacterResponseRewriter.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/TextEditResponseRewriter.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/RazorCompletionItemResolver.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/VSInternalCompletionItemExtensions.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Diagnostics/RazorDiagnosticConverter.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Diagnostics/RazorTranslateDiagnosticsService.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/IEditMappingService.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SourceText.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_SourceText.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Microsoft.CodeAnalysis.Razor.Workspaces.csproj # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Tooltip/ClassifiedTagHelperTooltipFactory.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Tooltip/MarkupTagHelperTooltipFactory.cs # src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostInlayHintEndpoint.cs # src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostInlayHintResolveEndpoint.cs # src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/DocumentMapping/DefaultLSPDocumentMappingProvider.cs # src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/DocumentMapping/LSPDocumentMappingProvider.cs # src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_MapCode.cs # src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/RazorOnAutoInsertProviderTestBase.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/AddUsingsCodeActionResolverTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/CSharpCodeActionProviderTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/CSharpCodeActionResolverTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/TypeAccessibilityCodeActionProviderTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndToEndTest.NetFx.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionResolutionEndpointTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/HtmlCodeActionProviderTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ComponentAccessibilityCodeActionProviderTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/CreateComponentCodeActionResolverTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/DefaultVSLSPTagHelperTooltipFactoryTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionListProviderTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/ResponseRewriterTestBase.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TextEditResponseRewriterTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionItemResolverTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionResolveEndpointTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/DocumentPullDiagnosticsEndpointTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/FindReferences/FindAllReferencesEndpointTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Microsoft.AspNetCore.Razor.LanguageServer.Test.csproj # src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/LanguageServerTestBase.cs # src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Microsoft.AspNetCore.Razor.Test.Common.Tooling.csproj # src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/DirectiveVerifier.cs # src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Tooltip/MarkupTagHelperTooltipFactoryTest.cs # src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/DocumentMapping/LSPDocumentMappingProviderTest.cs # src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorLSPSpanMappingServiceTest.cs
Response to dotnet/roslyn#74597 to pave the way for #10682 once Web Tools inserts. The break from the Roslyn change is not binary breaking, so no need for dual insertion, and since this change doesn't break anything, we can get this in now, and whenever we happen to bump Roslyn next, there should be no build issues.
FYI the change has been inserted already |
I have local changes that push this branch to latest and seem to work okay in manual testing. The review is not going to be fun though, given this is 6 months old, so I'm considering rebasing and opening a new one. |
# Conflicts: # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Diagnostics/RazorTranslateDiagnosticsService.cs # src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentPullDiagnosticsEndpoint.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/RazorOnAutoInsertProviderTestBase.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/CSharpCodeActionProviderTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/TypeAccessibilityCodeActionProviderTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/HtmlCodeActionProviderTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ComponentAccessibilityCodeActionProviderTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorBreakpointSpanEndpointTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticsPublisherTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs # src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/LanguageServerTestBase.cs
I can only apologise for the size and un-review-ability of this PR, but the integration tests passed, so I've pushed the latest updates. @dotnet/razor-tooling let me know if you would prefer a new PR with cleaner commits. Val build is running: https://dev.azure.com/dnceng/internal/_build/results?buildId=2651760&view=results UPDATE: Oh I just realized this will fail because of symbol check. Maybe it does RPS etc. anyway? |
Override completion seems to be broken.... Investigating |
This got way more complicated over time, so I'm going to close this and try a different approach, through smaller PRs. Thanks for the memories :) Tracking the work at #11588 |
Needs dotnet/roslyn#74597 before this will compile, and needs Web Tools work to be done and inserted before it can be tested, so this isn't going anywhere soon, but I thought I'd put it up a bit early because:
a) I'm keen if anyone has any issues with the global using approach? I'm just trying to avoid
extern alias
in every .cs fileb) This will need lots more commits to keep up with changes in main, so right now is the neatest this will ever be, and hence the easiest to review.
Reviewing commit-at-a-time is thoroughly recommended, as each commit is a standalone change, and the initial few are mostly mechanical.
TODO:
TODO in subsequent PRs due to complexity/desire for manual testing