Conversation
Co-authored-by: davidwengier <754264+davidwengier@users.noreply.github.com>
Co-authored-by: davidwengier <754264+davidwengier@users.noreply.github.com>
|
|
||
| protected override bool RequiresLSPSolution => true; | ||
|
|
||
| public ImmutableArray<Registration> GetRegistrations(VSInternalClientCapabilities clientCapabilities, RazorCohostRequestContext requestContext) |
There was a problem hiding this comment.
We don't need to register anything for WrapWithTag, so this method is not needed, and the class doesn't need to implement IDynamicRegistrationProvider, or have the export attribute for that interface
There was a problem hiding this comment.
Fixed in 252a33b. Removed the IDynamicRegistrationProvider implementation, export attribute, and GetRegistrations method since WrapWithTag doesn't need registration.
Co-authored-by: davidwengier <754264+davidwengier@users.noreply.github.com>
Co-authored-by: davidwengier <754264+davidwengier@users.noreply.github.com>
Removed unnecessary dynamic registration implementation as WrapWithTag doesn't need registration: - Removed IDynamicRegistrationProvider interface implementation - Removed Export attribute for IDynamicRegistrationProvider - Removed GetRegistrations method Addresses feedback from @davidwengier Co-authored-by: davidwengier <754264+davidwengier@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
|
||
| internal interface IRemoteWrapWithTagService | ||
| { | ||
| ValueTask<RemoteResponse<bool>> IsValidWrapWithTagLocationAsync(RazorPinnedSolutionInfoWrapper solutionInfo, DocumentId razorDocumentId, LspRange range, CancellationToken cancellationToken); |
There was a problem hiding this comment.
The range parameter here is of type LspRange, which won't work as the types need to be serializable by MessagePack. Making it a LinePositionSpan will work, and there is a ToLinePositionSpan() method that can be called in the endpoint to do the conversion.
There was a problem hiding this comment.
Fixed in fdbcebd. Changed the range parameter from LspRange to LinePositionSpan for MessagePack serialization compatibility. The cohost endpoint now converts using ToLinePositionSpan() before calling the remote service.
| var codeDocument = await context.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); | ||
| var sourceText = codeDocument.Source.Text; | ||
|
|
||
| if (range?.Start is not { } start || |
There was a problem hiding this comment.
Rather than copy the code from WrapWithTagEndpoint, lets instead share it. Can do this by creating a new class in the Workspaces project, which has a static method that contains this logic. Call it WrapWithTagHelper, and it can have a method like IsValidWrappingRange(RazorCodeDocument codeDocument, LinePositionSpan range).
Also update the existing WrapWithTagEndpoint to call this new shared function
There was a problem hiding this comment.
Fixed in fdbcebd. Created WrapWithTagHelper in the Workspaces project with shared validation logic. Updated both the original WrapWithTagEndpoint and RemoteWrapWithTagService to use this shared helper, eliminating code duplication while preserving exact behavior.
|
|
||
| private async ValueTask<Response> IsValidWrapWithTagLocationAsync( | ||
| RemoteDocumentContext context, | ||
| LspRange range, |
There was a problem hiding this comment.
This needs to be LinePositionSpan too
There was a problem hiding this comment.
Fixed in fdbcebd. Updated the parameter type to LinePositionSpan to match the interface changes for MessagePack serialization.
…tionSpan Co-authored-by: davidwengier <754264+davidwengier@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This PR ports the existing
WrapWithTagEndpointto the cohosting architecture, providing better performance and consistency with other Razor language services.Changes Made
1. Remote Service Infrastructure
IRemoteWrapWithTagService- New interface inMicrosoft.CodeAnalysis.Razor.WorkspacesIsValidWrapWithTagLocationAsync- Validates if position supports wrap with tag operationFixHtmlTextEditsAsync- Fixes text edits containing tilde characters from generated HTMLRemoteWrapWithTagService- Implementation inMicrosoft.CodeAnalysis.Remote.RazorWrapWithTagEndpointFormattingUtilitiesin the remote context2. Cohost Endpoint
CohostWrapWithTagEndpoint- New endpoint inMicrosoft.VisualStudio.LanguageServices.Razor3. Service Registration
Microsoft.VisualStudio.Razor.WrapWithTagentry toServices.propsIRemoteWrapWithTagServicetoRazorServices.MessagePackServices4. Comprehensive Tests
Architecture Benefits
The implementation preserves all existing functionality while moving computation to the out-of-process service for better performance in Visual Studio.
Fixes #11993.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
80zvsblobprodcus35.vsblob.vsassets.io/home/REDACTED/work/razor/razor/.dotnet/dotnet msbuild /m /nologo /clp:Summary /v:minimal /nr:true /warnaserror /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=false /home/REDACTED/work/razor/razor/artifacts/toolset/restore.proj /t:__WriteToolsetLocation /clp:ErrorsOnly;NoSummary /p:__ToolsetLocationOutputFile=/home/REDACTED/work/razor/razor/artifacts/toolset/9.0.0-beta.25255.5.txt(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.