MaskRay / ccls

C/C++/ObjC language server supporting cross references, hierarchies, completion and semantic highlighting
Apache License 2.0
3.73k stars 254 forks source link

Semantic highlighting: Constructors Treated As Normal Functions Inside Class Body #916

Open anthony-S93 opened 1 year ago

anthony-S93 commented 1 year ago

Observed behavior

The language server's semantic tokenization won't assign the @constructor token to constructors unless they are outside the class' body.

2022-11-09-003507_813x658_scrot

2022-11-09-003619_747x594_scrot

Expected behavior

Correct semantic tokenization of C++ constructors.

Steps to reproduce

  1. Write a class in C++
  2. Write the class' constructor.
  3. Use the TSHighlightCapturesUnderCursor tool to check the syntax highlight groups assigned to the token.

System information

rhcher commented 1 year ago
  1. ccls does not support LSP semantic token.
  2. The highlight provided by treesitter, not by ccls.