Scope hanging bracket content in plan output#100
Open
michaelblyons wants to merge 3 commits intoSublimeText:masterfrom
Open
Scope hanging bracket content in plan output#100michaelblyons wants to merge 3 commits intoSublimeText:masterfrom
michaelblyons wants to merge 3 commits intoSublimeText:masterfrom
Conversation
FichteFoll
reviewed
Mar 1, 2026
Terraform Plan.sublime-syntax
Outdated
Comment on lines
+94
to
+102
| closing-bracket: | ||
| - match: ^(?=\s*\]) | ||
| pop: 1 | ||
| - include: diffs | ||
|
|
||
| closing-brace: | ||
| - match: ^\s*\} | ||
| pop: 1 | ||
| - include: diffs |
Member
There was a problem hiding this comment.
These contexts match more than just what they are named and represent the state the parser is in at the time. Thus, they would be more appropriately named "bracket-body" or "inside-brackets" or similar. (I do not remember which naming convention is currently used in this syntax definition.)
Terraform Plan.sublime-syntax
Outdated
Comment on lines
+104
to
+108
| pop-eol-bracket-deleted: | ||
| - match: \[$\n? | ||
| set: closing-bracket-deleted | ||
| - match: \{$\n? | ||
| set: closing-brace-deleted |
Member
There was a problem hiding this comment.
These contexts do not pop at eol and calling them that would be misleading. Instead, how about bracket-at-eol-deleted, using the naming schema that non-plural versions of a context imply a pop?
Terraform Plan.sublime-syntax
Outdated
| scope: keyword.operator.assignment.terraform | ||
| - match: \(known after apply\)$ | ||
| scope: comment.block.terraform | ||
| - match: \bnull$ |
Member
There was a problem hiding this comment.
Is this EOL anchor really necessary? Seems overly restrictive.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in 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.
It bugs me that the plan output from #51 has hanging bits that don't have, e.g. a
-at BOL below:This PR looks for
{and[at EOL and pairs them to their closing brackets without meta scopes. If opening brackets need detection mid-line, this task is probably impossible.