-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for type declarations (for variable type
)
#490
Comments
type
)
So that completion, hover and semantic-tokens work for variable `type`. Related to hashicorp/terraform-ls#490
To support type declarations for variable `type`. Related to hashicorp/terraform-ls#490
So that completion, hover and semantic-tokens work for variable `type`. Related to hashicorp/terraform-ls#490
So that completion, hover and semantic-tokens work for variable `type`. Related to hashicorp/terraform-ls#490
So that completion, hover and semantic-tokens work for variable `type`. Related to hashicorp/terraform-ls#490
So that completion, hover and semantic-tokens work for variable `type`. Related to hashicorp/terraform-ls#490
So that completion, hover and semantic-tokens work for variable `type`. Related to hashicorp/terraform-ls#490
So that completion, hover and semantic-tokens work for variable `type`. Related to hashicorp/terraform-ls#490
So that completion, hover and semantic-tokens work for variable `type`. Related to hashicorp/terraform-ls#490
So that completion, hover and semantic-tokens work for variable `type`. Related to hashicorp/terraform-ls#490
So that completion, hover and semantic-tokens work for variable `type`. Related to hashicorp/terraform-ls#490
So that completion, hover and semantic-tokens work for variable `type`. Related to hashicorp/terraform-ls#490
So that completion, hover and semantic-tokens work for variable `type`. Related to hashicorp/terraform-ls#490
So that completion, hover and semantic-tokens work for variable `type`. Related to hashicorp/terraform-ls#490
So that completion, hover and semantic-tokens work for variable `type`. Related to hashicorp/terraform-ls#490
So that completion, hover and semantic-tokens work for variable `type`. Related to hashicorp/terraform-ls#490
Completion, hover and semantic highlighting for variable Here is a screenshot: Please keep in mind that we do not yet support completion for "nested expressions" which means that you can complete an empty This functionality is tracked under #496 - feel free to upvote and/or subscribe if that is important to you. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Use-cases
Completion
Given a config
when user triggers completion in the highlighted position, they are presented with all available types, e.g.
string
,number
,bool
,object()
etc.Hover
There doesn't seem to be any reasonable use case for hover - we would duplicate (and reformat) the type declaration, or just display "type declaration".
Semantic Tokens
Given a config
all of
string
,list(number)
,object(...)
will be highlighted accordingly by clients which support semantic tokens.Proposal
TypeDeclarationExpr
(implementation ofExprConstraint
) intohcl-lang.schema
to help express whatvariable
'stype
attribute isDecoder
functions:CandidatesAtPos
- so that relevant types are returnedtypeexpr.TypeString
implementation might be helpful for implementing the completion as it will have all the different combinations of types listed thereHoverAtPos
- not sure what useful hover data to return on hover over the type declarations - perhaps just say that it's "type declaration"?SemanticTokensInFile
- so that relevant types are reflected as tokensmap
,list
, orset
can be reported aslang.TokenTypeCapsule
(new)string
,number
,bool
can be reported aslang.TokenTypePrimitive
(new)object()
can be reported aslang.TokenAttrName
TypeDeclaration
in the schema of the variable block withinterraform-schema
, e.g.hcl-lang
interraform-schema
terraform-schema
&hcl-lang
interraform-schema
Notes
Terraform is currently running an experiment with "optional attributes" for object types. The relevant logic is currently only present in Terraform itself, and not
typeexpr
package, and so for simplicity it's better to just ignore that experiment, i.e. avoid completingoptional()
.https://www.terraform.io/docs/language/expressions/type-constraints.html#experimental-optional-object-type-attributes
The text was updated successfully, but these errors were encountered: