Previously was working. Seems to be when there is a command separated by a semi-colon on the same line as a function definition with cuddled braces and a quoted parameter expansion with quotes inside.
Example Code:
#!/usr/bin/env sh
# works:
a="${-:+"-$-"}"
# works:
date() {
a="${-:+"-$-"}"
set +x; if [ -n "${a}" ]; then set -x; else set +x; fi
if [ "$(uname)" = "Darwin" ]; then
command date -j "$@"
else
command date "$@"
fi
set +x ${a}
unset a
}
# works:
nulldef; date()
{
a="${-:+"-$-"}"
set +x; if [ -n "${a}" ]; then set -x; else set +x; fi
if [ "$(uname)" = "Darwin" ]; then
command date -j "$@"
else
command date "$@"
fi
set +x ${a}
unset a
}
# does not work:
nulldef; date() {
a="${-:+"-$-"}"
set +x; if [ -n "${a}" ]; then set -x; else set +x; fi
if [ "$(uname)" = "Darwin" ]; then
command date -j "$@"
else
command date "$@"
fi
set +x ${a}
unset a
}
VSCode Version: 1.74.1 better-shell-syntax version: 1.2.9 OS: macOS 12.6
Previously was working. Seems to be when there is a command separated by a semi-colon on the same line as a function definition with cuddled braces and a quoted parameter expansion with quotes inside.
Example Code:
Results:
Expected similar to: