Skip to content

Commit d4a86ac

Browse files
author
Justin Chen
committed
changed name to PsesSemanticTokensHandler
1 parent 8592540 commit d4a86ac

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/PowerShellEditorServices/Server/PsesLanguageServer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public async Task StartAsync()
9292
.WithHandler<GetCommandHandler>()
9393
.WithHandler<ShowHelpHandler>()
9494
.WithHandler<ExpandAliasHandler>()
95-
.WithHandler<PsesSemanticTokens>()
95+
.WithHandler<PsesSemanticTokensHandler>()
9696
.OnInitialize(
9797
async (languageServer, request, cancellationToken) =>
9898
{

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
namespace Microsoft.PowerShell.EditorServices.Handlers
2121
{
22-
internal class PsesSemanticTokens : SemanticTokensHandler
22+
internal class PsesSemanticTokensHandler : SemanticTokensHandler
2323
{
2424
private readonly ILogger _logger;
2525
private readonly WorkspaceService _workspaceService;
@@ -33,7 +33,7 @@ internal class PsesSemanticTokens : SemanticTokensHandler
3333
RangeProvider = true
3434
};
3535

36-
public PsesSemanticTokens(ILogger<PsesSemanticTokens> logger, WorkspaceService workspaceService) : base(s_registrationOptions)
36+
public PsesSemanticTokensHandler(ILogger<PsesSemanticTokensHandler> logger, WorkspaceService workspaceService) : base(s_registrationOptions)
3737
{
3838
_logger = logger;
3939
_workspaceService = workspaceService;

test/PowerShellEditorServices.Test/Language/SemanticTokenTest.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function Get-Sum {
3636

3737
foreach (Token t in scriptFile.ScriptTokens)
3838
{
39-
List<SemanticToken> mappedTokens = new List<SemanticToken>(PsesSemanticTokens.ConvertToSemanticTokens(t));
39+
List<SemanticToken> mappedTokens = new List<SemanticToken>(PsesSemanticTokensHandler.ConvertToSemanticTokens(t));
4040
switch (t.Text)
4141
{
4242
case "function":
@@ -72,12 +72,12 @@ public async Task TokenizesStringExpansion()
7272
Version.Parse("5.0"));
7373

7474
Token commandToken = scriptFile.ScriptTokens[0];
75-
List<SemanticToken> mappedTokens = new List<SemanticToken>(PsesSemanticTokens.ConvertToSemanticTokens(commandToken));
75+
List<SemanticToken> mappedTokens = new List<SemanticToken>(PsesSemanticTokensHandler.ConvertToSemanticTokens(commandToken));
7676
Assert.Single(mappedTokens);
7777
Assert.Equal(SemanticTokenType.Function, mappedTokens[0].Type);
7878

7979
Token stringExpandableToken = scriptFile.ScriptTokens[1];
80-
mappedTokens = new List<SemanticToken>(PsesSemanticTokens.ConvertToSemanticTokens(stringExpandableToken));
80+
mappedTokens = new List<SemanticToken>(PsesSemanticTokensHandler.ConvertToSemanticTokens(stringExpandableToken));
8181
Assert.Collection(mappedTokens,
8282
sToken => Assert.Equal(SemanticTokenType.Function, sToken.Type),
8383
sToken => Assert.Equal(SemanticTokenType.Function, sToken.Type),
@@ -101,7 +101,7 @@ function Get-A*A {
101101

102102
foreach (Token t in scriptFile.ScriptTokens)
103103
{
104-
List<SemanticToken> mappedTokens = new List<SemanticToken>(PsesSemanticTokens.ConvertToSemanticTokens(t));
104+
List<SemanticToken> mappedTokens = new List<SemanticToken>(PsesSemanticTokensHandler.ConvertToSemanticTokens(t));
105105
switch (t.Text)
106106
{
107107
case "function":
@@ -126,7 +126,7 @@ public async Task RecognizesArrayMemberInExpandableString()
126126

127127
foreach (Token t in scriptFile.ScriptTokens)
128128
{
129-
List<SemanticToken> mappedTokens = new List<SemanticToken>(PsesSemanticTokens.ConvertToSemanticTokens(t));
129+
List<SemanticToken> mappedTokens = new List<SemanticToken>(PsesSemanticTokensHandler.ConvertToSemanticTokens(t));
130130
switch (t.Text)
131131
{
132132
case "$Array":
@@ -149,7 +149,7 @@ public async Task RecognizesCurlyQuotedString()
149149
text,
150150
Version.Parse("5.0"));
151151

152-
List<SemanticToken> mappedTokens = new List<SemanticToken>(PsesSemanticTokens.ConvertToSemanticTokens(scriptFile.ScriptTokens[0]));
152+
List<SemanticToken> mappedTokens = new List<SemanticToken>(PsesSemanticTokensHandler.ConvertToSemanticTokens(scriptFile.ScriptTokens[0]));
153153
Assert.Collection(mappedTokens, sToken => Assert.Equal(SemanticTokenType.String, mappedTokens[0].Type));
154154
}
155155

@@ -171,7 +171,7 @@ enum MyEnum{
171171

172172
foreach (Token t in scriptFile.ScriptTokens)
173173
{
174-
List<SemanticToken> mappedTokens = new List<SemanticToken>(PsesSemanticTokens.ConvertToSemanticTokens(t));
174+
List<SemanticToken> mappedTokens = new List<SemanticToken>(PsesSemanticTokensHandler.ConvertToSemanticTokens(t));
175175
switch (t.Text)
176176
{
177177
case "enum":

0 commit comments

Comments
 (0)