From 37aba0747838eb7084dceb0f96f0aa6917cb9fd6 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Thu, 14 Nov 2024 13:22:44 +1100 Subject: [PATCH] Dont map spans for aspx files --- .../Workspace/VisualStudioDocumentNavigationService.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/VisualStudio/Core/Def/Workspace/VisualStudioDocumentNavigationService.cs b/src/VisualStudio/Core/Def/Workspace/VisualStudioDocumentNavigationService.cs index 5d1a9ca5d5377..97ec5a757a3ab 100644 --- a/src/VisualStudio/Core/Def/Workspace/VisualStudioDocumentNavigationService.cs +++ b/src/VisualStudio/Core/Def/Workspace/VisualStudioDocumentNavigationService.cs @@ -228,10 +228,12 @@ await getTextSpanForMappingAsync(document).ConfigureAwait(false), // If the mapped file maps to the same document that was passed in, then re-use the documentId to preserve context. // Otherwise, just pick one of the ids to use for navigation. var documentIdToNavigate = documentIdsForFilePath.Contains(documentId) ? documentId : documentIdsForFilePath.First(); - return GetNavigationCallback( - documentIdToNavigate, - workspace, - sourceText => getVsTextSpanForMapping(sourceText, mappedSpan.Span)); + + // For Venus documents, further mapping is done in the callback, so we don't want to do it here via getVsTextSpanForMapping + var getSpanForCallback = IsSecondaryBuffer(documentIdToNavigate) + ? getVsTextSpan + : sourceText => getVsTextSpanForMapping(sourceText, mappedSpan.Span); + return GetNavigationCallback(documentIdToNavigate, workspace, getSpanForCallback); } return await GetNavigableLocationForMappedFileAsync(