jeff-hykin / better-shell-syntax

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

Dash options split over several lines are parsed as commands #11

Closed AbysmalBiscuit closed 1 year ago

AbysmalBiscuit commented 3 years ago

The grammar for dash options fails to capture options that are passed over several lines using a \. Options are instead captured as commands.

For example, the following -DWITH_SOMEFLAG=ON will be captured as a constant.other.option.shell:

cmake ../project -DWITH_SOMEFLAG=ON
make

Whereas the following -DWITH_SOMEFLAG=ON will be captured as a entity.name.command.shell:

cmake ../project \
  -DWITH_SOMEFLAG=ON
make

As far as I am aware, no shell uses commands prefixed with a dash. There is also a convention of not naming scripts with one or more leading dashes, as dashes are used for flags/options.

Hence, it would make sense to capture things prefixed with a - that are split over several lines using a \ as either one or both of the following:

jeff-hykin commented 1 year ago

should now be fixed on v1.2.5