Skip to content

Commit cb4db87

Browse files
committed
fix: make tree-sitter lookup in .js and .ts files pick up only last preceding comment before code block
1 parent 3c2271a commit cb4db87

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

extensions/vscode/tree-sitter/code-snippet-queries/javascript.scm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
(
2-
(comment)? @comment
2+
(comment)? @comment .
33
(class_declaration
44
name: (_) @name
55
) @definition
66
)
77

88
(
9-
(comment)? @comment
9+
(comment)? @comment .
1010
(function_declaration
1111
name: (_) @name
1212
parameters: (_) @parameters
1313
) @definition
1414
)
1515

1616
(
17-
(comment)? @comment
17+
(comment)? @comment .
1818
(method_definition
1919
name: (_) @name
2020
parameters: (_) @parameters
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
(
2-
(comment)? @comment
2+
(comment)? @comment .
33
(class_declaration
44
name: (_) @name
55
) @definition
66
)
77

88
(
9-
(comment)? @comment
9+
(comment)? @comment .
1010
(function_declaration
1111
name: (_) @name
1212
parameters: (_) @parameters
1313
) @definition
1414
)
1515

1616
(
17-
(comment)? @comment
17+
(comment)? @comment .
1818
(method_definition
1919
name: (_) @name
2020
parameters: (_) @parameters
2121
) @definition
2222
)
2323

2424
(
25-
(comment)? @comment
25+
(comment)? @comment .
2626
(interface_declaration
2727
name: (_) @name) @definition
2828
)

0 commit comments

Comments
 (0)