jeff-hykin / better-shell-syntax

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

Support for Fish functions #78

Closed alexr00 closed 3 months ago

alexr00 commented 4 months ago

The code with a problem is:

alias gswr='git switch -r'
alias gsws='git switch -s'

function sim
    if test $argv[1] = '--help'
        npm run p -- --help
    else
        make ls; and npm run p -- $argv
    end
end

set -x PATH /Users/ulugbekna/.dotnet $PATH

It looks like:

Image

It should look like:

The meta.function.shell scope continues past both of the ends, and at least one of those should cause it to exit.

@jeff-hykin., Do you consider Fish to be supported by Better Shell Syntax? The syntax of Fish is different enough that I'm unsure what the expectation is! We added .fish to the list of file extensions about a year and a half ago, but that might have been incorrect.

Originally from @ulugbekna in https://github.com/microsoft/vscode/issues/206952.

jeff-hykin commented 3 months ago

My official position is; as long as POSIX shell code is parsed correctly, then extra stuff can be added on. While bash/zsh are not POSIX, I think effectly all of their syntax is.

Fish is very not POSIX, but it might still be possible to support the syntax. I'm not sure.

This particular case I think can be supported, but in the future a fork might be needed to support fish.

jeff-hykin commented 3 months ago

This particular case is fixed. Maybe later I'll open up an issue that covers all shell-syntax-conflicts