From 04fe2ccc4aa6b2dba5d6aeea3a950a2429709c97 Mon Sep 17 00:00:00 2001 From: bryankenote Date: Wed, 11 Oct 2023 14:31:04 -0700 Subject: [PATCH] use existing constructor to handle conversion from parser position to language server position --- src/Facility.LanguageServer/FsdReferenceHandler.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Facility.LanguageServer/FsdReferenceHandler.cs b/src/Facility.LanguageServer/FsdReferenceHandler.cs index f918709..ec3ffaa 100644 --- a/src/Facility.LanguageServer/FsdReferenceHandler.cs +++ b/src/Facility.LanguageServer/FsdReferenceHandler.cs @@ -38,11 +38,7 @@ public async Task Handle(ReferenceParams request, Cancellatio var locations = serviceParts.Select(part => new Location() { Uri = documentUri, - Range = new Range( - new OmniSharp.Extensions.LanguageServer.Protocol.Models - .Position(part!.Position.LineNumber - 1, part.Position.ColumnNumber - 1), - new OmniSharp.Extensions.LanguageServer.Protocol.Models - .Position(part.EndPosition.LineNumber - 1, part.EndPosition.ColumnNumber - 1)), + Range = new Range(new Position(part!.Position), new Position(part.EndPosition)), }); return new LocationContainer(locations);