Skip to content

Commit 1af7988

Browse files
authored
Fix highlighting offset (#1084)
* Fix highlighting offset * Change test offsets * Fix initial offset * Change offsets * Try again
1 parent 8ef3890 commit 1af7988

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/PowerShellEditorServices/Services/TextDocument/Handlers/DocumentHighlightHandler.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ public Task<DocumentHighlightContainer> Handle(
6060

6161
IReadOnlyList<SymbolReference> symbolOccurrences = _symbolsService.FindOccurrencesInFile(
6262
scriptFile,
63-
(int)request.Position.Line,
64-
(int)request.Position.Character);
63+
(int)request.Position.Line + 1,
64+
(int)request.Position.Character + 1);
6565

6666
if (symbolOccurrences == null)
6767
{

test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ await LanguageClient.SendRequest<DocumentHighlightContainer>(
444444
},
445445
Position = new Position
446446
{
447-
Line = 4,
447+
Line = 3,
448448
Character = 1
449449
}
450450
});

0 commit comments

Comments
 (0)