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 Nested Map Highlighting #925

Merged
merged 3 commits into from
Feb 9, 2022
Merged

Fix Nested Map Highlighting #925

merged 3 commits into from
Feb 9, 2022

Commits on Feb 8, 2022

  1. Add a base test case for nested maps

    This adds a terraform file containing nested maps and a snapshot
    test capturing the broken highlighting
    dbanck committed Feb 8, 2022
    Configuration menu
    Copy the full SHA
    0a42c25 View commit details
    Browse the repository at this point in the history
  2. fix highlighting of nested maps

    This commit adds `objects` as an include to `objects`. It allows
    deeply nested objects and results in a new `meta.braces.terraform`
    scope for each nested level.
    dbanck committed Feb 8, 2022
    Configuration menu
    Copy the full SHA
    c129399 View commit details
    Browse the repository at this point in the history
  3. further improve highlighting of nested maps

    This changes the scope for object keys from `string.unquoted.terraform`
    to `variable.other.readwrite.terraform`, allowing them to be highlighted
    in line with other variables.
    
    With the update of the `keyword.operator` the `=` inside nested maps is
    also highlighted in line with variable assignments. This change also
    applied to inline for expressions, so we had to extend the pattern
    for matching `=>`.
    
    Matching `=>` here is only a quick-fix. When we improve the detection
    of inline `for` loops, it can be removed.
    dbanck committed Feb 8, 2022
    Configuration menu
    Copy the full SHA
    6b32ed2 View commit details
    Browse the repository at this point in the history