jeff-hykin / better-shell-syntax

💾 📦 ♻️ An improvement to the shell syntax for VS Code
MIT License
52 stars 4 forks source link

For loop with braces inside command substitution breaks syntax highlighting #31

Closed yusufaktepe closed 8 months ago

yusufaktepe commented 1 year ago

Here is an example snippet:

A=$(
    for ((i=0; i<${#ID[@]}; i++)); {
       do_something
    }
)

These are fine:

A=$(
    for ((i=0; i<${#ID[@]}; i++)); do
        do_something
    done
)
A=$(\
    for ((i=0; i<${#ID[@]}; i++)); {
        do_something
    }
)
jeff-hykin commented 1 year ago

This has to do with a legacy version of the for pattern that I haven't converted yet (someone else originally wrote it) so it might take me a bit to get to.

Sadly your last example is actually a problem of its own (for is recognized as a command instead of a keyword) so I'll add that to this issue

jeff-hykin commented 8 months ago

fixed! v1.7.0