Skip to content

Commit 8592540

Browse files
author
Justin Chen
committed
fixed spacing, added note about token array representation
1 parent 3fba85f commit 8592540

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ protected override Task Tokenize(SemanticTokensBuilder builder, ITextDocumentIde
4343
CancellationToken cancellationToken)
4444
{
4545
ScriptFile file = _workspaceService.GetFile(DocumentUri.GetFileSystemPath(identifier));
46-
foreach (Token token in file.ScriptTokens){
46+
foreach (Token token in file.ScriptTokens)
47+
{
4748
PushToken(token, builder);
4849
}
4950
return Task.CompletedTask;
@@ -79,7 +80,8 @@ internal static IEnumerable<SemanticToken> ConvertToSemanticTokens(Token token)
7980
}
8081

8182
SemanticTokenType mappedType = MapSemanticTokenType(token);
82-
if (mappedType == null){
83+
if (mappedType == null)
84+
{
8385
yield break;
8486
}
8587

test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ await PsesLanguageClient
11641164
var expectedArr = new int[5]
11651165
{
11661166
// line, index, token length, token type, token modifiers
1167-
0, 0, scriptContent.Length, 2, 0 //token 1 is function
1167+
0, 0, scriptContent.Length, 2, 0 //function token: line 0, index 0, length, type 2 = keyword, no modifiers
11681168
};
11691169

11701170
Assert.Equal(expectedArr, result.Data.ToArray());

0 commit comments

Comments
 (0)