From 950e36d14246c783127a7026a0c9bca026b0a479 Mon Sep 17 00:00:00 2001 From: Daniel Banck Date: Tue, 9 Jan 2024 16:20:30 +0100 Subject: [PATCH 1/4] Rename TraversalCandidateKind to ReferenceCandidateKind --- internal/lsp/completion.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/lsp/completion.go b/internal/lsp/completion.go index 90399192..38448b8d 100644 --- a/internal/lsp/completion.go +++ b/internal/lsp/completion.go @@ -51,7 +51,7 @@ func toCompletionItem(candidate lang.Candidate, caps lsp.CompletionClientCapabil kind = lsp.EnumCompletion case lang.MapCandidateKind, lang.ObjectCandidateKind: kind = lsp.StructCompletion - case lang.TraversalCandidateKind: + case lang.ReferenceCandidateKind: kind = lsp.VariableCompletion } From 3b484ebb2ac3f34d19927eff109184859c9dce68 Mon Sep 17 00:00:00 2001 From: Daniel Banck Date: Tue, 9 Jan 2024 16:21:38 +0100 Subject: [PATCH 2/4] Rename TokenTraversalStep to TokenReferenceStep --- docs/syntax-highlighting.md | 2 +- internal/lsp/token_encoder.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/syntax-highlighting.md b/docs/syntax-highlighting.md index c249ff47..8d000f56 100644 --- a/docs/syntax-highlighting.md +++ b/docs/syntax-highlighting.md @@ -53,7 +53,7 @@ Fallback types are chosen based on meaningful semantic mapping and default theme | `hcl-objectKey` | `parameter` | | `hcl-mapKey` | `parameter` | | `hcl-keyword` | `variable` | -| `hcl-traversalStep` | `variable` | +| `hcl-referenceStep` | `variable` | | `hcl-typeComplex` | `function` | | `hcl-typePrimitive` | `keyword` | | `hcl-functionName` | `function` | diff --git a/internal/lsp/token_encoder.go b/internal/lsp/token_encoder.go index 343d932e..1e37f44c 100644 --- a/internal/lsp/token_encoder.go +++ b/internal/lsp/token_encoder.go @@ -139,9 +139,9 @@ func (te *TokenEncoder) resolveTokenType(token lang.SemanticToken) (semtok.Token case lang.TokenKeyword: return te.firstSupportedTokenType( semtok.TokenType(lang.TokenKeyword), semtok.TokenTypeVariable) - case lang.TokenTraversalStep: + case lang.TokenReferenceStep: return te.firstSupportedTokenType( - semtok.TokenType(lang.TokenTraversalStep), semtok.TokenTypeVariable) + semtok.TokenType(lang.TokenReferenceStep), semtok.TokenTypeVariable) case lang.TokenTypeComplex: return te.firstSupportedTokenType( semtok.TokenType(lang.TokenTypeComplex), semtok.TokenTypeFunction) From 6a13c6942aab37aed9fb15fc641ec940529fb6b4 Mon Sep 17 00:00:00 2001 From: Daniel Banck Date: Tue, 9 Jan 2024 16:22:01 +0100 Subject: [PATCH 3/4] Rename TraversalExprKind to ReferenceExprKind --- internal/lsp/symbols.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/lsp/symbols.go b/internal/lsp/symbols.go index d745973a..565c033a 100644 --- a/internal/lsp/symbols.go +++ b/internal/lsp/symbols.go @@ -100,7 +100,7 @@ func exprSymbolKind(symbolKind lang.SymbolExprKind, supported []lsp.SymbolKind) case cty.Number: return supportedSymbolKind(supported, lsp.Number) } - case lang.TraversalExprKind: + case lang.ReferenceExprKind: return supportedSymbolKind(supported, lsp.Constant) case lang.TupleConsExprKind: return supportedSymbolKind(supported, lsp.Array) From 7fe3255e56250c4763416f068f2b8ab2f78441e3 Mon Sep 17 00:00:00 2001 From: Daniel Banck Date: Tue, 9 Jan 2024 16:23:24 +0100 Subject: [PATCH 4/4] Bump hcl-lang to `edc6c69` --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c7d82ede..3621222e 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/hashicorp/go-uuid v1.0.3 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hc-install v0.6.2 - github.com/hashicorp/hcl-lang v0.0.0-20240103135921-47e237825ab8 + github.com/hashicorp/hcl-lang v0.0.0-20240110103543-edc6c698701f github.com/hashicorp/hcl/v2 v2.19.1 github.com/hashicorp/terraform-exec v0.20.0 github.com/hashicorp/terraform-json v0.20.0 diff --git a/go.sum b/go.sum index ce728be6..17e53db0 100644 --- a/go.sum +++ b/go.sum @@ -218,8 +218,8 @@ github.com/hashicorp/hc-install v0.6.2 h1:V1k+Vraqz4olgZ9UzKiAcbman9i9scg9GgSt/U github.com/hashicorp/hc-install v0.6.2/go.mod h1:2JBpd+NCFKiHiu/yYCGaPyPHhZLxXTpz8oreHa/a3Ps= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/hcl-lang v0.0.0-20240103135921-47e237825ab8 h1:k6yVHZVOscvP42QLuGFJhpjHQJIqYznGDTpjBnjSRCM= -github.com/hashicorp/hcl-lang v0.0.0-20240103135921-47e237825ab8/go.mod h1:yZkskHa0HSpPecxmoiLTuyXmxI9knxQOA+DGMgyOurM= +github.com/hashicorp/hcl-lang v0.0.0-20240110103543-edc6c698701f h1:74OR582709IK86+rpyIwnSdhRHu/fU/koRytzkDLflk= +github.com/hashicorp/hcl-lang v0.0.0-20240110103543-edc6c698701f/go.mod h1:yZkskHa0HSpPecxmoiLTuyXmxI9knxQOA+DGMgyOurM= github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5RPI= github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= github.com/hashicorp/terraform-exec v0.20.0 h1:DIZnPsqzPGuUnq6cH8jWcPunBfY+C+M8JyYF3vpnuEo=