Skip to content
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

Add type declarations for variable type #47

Merged
merged 1 commit into from
Jun 9, 2021

Conversation

beandrad
Copy link
Contributor

@beandrad beandrad commented Jun 7, 2021

So that completion, hover and semantic-tokens work for variable type.

Related to hashicorp/terraform-ls#490

Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good start.

Aside from my in-line comments, I think this new expression type will also need to be reflected in SemanticTokensInFile so that we can highlight the types semantically. Relatedly we'll also need to introduce new token types for this purpose, as mentioned in hashicorp/terraform-ls#490

func (d *Decoder) tokensForExpression(expr hclsyntax.Expression, constraints ExprConstraints) []lang.SemanticToken {

decoder/expression_candidates.go Outdated Show resolved Hide resolved
decoder/hover.go Show resolved Hide resolved
@beandrad beandrad force-pushed the ia.type-declaration branch 2 times, most recently from c4706f8 to 5623ecf Compare June 9, 2021 08:46
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM aside from that one minor in-line comment.

Thank you for making those changes.

decoder/semantic_tokens.go Outdated Show resolved Hide resolved
So that completion, hover and semantic-tokens work for variable `type`.

Related to hashicorp/terraform-ls#490
@beandrad beandrad force-pushed the ia.type-declaration branch from 5623ecf to d2a9b30 Compare June 9, 2021 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants