Add class tags

This commit is contained in:
Bruno BELANYI 2022-06-04 21:50:45 +02:00
parent 746c8d27b8
commit c9efe870ab
2 changed files with 22 additions and 0 deletions

View file

@ -8,6 +8,19 @@
function: (identifier) @name) @reference.call function: (identifier) @name) @reference.call
; }}} ; }}}
; Class {{{
(class_declaration
name: (identifier) @name) @definition.class
(type_declaration
name: (identifier) @name
(class_type)) @definition.class
(new_expression
class: (type_identifier) @name) @reference.class
(extends_qualifier
super: (type_identifier) @name) @reference.class
; }}}
; Methods {{{ ; Methods {{{
(method_declaration (method_declaration
name: (identifier) @name) @definition.method name: (identifier) @name) @definition.method

9
test/tags/classes.tig Normal file
View file

@ -0,0 +1,9 @@
class A {}
/* ^ definition.class */
type B = class extends A {}
/* ^ definition.class */
/* ^ reference.class */
var object := new B
/* ^ reference.class */