-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: return an ExprSyntaxError
for invalid references that end in a dot
#692
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ansgarm
changed the title
feat: return an ExprSyntaxError for invalid references that end in a dot (commonly occurs in editors for completions)
feat: return an ExprSyntaxError for invalid references that end in a dot
Aug 21, 2024
ansgarm
changed the title
feat: return an ExprSyntaxError for invalid references that end in a dot
feat: return an Aug 21, 2024
ExprSyntaxError
for invalid references that end in a dot
ansgarm
force-pushed
the
support-incomplete-references-in-object-items
branch
from
August 21, 2024 13:35
1961bbe
to
d196382
Compare
cam72cam
reviewed
Aug 21, 2024
…dot (commonly occurs in editors for completions) Detect value expressions of the ExprSyntaxError type when parsing object constructor expressions and use them to add an item to the result even though we skip parsing the object due to recovery after the invalid expression. This allows the Terraform language server to support completions for object attributes after a dot was typed.
ansgarm
force-pushed
the
support-incomplete-references-in-object-items
branch
from
August 21, 2024 13:39
d196382
to
117baa8
Compare
radeksimko
approved these changes
Aug 21, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks reasonable to me! 👍🏻
ansgarm
added a commit
to hashicorp/hcl-lang
that referenced
this pull request
Aug 21, 2024
Previously it was required to type a first character as the hclsyntax parser wouldn't return anything for these invalid references. This requires hashicorp/hcl#692 to work
liamcervante
approved these changes
Aug 22, 2024
Merged
ansgarm
added a commit
to hashicorp/hcl-lang
that referenced
this pull request
Aug 22, 2024
Previously it was required to type a first character as the hclsyntax parser wouldn't return anything for these invalid references. This requires hashicorp/hcl#692 to work
ansgarm
added a commit
to hashicorp/hcl-lang
that referenced
this pull request
Aug 22, 2024
Previously it was required to type a first character as the hclsyntax parser wouldn't return anything for these invalid references. This requires hashicorp/hcl#692 to work
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Return an
ExprSyntaxError
for invalid references that end in a dot (commonly occurs in editors for completions).Detect value expressions of the
ExprSyntaxError
type when parsing object constructor expressions and use them to add an item to the result even though we skip parsing the object due to recovery after the invalid expression.This allows the Terraform language server to support completions for object attributes after a dot was typed.