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

Support comment highlighting inside multi-line bracketed expressions #941

Closed
Dennizz opened this issue Feb 21, 2022 · 3 comments · Fixed by hashicorp/syntax#9
Closed

Support comment highlighting inside multi-line bracketed expressions #941

Dennizz opened this issue Feb 21, 2022 · 3 comments · Fixed by hashicorp/syntax#9
Assignees
Labels
bug Something isn't working syntax
Milestone

Comments

@Dennizz
Copy link

Dennizz commented Feb 21, 2022

When spreading a complex expression over multiple lines inside brackets, for better readability, any in-line comments do not get highlighted as such:

image

@Dennizz Dennizz added the bug Something isn't working label Feb 21, 2022
@dbanck dbanck added the syntax label Feb 21, 2022
@dbanck
Copy link
Member

dbanck commented Feb 21, 2022

Thank you for taking the time to report this issue, @Dennizz!

I'm able to reproduce the issue:
CleanShot 2022-02-21 at 14 41 24@2x

Test snippet:

instance_size = (
  length(var.instance_size) > 0 ? (
    var.instance_size #If instance size is provided, use it.
  )
  :
  (var.insane_mode ?
    lookup(local.insane_mode_instance_size_map, local.cloud, null) #If instance size is not provided and var.insane_mode is true, lookup in this table.
    :                                                              #
    lookup(local.instance_size_map, local.cloud, null)             #If instance size is not provided and var.insane_mode is false, lookup in this table.
  )
)

@Dennizz
Copy link
Author

Dennizz commented Feb 21, 2022

Thanks for validating Daniel. Next time I will include a copy able snippet! Apologies for the manual labor.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working syntax
Projects
None yet
3 participants