Skip to content

Commit

Permalink
Add support for variable type (#54)
Browse files Browse the repository at this point in the history
So that completion, hover and semantic-tokens work for variable `type`.

Related to hashicorp/terraform-ls#490
  • Loading branch information
beandrad authored Jun 9, 2021
1 parent 2fb6ae2 commit f204156
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.14
require (
github.com/google/go-cmp v0.5.6
github.com/hashicorp/go-version v1.3.0
github.com/hashicorp/hcl-lang v0.0.0-20210603100913-81056fd9a6e0
github.com/hashicorp/hcl-lang v0.0.0-20210609120759-c626a5e211fc
github.com/hashicorp/hcl/v2 v2.10.0
github.com/hashicorp/terraform-json v0.11.0
github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw=
github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/hcl-lang v0.0.0-20210603100913-81056fd9a6e0 h1:CmEDMGKu8J5E8Yk4lcYwS8tC/K2ybAQ4nStw8raIjVQ=
github.com/hashicorp/hcl-lang v0.0.0-20210603100913-81056fd9a6e0/go.mod h1:uMsq6wV8ZXEH8qndov4tncXlHDYnZ8aHsGmS4T74e2o=
github.com/hashicorp/hcl-lang v0.0.0-20210609120759-c626a5e211fc h1:Kuz00XoVdIcsZ4ak4xI1Tc/1waKqAISzgqgzWn0DE2Y=
github.com/hashicorp/hcl-lang v0.0.0-20210609120759-c626a5e211fc/go.mod h1:uMsq6wV8ZXEH8qndov4tncXlHDYnZ8aHsGmS4T74e2o=
github.com/hashicorp/hcl/v2 v2.10.0 h1:1S1UnuhDGlv3gRFV4+0EdwB+znNP5HmcGbIqwnSCByg=
github.com/hashicorp/hcl/v2 v2.10.0/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg=
github.com/hashicorp/terraform-json v0.11.0 h1:4zDqqW2F3kOysORIaYKFGgWDYIRA3hwqx3XHeHkbBQ0=
Expand Down
2 changes: 1 addition & 1 deletion internal/schema/0.12/variable_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func variableBlockSchema(v *version.Version) *schema.BlockSchema {
Description: lang.Markdown("Description to document the purpose of the variable and what value is expected"),
},
"type": {
Expr: schema.ExprConstraints{},
Expr: schema.ExprConstraints{schema.TypeDeclarationExpr{}},
IsOptional: true,
Description: lang.Markdown("Type constraint restricting the type of value to accept, e.g. `string` or `list(string)`"),
},
Expand Down
2 changes: 1 addition & 1 deletion internal/schema/0.14/variable_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var variableBlockSchema = &schema.BlockSchema{
Description: lang.Markdown("Description to document the purpose of the variable and what value is expected"),
},
"type": {
Expr: schema.ExprConstraints{},
Expr: schema.ExprConstraints{schema.TypeDeclarationExpr{}},
IsOptional: true,
Description: lang.Markdown("Type constraint restricting the type of value to accept, e.g. `string` or `list(string)`"),
},
Expand Down

0 comments on commit f204156

Please sign in to comment.