jeff-hykin / better-shell-syntax

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

Shellscript syntax issues when case clauses are terminated with ;& or ;;& #66

Closed alexr00 closed 9 months ago

alexr00 commented 10 months ago

The code with a problem is:

#!/usr/bin/env bash

case 'yes' in 
    yes)
        echo 'yes'
        ;& # Fall through
    *)
        echo 'default'
        ;;
esac

It looks like:

image

It should look like:

According to the Bash Reference Manual, a case clause must be terminated with ;;, ;&, or ;;&. Currently, the shellscript grammar only supports ;;. Using ;& or ;;& affects the coloring of subsequent comments or clause patterns.

Originally from @rhenescu in https://github.com/microsoft/vscode/issues/192701