vim icon indicating copy to clipboard operation
vim copied to clipboard

Issue with tree-sitter-css

Open tientrinh21 opened this issue 3 years ago • 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

tientrinh21 avatar Aug 10 '22 14:08 tientrinh21

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

benknoble avatar Aug 10 '22 15:08 benknoble

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

dsifford avatar Aug 10 '22 15:08 dsifford

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

benknoble avatar Aug 10 '22 15:08 benknoble

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.

tientrinh21 avatar Aug 10 '22 16:08 tientrinh21

@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.

stnley avatar Oct 29 '23 15:10 stnley