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

Fix highlighting of .0, .* attribute access and [*] brackets #44

Merged
merged 7 commits into from
Jun 7, 2022

Conversation

radeksimko
Copy link
Member

@radeksimko radeksimko commented Jun 6, 2022

Fixes #40

After I started looking more closely at the existing tests I realised there is a few more bugs beyond what's described in #40

This fixes handling of the following expressions:

  • legacy numeric indexes (attribute.0)
  • legacy splat syntax (attribute.*)
  • square brackets around splat syntax (attribute[*])

The PR is best reviewed commit-by-commit, especially because I updated some of the test data to make them more accurate, as per #43 (comment)

Before / After

HCL

Terraform

@radeksimko radeksimko added the bug Something isn't working label Jun 6, 2022
@radeksimko radeksimko force-pushed the fix-dot-digit-notation branch from ef03581 to 1bd2804 Compare June 7, 2022 07:49
@radeksimko radeksimko changed the title Fix highlighting of .0 and .* notations Fix highlighting of .0, .* attribute access and [] brackets Jun 7, 2022
@radeksimko radeksimko changed the title Fix highlighting of .0, .* attribute access and [] brackets Fix highlighting of .0, .* attribute access and [*] brackets Jun 7, 2022
@radeksimko radeksimko marked this pull request as ready for review June 7, 2022 08:12
@radeksimko radeksimko requested a review from a team June 7, 2022 08:12
Copy link
Contributor

@jpogran jpogran left a comment

Choose a reason for hiding this comment

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

❤️

@radeksimko radeksimko merged commit 0469fae into main Jun 7, 2022
@radeksimko radeksimko deleted the fix-dot-digit-notation branch June 7, 2022 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad highlighting when resource dot number notation is used in template string
2 participants