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

YAML syntax highlighting after a #shell block breaks down due to for loop #15

Open
sazima1 opened this issue Apr 5, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@sazima1
Copy link

sazima1 commented Apr 5, 2024

When you use the # shell syntax highlighting, the rest of the YAML syntax highlighting will break down after you use for i in {1..60}; do. It is specifically the curly braces and first number specifying a sequence {1..60}. If you comment out the whole embedded code block, then start to type the line, it will break the YAML formatting right after you type "in {1". If you use the other for loop syntax for ((i = 0 ; i < 10 ; i++ )); do, the formatting is fine.

@tidharm
Copy link

tidharm commented Jun 27, 2024

This also happens when using heredoc to create a file:

- name: Setup Config Files
  run: | # shell
    echo "Setup Config Files"
    
    config_file_content=$(cat <<-EOF
    key1=value1
    key2=value2
    
    EOF
    )
    
    echo "$config_file_content" > config.ini

The syntax highlighting appears to break from the opening parenthesis of the $(cat <<-EOF bit.
image

Before it, proper highlighting looks like this:
image

After that, the rest of the yaml steps appear as inline strings and GH variables' braces appear as inner braces (purple rather than yellow):
image

@sazima1 did you find any workaround for this?

@sazima1
Copy link
Author

sazima1 commented Jul 2, 2024

@tidharm, no I have not found a workaround, sadly.

@harrydowning harrydowning added the bug Something isn't working label Sep 12, 2024
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

No branches or pull requests

3 participants