Skip to content

Commit 4c03274

Browse files
fflatenandyleejordan
authored andcommitted
update symbols test with name position
1 parent 3012586 commit 4c03274

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation.
1+
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

44
using System;
@@ -442,7 +442,7 @@ await PsesLanguageClient
442442
Range range = symInfoOrDocSym.SymbolInformation.Location.Range;
443443

444444
Assert.Equal(1, range.Start.Line);
445-
Assert.Equal(0, range.Start.Character);
445+
Assert.Equal(9, range.Start.Character);
446446
Assert.Equal(3, range.End.Line);
447447
Assert.Equal(1, range.End.Character);
448448
});
@@ -867,7 +867,7 @@ function CanSendReferencesCodeLensRequest {
867867

868868
Range range = codeLens.Range;
869869
Assert.Equal(1, range.Start.Line);
870-
Assert.Equal(0, range.Start.Character);
870+
Assert.Equal(9, range.Start.Character);
871871
Assert.Equal(3, range.End.Line);
872872
Assert.Equal(1, range.End.Character);
873873

test/PowerShellEditorServices.Test/Language/SymbolsServiceTests.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -290,15 +290,16 @@ public void FindsSymbolsInFile()
290290
Assert.Equal(3, symbolsResult.Count(symbolReference => symbolReference.SymbolType == SymbolType.Variable));
291291
Assert.Single(symbolsResult.Where(symbolReference => symbolReference.SymbolType == SymbolType.Workflow));
292292
Assert.Single(symbolsResult.Where(symbolReference => symbolReference.SymbolType == SymbolType.Class));
293-
Assert.Equal(2, symbolsResult.Count(symbolReference => symbolReference.SymbolType == SymbolType.Property));
293+
Assert.Single(symbolsResult.Where(symbolReference => symbolReference.SymbolType == SymbolType.Property));
294294
Assert.Single(symbolsResult.Where(symbolReference => symbolReference.SymbolType == SymbolType.Constructor));
295295
Assert.Single(symbolsResult.Where(symbolReference => symbolReference.SymbolType == SymbolType.Method));
296296
Assert.Single(symbolsResult.Where(symbolReference => symbolReference.SymbolType == SymbolType.Enum));
297+
Assert.Single(symbolsResult.Where(symbolReference => symbolReference.SymbolType == SymbolType.EnumMember));
297298

298299
SymbolReference firstFunctionSymbol = symbolsResult.First(r => r.SymbolType == SymbolType.Function);
299300
Assert.Equal("AFunction", firstFunctionSymbol.SymbolName);
300301
Assert.Equal(7, firstFunctionSymbol.ScriptRegion.StartLineNumber);
301-
Assert.Equal(1, firstFunctionSymbol.ScriptRegion.StartColumnNumber);
302+
Assert.Equal(10, firstFunctionSymbol.ScriptRegion.StartColumnNumber);
302303

303304
SymbolReference lastVariableSymbol = symbolsResult.Last(r => r.SymbolType == SymbolType.Variable);
304305
Assert.Equal("$Script:ScriptVar2", lastVariableSymbol.SymbolName);
@@ -308,17 +309,17 @@ public void FindsSymbolsInFile()
308309
SymbolReference firstWorkflowSymbol = symbolsResult.First(r => r.SymbolType == SymbolType.Workflow);
309310
Assert.Equal("AWorkflow", firstWorkflowSymbol.SymbolName);
310311
Assert.Equal(23, firstWorkflowSymbol.ScriptRegion.StartLineNumber);
311-
Assert.Equal(1, firstWorkflowSymbol.ScriptRegion.StartColumnNumber);
312+
Assert.Equal(10, firstWorkflowSymbol.ScriptRegion.StartColumnNumber);
312313

313314
SymbolReference firstClassSymbol = symbolsResult.First(r => r.SymbolType == SymbolType.Class);
314315
Assert.Equal("AClass", firstClassSymbol.SymbolName);
315316
Assert.Equal(25, firstClassSymbol.ScriptRegion.StartLineNumber);
316-
Assert.Equal(1, firstClassSymbol.ScriptRegion.StartColumnNumber);
317+
Assert.Equal(7, firstClassSymbol.ScriptRegion.StartColumnNumber);
317318

318319
SymbolReference firstPropertySymbol = symbolsResult.First(r => r.SymbolType == SymbolType.Property);
319320
Assert.Equal("AProperty", firstPropertySymbol.SymbolName);
320321
Assert.Equal(26, firstPropertySymbol.ScriptRegion.StartLineNumber);
321-
Assert.Equal(5, firstPropertySymbol.ScriptRegion.StartColumnNumber);
322+
Assert.Equal(13, firstPropertySymbol.ScriptRegion.StartColumnNumber);
322323

323324
SymbolReference firstConstructorSymbol = symbolsResult.First(r => r.SymbolType == SymbolType.Constructor);
324325
Assert.Equal("AClass([string]$AParameter)", firstConstructorSymbol.SymbolName);
@@ -328,12 +329,17 @@ public void FindsSymbolsInFile()
328329
SymbolReference firstMethodSymbol = symbolsResult.First(r => r.SymbolType == SymbolType.Method);
329330
Assert.Equal("AMethod([string]$param1, [int]$param2, $param3)", firstMethodSymbol.SymbolName);
330331
Assert.Equal(32, firstMethodSymbol.ScriptRegion.StartLineNumber);
331-
Assert.Equal(5, firstMethodSymbol.ScriptRegion.StartColumnNumber);
332+
Assert.Equal(11, firstMethodSymbol.ScriptRegion.StartColumnNumber);
332333

333334
SymbolReference firstEnumSymbol = symbolsResult.First(r => r.SymbolType == SymbolType.Enum);
334335
Assert.Equal("AEnum", firstEnumSymbol.SymbolName);
335336
Assert.Equal(37, firstEnumSymbol.ScriptRegion.StartLineNumber);
336-
Assert.Equal(1, firstEnumSymbol.ScriptRegion.StartColumnNumber);
337+
Assert.Equal(6, firstEnumSymbol.ScriptRegion.StartColumnNumber);
338+
339+
SymbolReference firstEnumMemberSymbol = symbolsResult.First(r => r.SymbolType == SymbolType.EnumMember);
340+
Assert.Equal("AValue", firstEnumMemberSymbol.SymbolName);
341+
Assert.Equal(38, firstEnumMemberSymbol.ScriptRegion.StartLineNumber);
342+
Assert.Equal(5, firstEnumMemberSymbol.ScriptRegion.StartColumnNumber);
337343
}
338344

339345
[SkippableFact]

0 commit comments

Comments
 (0)