diff --git a/src/PowerShellEditorServices/PowerShellEditorServices.csproj b/src/PowerShellEditorServices/PowerShellEditorServices.csproj index 5d180bf26..3a98eb3e0 100644 --- a/src/PowerShellEditorServices/PowerShellEditorServices.csproj +++ b/src/PowerShellEditorServices/PowerShellEditorServices.csproj @@ -39,7 +39,7 @@ - + diff --git a/src/PowerShellEditorServices/Services/TextDocument/Handlers/FoldingRangeHandler.cs b/src/PowerShellEditorServices/Services/TextDocument/Handlers/FoldingRangeHandler.cs index 1a9da9eae..6ec951691 100644 --- a/src/PowerShellEditorServices/Services/TextDocument/Handlers/FoldingRangeHandler.cs +++ b/src/PowerShellEditorServices/Services/TextDocument/Handlers/FoldingRangeHandler.cs @@ -12,7 +12,7 @@ using Microsoft.PowerShell.EditorServices.Utility; using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using OmniSharp.Extensions.LanguageServer.Server; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; namespace Microsoft.PowerShell.EditorServices.Handlers { diff --git a/src/PowerShellEditorServices/Services/TextDocument/Handlers/PsesSemanticTokensHandler.cs b/src/PowerShellEditorServices/Services/TextDocument/Handlers/PsesSemanticTokensHandler.cs index 4d2d2870b..eacd4665e 100644 --- a/src/PowerShellEditorServices/Services/TextDocument/Handlers/PsesSemanticTokensHandler.cs +++ b/src/PowerShellEditorServices/Services/TextDocument/Handlers/PsesSemanticTokensHandler.cs @@ -12,26 +12,24 @@ using Microsoft.PowerShell.EditorServices.Services; using Microsoft.PowerShell.EditorServices.Services.TextDocument; using Microsoft.PowerShell.EditorServices.Utility; -using OmniSharp.Extensions.LanguageServer.Protocol; +using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Document.Proposals; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Models.Proposals; namespace Microsoft.PowerShell.EditorServices.Handlers { - internal class PsesSemanticTokensHandler : SemanticTokensHandler + internal class PsesSemanticTokensHandler : SemanticTokensHandlerBase { private static readonly SemanticTokensRegistrationOptions s_registrationOptions = new SemanticTokensRegistrationOptions { DocumentSelector = LspUtils.PowerShellDocumentSelector, Legend = new SemanticTokensLegend(), - DocumentProvider = new Supports( - isSupported: true, - new SemanticTokensDocumentProviderOptions - { - Edits = true - }), - RangeProvider = true + Full = new SemanticTokensCapabilityRequestFull + { + Delta = true + }, + Range = true }; private readonly ILogger _logger; diff --git a/test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs b/test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs index a6047542f..5a15aac66 100644 --- a/test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs +++ b/test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs @@ -1147,7 +1147,7 @@ public async Task CanSendSemanticTokenRequest() SemanticTokens result = await PsesLanguageClient .SendRequest( - "textDocument/semanticTokens", + "textDocument/semanticTokens/full", new SemanticTokensParams { TextDocument = new TextDocumentIdentifier @@ -1162,7 +1162,7 @@ await PsesLanguageClient var expectedArr = new int[5] { // line, index, token length, token type, token modifiers - 0, 0, scriptContent.Length, 2, 0 //function token: line 0, index 0, length, type 2 = keyword, no modifiers + 0, 0, scriptContent.Length, 1, 0 //function token: line 0, index 0, length of script, type 1 = keyword, no modifiers }; Assert.Equal(expectedArr, result.Data.ToArray()); diff --git a/test/PowerShellEditorServices.Test/PowerShellEditorServices.Test.csproj b/test/PowerShellEditorServices.Test/PowerShellEditorServices.Test.csproj index a344b349e..906a42319 100644 --- a/test/PowerShellEditorServices.Test/PowerShellEditorServices.Test.csproj +++ b/test/PowerShellEditorServices.Test/PowerShellEditorServices.Test.csproj @@ -28,7 +28,7 @@ - +