зеркало из https://github.com/dotnet/razor.git
Remove redundant mapping code, because GetPositionInfo already does this
This commit is contained in:
Родитель
f3aaba93ee
Коммит
70bb96ebc3
|
@ -76,12 +76,6 @@ internal sealed class RemoteGoToDefinitionService(in ServiceArgs args) : RazorDo
|
|||
return CallHtml;
|
||||
}
|
||||
|
||||
if (!DocumentMappingService.TryMapToGeneratedDocumentPosition(codeDocument.GetCSharpDocument(), positionInfo.HostDocumentIndex, out var mappedPosition, out _))
|
||||
{
|
||||
// If we can't map to the generated C# file, we're done.
|
||||
return NoFurtherHandling;
|
||||
}
|
||||
|
||||
// Finally, call into C#.
|
||||
var generatedDocument = await context.Snapshot
|
||||
.GetGeneratedDocumentAsync(cancellationToken)
|
||||
|
@ -92,7 +86,7 @@ internal sealed class RemoteGoToDefinitionService(in ServiceArgs args) : RazorDo
|
|||
RemoteWorkspaceAccessor.GetWorkspace(),
|
||||
generatedDocument,
|
||||
typeOnly: false,
|
||||
mappedPosition,
|
||||
positionInfo.Position.ToLinePosition(),
|
||||
cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
|
|
|
@ -66,12 +66,6 @@ internal sealed class RemoteGoToImplementationService(in ServiceArgs args) : Raz
|
|||
return CallHtml;
|
||||
}
|
||||
|
||||
if (!DocumentMappingService.TryMapToGeneratedDocumentPosition(codeDocument.GetCSharpDocument(), positionInfo.HostDocumentIndex, out var mappedPosition, out _))
|
||||
{
|
||||
// If we can't map to the generated C# file, we're done.
|
||||
return NoFurtherHandling;
|
||||
}
|
||||
|
||||
// Finally, call into C#.
|
||||
var generatedDocument = await context.Snapshot
|
||||
.GetGeneratedDocumentAsync(cancellationToken)
|
||||
|
@ -80,7 +74,7 @@ internal sealed class RemoteGoToImplementationService(in ServiceArgs args) : Raz
|
|||
var locations = await ExternalHandlers.GoToImplementation
|
||||
.FindImplementationsAsync(
|
||||
generatedDocument,
|
||||
mappedPosition,
|
||||
positionInfo.Position.ToLinePosition(),
|
||||
supportsVisualStudioExtensions: true,
|
||||
cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
|
|
Загрузка…
Ссылка в новой задаче