zed-industries / extensions

Extensions for the Zed editor
789 stars 322 forks source link

bash shell syntax parsing shows an anomaly #1081

Open lvii opened 1 month ago

lvii commented 1 month ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Hi

When I open https://github.com/sclorg/postgresql-container/blob/master/test/run_test#L34 file, bash shell syntax parsing make the remaining lines of text, display turned into a comment style.

After commented this line test $# -eq 1 -a test "${1-}" == --list && echo "$TEST_LIST" && exit 0, syntax parsing was OK.

Environment

Zed: v0.144.3 (Zed) OS: macOS 14.5.0 Memory: 32 GiB Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

CleanShot 2024-07-18 at 15 13 02@2x CleanShot 2024-07-18 at 15 13 30@2x

If applicable, attach your Zed.log file to this issue.

Zed.log


Zed.log

SomeoneToIgnore commented 1 month ago

Zed uses tree-sitter libraries to parse languages' syntax trees. If you have used a Zed extension (https://github.com/zed-industries/extensions) to highlight these, https://github.com/d1y/bash.zed is most probably the extension in play.

That one uses https://github.com/tree-sitter/tree-sitter-bash and either the extension has to use a newer version of that library, or first, a fix to that library should be done.

I'll move this issue to extensions repo, as Zed itself does nothing special for bash compared with Rust, TypeScript and other languages, and it's the extension or the grammar library that needs changes.

d1y commented 3 weeks ago

I tried updating the upstream of the tree closer, but it doesn't seem to fix it

image

We may need to report this issue upstream

image