mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 04:11:10 -05:00
66 lines
1.4 KiB
TypeScript
66 lines
1.4 KiB
TypeScript
/*
|
|
- class definitions
|
|
- method definitions
|
|
- named function declarations
|
|
- arrow functions and function expressions assigned to variables
|
|
*/
|
|
export default `
|
|
(
|
|
(comment)* @doc
|
|
.
|
|
(method_definition
|
|
name: (property_identifier) @name) @definition.method
|
|
(#not-eq? @name "constructor")
|
|
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
|
(#select-adjacent! @doc @definition.method)
|
|
)
|
|
|
|
(
|
|
(comment)* @doc
|
|
.
|
|
[
|
|
(class
|
|
name: (_) @name)
|
|
(class_declaration
|
|
name: (_) @name)
|
|
] @definition.class
|
|
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
|
(#select-adjacent! @doc @definition.class)
|
|
)
|
|
|
|
(
|
|
(comment)* @doc
|
|
.
|
|
[
|
|
(function_declaration
|
|
name: (identifier) @name)
|
|
(generator_function_declaration
|
|
name: (identifier) @name)
|
|
] @definition.function
|
|
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
|
(#select-adjacent! @doc @definition.function)
|
|
)
|
|
|
|
(
|
|
(comment)* @doc
|
|
.
|
|
(lexical_declaration
|
|
(variable_declarator
|
|
name: (identifier) @name
|
|
value: [(arrow_function) (function_expression)]) @definition.function)
|
|
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
|
(#select-adjacent! @doc @definition.function)
|
|
)
|
|
|
|
(
|
|
(comment)* @doc
|
|
.
|
|
(variable_declaration
|
|
(variable_declarator
|
|
name: (identifier) @name
|
|
value: [(arrow_function) (function_expression)]) @definition.function)
|
|
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
|
(#select-adjacent! @doc @definition.function)
|
|
)
|
|
`
|