Closed jeff-hykin closed 3 months ago
These three lines also show inconsistent highlighting of vara
and varb
with local
:
local vara varb=2
local vara=1 varb=2
local vara=1 varb
Original issue is here: https://github.com/microsoft/vscode/issues/177621
I'm the OP for the migrated report above, and here to report that this is still an issue even after installing BSS v1.5.2
.
Another demo of this with arrays:
#!/usr/bin/env bash
function demo () (
local options=(
"$@"
--name='snap'
--cli='snap'
RPM='snapd'
PAMAC='snapd'
ZYPPER_REPO="https://download.opensuse.org/repositories/system:snappy/$(get-opensuse-release 2>/dev/null || :)/"
ZYPPER_REPO_ALIAS='snappy'
ZYPPER='snapd'
)
)
Adding any var before the options array fixes it
#!/usr/bin/env bash
function demo () (
local a options=(
"$@"
--name='snap'
--cli='snap'
RPM='snapd'
PAMAC='snapd'
ZYPPER_REPO="https://download.opensuse.org/repositories/system:snappy/$(get-opensuse-release 2>/dev/null || :)/"
ZYPPER_REPO_ALIAS='snappy'
ZYPPER='snapd'
)
)
While it isn't much, I've posted a $20USD bounty for this: https://app.bountysource.com/issues/123759817-local-highlighting-is-inconsistent
Update: Bountysource is defunct: https://github.com/bountysource/core/issues/1586
Alright this should finally completely fixed on v1.7.1, along with a slew of other things related to variable assignment
Update: Bountysource is defunct: bountysource/core#1586
That is unfortunate, oh well. If you're feelin generous my venmo is https://account.venmo.com/u/Jeff-Hykin @balupton
Still getting the inconsistent formatting of https://github.com/jeff-hykin/better-shell-syntax/issues/56#issuecomment-1662364516 with v1.7.2:
However it seems contextual, as removing everything except those local defines removes the issue. Here is the full code snipper:
#!/usr/bin/env bash
# https://wiki.manjaro.org/index.php/Snap
# https://packages.ubuntu.com/bionic/gnome/gnome-software-plugin-snap
# https://snapcraft.io/docs/installing-snap-on-opensuse
# https://software.opensuse.org/download/package?package=snapd&project=system:snappy
# https://en.opensuse.org/Snap <-- this is the correct info
# https://software.opensuse.org/download/package?package=snapd&project=system:snappy <-- this is not correct
# https://packages.debian.org/sid/amd64/snapd/filelist
# /usr/bin/snap
# /usr/bin/snapctl
# /usr/bin/ubuntu-core-launcher
function setup_util_snap() (
source "$DOROTHY/sources/bash.bash"
# checks
if ! is-linux; then
echo-style --notice="[$0] is only intended to be run on Linux systems, skipping." >/dev/stderr
return 0
fi
# setup
local options=(
--name='snap'
--cli='snap'
"$@"
APT='snapd' # UBUNTU
AUR='snapd' # ARCH
RPM='snapd' # FEDORA
ZYPPER_REPO_ALIAS='snappy'
ZYPPER_REPO="https://download.opensuse.org/repositories/system:snappy/$(get-opensuse-release 2>/dev/null || :)/"
ZYPPER='snapd' # SUSE
)
local a options=(
--name='snap'
--cli='snap'
"$@"
APT='snapd' # UBUNTU
AUR='snapd' # ARCH
RPM='snapd' # FEDORA
ZYPPER_REPO_ALIAS='snappy'
ZYPPER_REPO="https://download.opensuse.org/repositories/system:snappy/$(get-opensuse-release 2>/dev/null || :)/"
ZYPPER='snapd' # SUSE
)
setup-util "${options[@]}"
# if installed, configure
if is-snap; then
# log start
echo-segment --h2='Configure snap'
# ensure snap is discoverable to the system
if test ! -d /snap; then
sudo-helper -- ln -s /var/lib/snapd/snap /snap
fi
# ensure snap service is running
if service-helper --supported; then
service-helper --enable --start -- snapd.socket snapd.apparmor
fi
# install snap support for gnome-software (if it exists)
if command-exists gnome-software; then
# PAMAC='gnome-software-snap' \
# Error: target not found: gnome-software-snap
setup-util --optional --name='Snap via Gnome Software' "$@" \
APT='gnome-software-plugin-snap' # UBUNTU
fi
# log success
echo-segment --g2='Configure snap'
fi
)
# fire if invoked standalone
if test "$0" = "${BASH_SOURCE[0]}"; then
setup_util_snap "$@"
fi
Other than that, really appreciating the other fixes.
That is unfortunate, oh well. If you're feelin generous my venmo is https://account.venmo.com/u/Jeff-Hykin
Venmo seems USA only, is not accepting any of my Australian payment details
Still getting the inconsistent formatting of #56 (comment) with v1.7.2:
Yeah looks like it was passing all my test cases but not much else.
Your example actually revealed some other bugs too like echo-style
being wrong.
Those and a handful of other things should be fixed with v1.8.0
.
The code with a problem is: