sainnhe / sonokai

High Contrast & Vivid Color Scheme based on Monokai Pro
MIT License
1.65k stars 119 forks source link

Questions: Better way to highlight variable with {} in shell script #91

Closed huyhoang8398 closed 1 year ago

huyhoang8398 commented 1 year ago

image

Is this possible to have a better highlight with treesitter for variable quoted by {} in shell script?

antoineco commented 1 year ago

I'm afraid not, because Tree-sitter applies a different capture group whether the variable is between brackets or not:

image

When the variable is not surrounded with brackets, the capture group is @punctuation.special.bash:

image

However, when the variable is surrounded with brackets, the capture group is @punctuation.bracket.bash:

image

That is something which can only be tackled in the Tree-sitter parser, not the colorscheme.