I came across this Zed issue recently (51555). The example below is taken directly from that issue.
Parse Bug
Zsh-like globs (line 4 in the following code) produce an incorrect parse tree.
env_loader_loop() {
local -a files
files=("$SRC_CFG_DIR"/*.sh(N))
if ((${#files[@]} == 0)); then
msg --warn "no *.sh files found in '$SRC_CFG_DIR'"
return 0
fi
}
This produces
(program
(function_definition
name: (word)
body: (compound_statement
(declaration_command
(word)
(variable_name))
(variable_assignment
name: (variable_name)
value: (array
(concatenation
(string
(simple_expansion
(variable_name)))
(word)
(ERROR
(word))
(expansion
(subscript
name: (variable_name)
index: (word))))
(word)
(number)))
(ERROR)
(command
name: (command_name
(word)))
(command
name: (command_name
(word))
argument: (word)
argument: (string
(string_content)
(simple_expansion
(variable_name))
(string_content)))
(command
name: (command_name
(word))
argument: (number))
(command
name: (command_name
(word))))))
I totally understand if the devs are reluctant to have this a priority – this is, after all, the bash-compatible parser and not for zsh. I still decided to open this issue because many programs that depend critically on tree-sitter see seriously broken parses in zsh config files and scripts.
I came across this Zed issue recently (51555). The example below is taken directly from that issue.
Parse Bug
Zsh-like globs (line 4 in the following code) produce an incorrect parse tree.
This produces
(program (function_definition name: (word) body: (compound_statement (declaration_command (word) (variable_name)) (variable_assignment name: (variable_name) value: (array (concatenation (string (simple_expansion (variable_name))) (word) (ERROR (word)) (expansion (subscript name: (variable_name) index: (word)))) (word) (number))) (ERROR) (command name: (command_name (word))) (command name: (command_name (word)) argument: (word) argument: (string (string_content) (simple_expansion (variable_name)) (string_content))) (command name: (command_name (word)) argument: (number)) (command name: (command_name (word))))))I totally understand if the devs are reluctant to have this a priority – this is, after all, the bash-compatible parser and not for zsh. I still decided to open this issue because many programs that depend critically on tree-sitter see seriously broken parses in zsh config files and scripts.