From f23f93966c0b3fd89935d9f2091e348817bbd2e3 Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Wed, 2 Mar 2022 12:10:05 +0000 Subject: [PATCH] internal/lsp: report dependent modifiers as defaultLibrary --- internal/langserver/handlers/semantic_tokens_test.go | 6 +++--- internal/lsp/token_encoder.go | 4 ++-- internal/lsp/token_types.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/langserver/handlers/semantic_tokens_test.go b/internal/langserver/handlers/semantic_tokens_test.go index 5e3d0b55..92c1d602 100644 --- a/internal/langserver/handlers/semantic_tokens_test.go +++ b/internal/langserver/handlers/semantic_tokens_test.go @@ -76,7 +76,7 @@ func TestSemanticTokensFull(t *testing.T) { ], "tokenModifiers": [ "deprecated", - "modification" + "defaultLibrary" ], "requests": { "full": true @@ -184,7 +184,7 @@ func TestSemanticTokensFull_clientSupportsDelta(t *testing.T) { ], "tokenModifiers": [ "deprecated", - "modification" + "defaultLibrary" ], "requests": { "full": { @@ -293,7 +293,7 @@ func TestVarsSemanticTokensFull(t *testing.T) { ], "tokenModifiers": [ "deprecated", - "modification" + "defaultLibrary" ], "requests": { "full": true diff --git a/internal/lsp/token_encoder.go b/internal/lsp/token_encoder.go index 7915c1f6..2253733a 100644 --- a/internal/lsp/token_encoder.go +++ b/internal/lsp/token_encoder.go @@ -69,10 +69,10 @@ func (te *TokenEncoder) encodeTokenOfIndex(i int) []uint32 { for _, m := range token.Modifiers { switch m { case lang.TokenModifierDependent: - if !te.tokenModifierSupported(TokenModifierModification) { + if !te.tokenModifierSupported(TokenModifierDefaultLibrary) { continue } - modifiers = append(modifiers, TokenModifierModification) + modifiers = append(modifiers, TokenModifierDefaultLibrary) case lang.TokenModifierDeprecated: if !te.tokenModifierSupported(TokenModifierDeprecated) { continue diff --git a/internal/lsp/token_types.go b/internal/lsp/token_types.go index f55410c0..1fcd1817 100644 --- a/internal/lsp/token_types.go +++ b/internal/lsp/token_types.go @@ -113,7 +113,7 @@ var ( } serverTokenModifiers = TokenModifiers{ TokenModifierDeprecated, - TokenModifierModification, + TokenModifierDefaultLibrary, } )