fix: make tree-sitter lookup in .js and .ts files pick up only last preceding comment before code block

This commit is contained in:
beDmitry 2025-12-06 09:42:53 -05:00
parent 3c2271aa17
commit cb4db878b8
2 changed files with 7 additions and 7 deletions

View file

@ -1,12 +1,12 @@
(
(comment)? @comment
(comment)? @comment .
(class_declaration
name: (_) @name
) @definition
)
(
(comment)? @comment
(comment)? @comment .
(function_declaration
name: (_) @name
parameters: (_) @parameters
@ -14,7 +14,7 @@
)
(
(comment)? @comment
(comment)? @comment .
(method_definition
name: (_) @name
parameters: (_) @parameters

View file

@ -1,12 +1,12 @@
(
(comment)? @comment
(comment)? @comment .
(class_declaration
name: (_) @name
) @definition
)
(
(comment)? @comment
(comment)? @comment .
(function_declaration
name: (_) @name
parameters: (_) @parameters
@ -14,7 +14,7 @@
)
(
(comment)? @comment
(comment)? @comment .
(method_definition
name: (_) @name
parameters: (_) @parameters
@ -22,7 +22,7 @@
)
(
(comment)? @comment
(comment)? @comment .
(interface_declaration
name: (_) @name) @definition
)