Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shell: Combining here string & line continuation breaks bash highlighting #6768

Open
mbs-c opened this issue Mar 22, 2024 · 1 comment
Open

Comments

@mbs-c
Copy link

mbs-c commented Mar 22, 2024

Describe the bug

Bash script highlighting completely breaks for the rest of the file if you use a here string in combination with line continuation:

#!/usr/bin/env bash

# this works (here string)
ssh \
    "foo@bar" \
    "/usr/bin/bash" -sl <<< 'echo "test"'

# this doesn't (here string + line continuation)
ssh \
    "foo@bar" \
    "/usr/bin/bash" -sl <<< \
    'echo "test"'

echo 'now highlighting is completely broken and does not recover for the rest of the file'

Expected behaviour

Here string syntax is recognized and highlighted correctly even when followed by a line continuation.

Additional notes

I read the comment in https://github.com/github-linguist/linguist/blob/master/vendor/README.md, but it's impossible to report this bug in the grammar upstream, since that repository is now archived and unmaintained: https://github.com/atom/language-shellscript

@lildude
Copy link
Member

lildude commented Mar 22, 2024

Unfortunately, the only options are to find a new grammar that doesn't experience this issue or fork the current grammar and fix it yourself and then open a PR to change grammars.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants