dracula/vim

Issue with tree-sitter-css

tientrinh21 opened this issue · 5 comments

Problem

Hello, I was trying to use treesitter these day, dracula works fine for me in HTML, JS and TS except CSS (with tree-sitter-css installed). All the class and properties appeared with no highlighting.

What happened

image

What I expected to happen

This is from neovim basic highlighting with css3 syntax plugins ('hail2u/vim-css3-syntax')

image

Machine Info

  • Vim type (vim/gvim/neovim): neovim
  • Vim version: 0.7.2
  • OS: Debian

EDIT: Derek clarified the situation below.

We're going to need more information to be helpful.

What is "tree-sitter-css"? And what highlight groups are applied to the unhighlighted portions? (You can see how to find out here or here, for example.)

Can you share a minimum reproducible example? You might look at How to debug my vimrc for tips on reducing your configuration to the minimum necessary to demonstrate the issue.

Since this is NeoVim, I'll ping @dsifford

Yeah, I'm aware of this. We need someone to go in and take the time/effort to update the tree sitter groups specifically for css.

I've been meaning to get to it, but I so rarely use plain .css that it slips my mind.

PR encouraged if you feel up for it @tientrinh21

Ah, seems I was missing some information. Thanks for clarifying Derek.

Oh, thank you for all of your replies. I guess using another plugin could be a temporary alternative while figuring with tree-sitter groups for CSS.

stnley commented

@dsifford Is the intent to duplicate, as needed, the groups already defined in after/syntax?

Pic below, left side tree-sitter disabled, right side tree-sitter enabled.
1698591528_grimshot

This is after :hi! link @property.css cssProp
1698592158_grimshot

It looks to me like the built-in syntax is more specific than the CSS tree-sitter queries. Pretty much everything is just @property.css. Feels like this is something that requires upstream to improve.