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

broken high lighting #151

Closed
palandovalex opened this issue Mar 8, 2023 · 5 comments · Fixed by #186
Closed

broken high lighting #151

palandovalex opened this issue Mar 8, 2023 · 5 comments · Fixed by #186

Comments

@palandovalex
Copy link

Problem description
Just see this code fragment:

Снимок экрана от 2023-03-07 18-31-10

Affected language servers

bash

Steps to reproduce

use such bash code fragment, and you will see it

case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

Actual behavior

syntax highlighting breaks down on the case language construct

Expected behavior

normal highlighting, NOT WORSE THAN WITH pure neovim!

@carter-canedy
Copy link

carter-canedy commented Mar 8, 2023

I second this, that interpolation snippet breaks the highlighting for any trailing lines in my .bashrc file. I can't imagine this being a super common snippet, but it should be fixed.

@verhovsky
Copy link
Collaborator

verhovsky commented Mar 8, 2023

Pasting this into https://tree-sitter.github.io/tree-sitter/playground it's parsed correctly, so it seems like this has been fixed on master but not released yet, just like #148

@carter-canedy
Copy link

I don't know what you mean by correctly. If you look at the tree that was generated, it produces an error at the expansion
image

@carter-canedy
Copy link

This is the result of the parser error in nvim:
image

@Exlll
Copy link

Exlll commented Jun 16, 2023

This seems to be caused by the ( and ) after the + in that line. If I remove the braces (or replace them with square brackets), the rest is highlighted correctly, e.g.:

# PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" 
PS1="\[\e]0;${debian_chroot:+$debian_chroot}\u@\h: \w\a\]$PS1"

@amaanq amaanq mentioned this issue Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants