milens 0.5.8 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +75 -75
- package/README.md +477 -468
- package/dist/analyzer/resolver.d.ts.map +1 -1
- package/dist/analyzer/resolver.js +79 -16
- package/dist/analyzer/resolver.js.map +1 -1
- package/dist/cli.js +395 -395
- package/dist/parser/extract.d.ts +1 -0
- package/dist/parser/extract.d.ts.map +1 -1
- package/dist/parser/extract.js +74 -2
- package/dist/parser/extract.js.map +1 -1
- package/dist/parser/lang-go.js +34 -34
- package/dist/parser/lang-java.js +29 -29
- package/dist/parser/lang-js.d.ts.map +1 -1
- package/dist/parser/lang-js.js +102 -95
- package/dist/parser/lang-js.js.map +1 -1
- package/dist/parser/lang-php.js +38 -38
- package/dist/parser/lang-py.d.ts.map +1 -1
- package/dist/parser/lang-py.js +32 -31
- package/dist/parser/lang-py.js.map +1 -1
- package/dist/parser/lang-ruby.js +14 -14
- package/dist/parser/lang-rust.js +30 -30
- package/dist/parser/lang-ts.d.ts.map +1 -1
- package/dist/parser/lang-ts.js +153 -146
- package/dist/parser/lang-ts.js.map +1 -1
- package/dist/server/mcp.js +36 -36
- package/dist/skills.js +121 -121
- package/dist/skills.js.map +1 -1
- package/dist/store/db.d.ts.map +1 -1
- package/dist/store/db.js +112 -110
- package/dist/store/db.js.map +1 -1
- package/dist/store/schema.sql +83 -83
- package/package.json +65 -65
package/dist/parser/lang-php.js
CHANGED
|
@@ -5,52 +5,52 @@ const spec = {
|
|
|
5
5
|
extensions: ['.php'],
|
|
6
6
|
wasmName: 'tree-sitter-php',
|
|
7
7
|
queries: {
|
|
8
|
-
functions: `[
|
|
9
|
-
(function_definition name: (name) @name) @def
|
|
10
|
-
(const_declaration (const_element (name) @name)) @def
|
|
8
|
+
functions: `[
|
|
9
|
+
(function_definition name: (name) @name) @def
|
|
10
|
+
(const_declaration (const_element (name) @name)) @def
|
|
11
11
|
]`,
|
|
12
12
|
classes: `(class_declaration name: (name) @name) @def`,
|
|
13
13
|
interfaces: `(interface_declaration name: (name) @name) @def`,
|
|
14
14
|
traits: `(trait_declaration name: (name) @name) @def`,
|
|
15
15
|
enums: `(enum_declaration name: (name) @name) @def`,
|
|
16
16
|
methods: `(method_declaration name: (name) @name) @def`,
|
|
17
|
-
imports: `[
|
|
18
|
-
(namespace_use_declaration
|
|
19
|
-
(namespace_use_clause (qualified_name) @source)
|
|
20
|
-
) @def
|
|
21
|
-
(expression_statement
|
|
22
|
-
(include_expression (string (string_content) @source))
|
|
23
|
-
) @def
|
|
17
|
+
imports: `[
|
|
18
|
+
(namespace_use_declaration
|
|
19
|
+
(namespace_use_clause (qualified_name) @source)
|
|
20
|
+
) @def
|
|
21
|
+
(expression_statement
|
|
22
|
+
(include_expression (string (string_content) @source))
|
|
23
|
+
) @def
|
|
24
24
|
]`,
|
|
25
|
-
calls: `[
|
|
26
|
-
(function_call_expression
|
|
27
|
-
function: (name) @callee
|
|
28
|
-
) @def
|
|
29
|
-
(member_call_expression
|
|
30
|
-
object: (_) @receiver
|
|
31
|
-
name: (name) @callee
|
|
32
|
-
) @def
|
|
33
|
-
(scoped_call_expression
|
|
34
|
-
scope: (name) @receiver
|
|
35
|
-
name: (name) @callee
|
|
36
|
-
) @def
|
|
37
|
-
(object_creation_expression (name) @callee) @def
|
|
25
|
+
calls: `[
|
|
26
|
+
(function_call_expression
|
|
27
|
+
function: (name) @callee
|
|
28
|
+
) @def
|
|
29
|
+
(member_call_expression
|
|
30
|
+
object: (_) @receiver
|
|
31
|
+
name: (name) @callee
|
|
32
|
+
) @def
|
|
33
|
+
(scoped_call_expression
|
|
34
|
+
scope: (name) @receiver
|
|
35
|
+
name: (name) @callee
|
|
36
|
+
) @def
|
|
37
|
+
(object_creation_expression (name) @callee) @def
|
|
38
38
|
]`,
|
|
39
|
-
heritage: `[
|
|
40
|
-
(class_declaration
|
|
41
|
-
name: (name) @child
|
|
42
|
-
(base_clause (name) @parent)
|
|
43
|
-
) @def
|
|
44
|
-
(class_declaration
|
|
45
|
-
name: (name) @child
|
|
46
|
-
(class_interface_clause (name) @parent)
|
|
47
|
-
) @def
|
|
48
|
-
(class_declaration
|
|
49
|
-
name: (name) @child
|
|
50
|
-
body: (declaration_list
|
|
51
|
-
(use_declaration (name) @parent)
|
|
52
|
-
)
|
|
53
|
-
) @def
|
|
39
|
+
heritage: `[
|
|
40
|
+
(class_declaration
|
|
41
|
+
name: (name) @child
|
|
42
|
+
(base_clause (name) @parent)
|
|
43
|
+
) @def
|
|
44
|
+
(class_declaration
|
|
45
|
+
name: (name) @child
|
|
46
|
+
(class_interface_clause (name) @parent)
|
|
47
|
+
) @def
|
|
48
|
+
(class_declaration
|
|
49
|
+
name: (name) @child
|
|
50
|
+
body: (declaration_list
|
|
51
|
+
(use_declaration (name) @parent)
|
|
52
|
+
)
|
|
53
|
+
) @def
|
|
54
54
|
]`,
|
|
55
55
|
},
|
|
56
56
|
resolveImport(raw, _fromFile, root, aliases) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lang-py.d.ts","sourceRoot":"","sources":["../../src/parser/lang-py.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,QAAA,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"lang-py.d.ts","sourceRoot":"","sources":["../../src/parser/lang-py.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,QAAA,MAAM,IAAI,EAAE,QAgEX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
package/dist/parser/lang-py.js
CHANGED
|
@@ -4,45 +4,46 @@ const spec = {
|
|
|
4
4
|
id: 'python',
|
|
5
5
|
extensions: ['.py'],
|
|
6
6
|
wasmName: 'tree-sitter-python',
|
|
7
|
+
allTopLevelExported: true,
|
|
7
8
|
queries: {
|
|
8
|
-
functions: `[
|
|
9
|
-
(module (function_definition name: (identifier) @name) @def)
|
|
10
|
-
(module (decorated_definition definition: (function_definition name: (identifier) @name) @def))
|
|
9
|
+
functions: `[
|
|
10
|
+
(module (function_definition name: (identifier) @name) @def)
|
|
11
|
+
(module (decorated_definition definition: (function_definition name: (identifier) @name) @def))
|
|
11
12
|
]`,
|
|
12
|
-
classes: `[
|
|
13
|
-
(class_definition name: (identifier) @name) @def
|
|
14
|
-
(decorated_definition definition: (class_definition name: (identifier) @name) @def)
|
|
13
|
+
classes: `[
|
|
14
|
+
(class_definition name: (identifier) @name) @def
|
|
15
|
+
(decorated_definition definition: (class_definition name: (identifier) @name) @def)
|
|
15
16
|
]`,
|
|
16
17
|
variables: `(module (expression_statement (assignment left: (identifier) @name))) @def`,
|
|
17
|
-
methods: `[
|
|
18
|
-
(class_definition body: (block (function_definition name: (identifier) @name) @def))
|
|
19
|
-
(class_definition body: (block (decorated_definition definition: (function_definition name: (identifier) @name) @def)))
|
|
18
|
+
methods: `[
|
|
19
|
+
(class_definition body: (block (function_definition name: (identifier) @name) @def))
|
|
20
|
+
(class_definition body: (block (decorated_definition definition: (function_definition name: (identifier) @name) @def)))
|
|
20
21
|
]`,
|
|
21
|
-
imports: `[
|
|
22
|
-
(import_from_statement
|
|
23
|
-
module_name: (dotted_name) @source
|
|
24
|
-
) @def
|
|
25
|
-
(import_statement
|
|
26
|
-
name: (dotted_name) @source
|
|
27
|
-
) @def
|
|
22
|
+
imports: `[
|
|
23
|
+
(import_from_statement
|
|
24
|
+
module_name: (dotted_name) @source
|
|
25
|
+
) @def
|
|
26
|
+
(import_statement
|
|
27
|
+
name: (dotted_name) @source
|
|
28
|
+
) @def
|
|
28
29
|
]`,
|
|
29
|
-
exports: `(module
|
|
30
|
-
(expression_statement
|
|
31
|
-
(assignment
|
|
32
|
-
left: (identifier) @_all
|
|
33
|
-
right: (list (string (string_content) @name))
|
|
34
|
-
)
|
|
35
|
-
)
|
|
30
|
+
exports: `(module
|
|
31
|
+
(expression_statement
|
|
32
|
+
(assignment
|
|
33
|
+
left: (identifier) @_all
|
|
34
|
+
right: (list (string (string_content) @name))
|
|
35
|
+
)
|
|
36
|
+
)
|
|
36
37
|
)`,
|
|
37
|
-
calls: `[
|
|
38
|
-
(call function: (identifier) @callee) @def
|
|
39
|
-
(call function: (attribute object: (_) @receiver attribute: (identifier) @callee)) @def
|
|
40
|
-
(decorator (identifier) @callee) @def
|
|
41
|
-
(decorator (call function: (identifier) @callee)) @def
|
|
38
|
+
calls: `[
|
|
39
|
+
(call function: (identifier) @callee) @def
|
|
40
|
+
(call function: (attribute object: (_) @receiver attribute: (identifier) @callee)) @def
|
|
41
|
+
(decorator (identifier) @callee) @def
|
|
42
|
+
(decorator (call function: (identifier) @callee)) @def
|
|
42
43
|
]`,
|
|
43
|
-
heritage: `(class_definition
|
|
44
|
-
name: (identifier) @child
|
|
45
|
-
superclasses: (argument_list (identifier) @parent)
|
|
44
|
+
heritage: `(class_definition
|
|
45
|
+
name: (identifier) @child
|
|
46
|
+
superclasses: (argument_list (identifier) @parent)
|
|
46
47
|
) @def`,
|
|
47
48
|
},
|
|
48
49
|
resolveImport(raw, fromFile, root, _aliases) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lang-py.js","sourceRoot":"","sources":["../../src/parser/lang-py.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGrC,MAAM,IAAI,GAAa;IACrB,EAAE,EAAE,QAAQ;IACZ,UAAU,EAAE,CAAC,KAAK,CAAC;IACnB,QAAQ,EAAE,oBAAoB;IAC9B,OAAO,EAAE;QACP,SAAS,EAAE;;;MAGT;QACF,OAAO,EAAE;;;MAGP;QACF,SAAS,EAAE,4EAA4E;QACvF,OAAO,EAAE;;;MAGP;QACF,OAAO,EAAE;;;;;;;MAOP;QACF,OAAO,EAAE;;;;;;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E;QACP,SAAS,EAAE;;;MAGT;QACF,OAAO,EAAE;;;MAGP;QACF,SAAS,EAAE,4EAA4E;QACvF,OAAO,EAAE;;;MAGP;QACF,OAAO,EAAE;;;;;;;MAOP;QACF,OAAO,EAAE;;;;;;;MAOP;QACF,KAAK,EAAE;;;;;MAKL;QACF,QAAQ,EAAE;;;WAGH;KACR;IACD,aAAa,CAAC,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ;QACzC,iDAAiD;QACjD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC7B,MAAM,UAAU,GAAG;YACjB,IAAI,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,GAAG,KAAK;YAC5B,IAAI,CAAC,IAAI,EAAE,GAAG,KAAK,EAAE,aAAa,CAAC;SACpC,CAAC;QACF,oCAAoC;QACpC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC3C,UAAU,CAAC,IAAI,CACb,IAAI,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,GAAG,KAAK,EAC/B,IAAI,CAAC,OAAO,EAAE,GAAG,KAAK,EAAE,aAAa,CAAC,CACvC,CAAC;QACF,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;YAC3B,IAAI,UAAU,CAAC,CAAC,CAAC;gBAAE,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAClE,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
package/dist/parser/lang-ruby.js
CHANGED
|
@@ -7,23 +7,23 @@ const spec = {
|
|
|
7
7
|
queries: {
|
|
8
8
|
classes: `(class name: (constant) @name) @def`,
|
|
9
9
|
modules: `(module name: (constant) @name) @def`,
|
|
10
|
-
methods: `[
|
|
11
|
-
(method name: (identifier) @name) @def
|
|
12
|
-
(singleton_method name: (identifier) @name) @def
|
|
10
|
+
methods: `[
|
|
11
|
+
(method name: (identifier) @name) @def
|
|
12
|
+
(singleton_method name: (identifier) @name) @def
|
|
13
13
|
]`,
|
|
14
|
-
imports: `(call
|
|
15
|
-
method: (identifier) @_req
|
|
16
|
-
arguments: (argument_list (string (string_content) @source))
|
|
14
|
+
imports: `(call
|
|
15
|
+
method: (identifier) @_req
|
|
16
|
+
arguments: (argument_list (string (string_content) @source))
|
|
17
17
|
) @def`,
|
|
18
|
-
calls: `[
|
|
19
|
-
(call method: (identifier) @callee) @def
|
|
20
|
-
(call receiver: (_) @receiver method: (identifier) @callee) @def
|
|
18
|
+
calls: `[
|
|
19
|
+
(call method: (identifier) @callee) @def
|
|
20
|
+
(call receiver: (_) @receiver method: (identifier) @callee) @def
|
|
21
21
|
]`,
|
|
22
|
-
heritage: `[
|
|
23
|
-
(class name: (constant) @child superclass: (superclass (constant) @parent)) @def
|
|
24
|
-
(class name: (constant) @child superclass: (superclass (scope_resolution name: (constant) @parent))) @def
|
|
25
|
-
(class name: (constant) @child body: (body_statement (call method: (identifier) @_inc arguments: (argument_list (constant) @parent)))) @def
|
|
26
|
-
(class name: (constant) @child body: (body_statement (call method: (identifier) @_inc arguments: (argument_list (scope_resolution name: (constant) @parent))))) @def
|
|
22
|
+
heritage: `[
|
|
23
|
+
(class name: (constant) @child superclass: (superclass (constant) @parent)) @def
|
|
24
|
+
(class name: (constant) @child superclass: (superclass (scope_resolution name: (constant) @parent))) @def
|
|
25
|
+
(class name: (constant) @child body: (body_statement (call method: (identifier) @_inc arguments: (argument_list (constant) @parent)))) @def
|
|
26
|
+
(class name: (constant) @child body: (body_statement (call method: (identifier) @_inc arguments: (argument_list (scope_resolution name: (constant) @parent))))) @def
|
|
27
27
|
]`,
|
|
28
28
|
},
|
|
29
29
|
resolveImport(raw, fromFile, root, _aliases) {
|
package/dist/parser/lang-rust.js
CHANGED
|
@@ -11,41 +11,41 @@ const spec = {
|
|
|
11
11
|
traits: `(trait_item name: (type_identifier) @name) @def`,
|
|
12
12
|
modules: `(mod_item name: (identifier) @name) @def`,
|
|
13
13
|
types: `(type_item name: (type_identifier) @name) @def`,
|
|
14
|
-
variables: `[
|
|
15
|
-
(const_item name: (identifier) @name) @def
|
|
16
|
-
(static_item name: (identifier) @name) @def
|
|
14
|
+
variables: `[
|
|
15
|
+
(const_item name: (identifier) @name) @def
|
|
16
|
+
(static_item name: (identifier) @name) @def
|
|
17
17
|
]`,
|
|
18
|
-
methods: `(impl_item
|
|
19
|
-
body: (declaration_list
|
|
20
|
-
(function_item name: (identifier) @name) @def
|
|
21
|
-
)
|
|
18
|
+
methods: `(impl_item
|
|
19
|
+
body: (declaration_list
|
|
20
|
+
(function_item name: (identifier) @name) @def
|
|
21
|
+
)
|
|
22
22
|
)`,
|
|
23
|
-
imports: `(use_declaration
|
|
24
|
-
argument: [
|
|
25
|
-
(scoped_identifier) @source
|
|
26
|
-
(use_as_clause path: (scoped_identifier) @source)
|
|
27
|
-
(scoped_use_list path: (scoped_identifier) @source)
|
|
28
|
-
]
|
|
23
|
+
imports: `(use_declaration
|
|
24
|
+
argument: [
|
|
25
|
+
(scoped_identifier) @source
|
|
26
|
+
(use_as_clause path: (scoped_identifier) @source)
|
|
27
|
+
(scoped_use_list path: (scoped_identifier) @source)
|
|
28
|
+
]
|
|
29
29
|
) @def`,
|
|
30
|
-
calls: `[
|
|
31
|
-
(call_expression function: (identifier) @callee) @def
|
|
32
|
-
(call_expression function: (scoped_identifier name: (identifier) @callee)) @def
|
|
33
|
-
(call_expression function: (field_expression value: (_) @receiver field: (field_identifier) @callee)) @def
|
|
34
|
-
(macro_invocation macro: (identifier) @callee) @def
|
|
30
|
+
calls: `[
|
|
31
|
+
(call_expression function: (identifier) @callee) @def
|
|
32
|
+
(call_expression function: (scoped_identifier name: (identifier) @callee)) @def
|
|
33
|
+
(call_expression function: (field_expression value: (_) @receiver field: (field_identifier) @callee)) @def
|
|
34
|
+
(macro_invocation macro: (identifier) @callee) @def
|
|
35
35
|
]`,
|
|
36
|
-
heritage: `(impl_item
|
|
37
|
-
trait: (type_identifier) @parent
|
|
38
|
-
type: (type_identifier) @child
|
|
36
|
+
heritage: `(impl_item
|
|
37
|
+
trait: (type_identifier) @parent
|
|
38
|
+
type: (type_identifier) @child
|
|
39
39
|
) @def`,
|
|
40
|
-
exports: `[
|
|
41
|
-
(function_item (visibility_modifier) name: (identifier) @name) @_def
|
|
42
|
-
(struct_item (visibility_modifier) name: (type_identifier) @name) @_def
|
|
43
|
-
(enum_item (visibility_modifier) name: (type_identifier) @name) @_def
|
|
44
|
-
(trait_item (visibility_modifier) name: (type_identifier) @name) @_def
|
|
45
|
-
(const_item (visibility_modifier) name: (identifier) @name) @_def
|
|
46
|
-
(static_item (visibility_modifier) name: (identifier) @name) @_def
|
|
47
|
-
(type_item (visibility_modifier) name: (type_identifier) @name) @_def
|
|
48
|
-
(mod_item (visibility_modifier) name: (identifier) @name) @_def
|
|
40
|
+
exports: `[
|
|
41
|
+
(function_item (visibility_modifier) name: (identifier) @name) @_def
|
|
42
|
+
(struct_item (visibility_modifier) name: (type_identifier) @name) @_def
|
|
43
|
+
(enum_item (visibility_modifier) name: (type_identifier) @name) @_def
|
|
44
|
+
(trait_item (visibility_modifier) name: (type_identifier) @name) @_def
|
|
45
|
+
(const_item (visibility_modifier) name: (identifier) @name) @_def
|
|
46
|
+
(static_item (visibility_modifier) name: (identifier) @name) @_def
|
|
47
|
+
(type_item (visibility_modifier) name: (type_identifier) @name) @_def
|
|
48
|
+
(mod_item (visibility_modifier) name: (identifier) @name) @_def
|
|
49
49
|
]`,
|
|
50
50
|
},
|
|
51
51
|
resolveImport(raw, _fromFile, root, _aliases) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lang-ts.d.ts","sourceRoot":"","sources":["../../src/parser/lang-ts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,QAAA,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"lang-ts.d.ts","sourceRoot":"","sources":["../../src/parser/lang-ts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,QAAA,MAAM,IAAI,EAAE,QAiNX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
package/dist/parser/lang-ts.js
CHANGED
|
@@ -5,166 +5,173 @@ const spec = {
|
|
|
5
5
|
extensions: ['.ts', '.tsx'],
|
|
6
6
|
wasmName: 'tree-sitter-tsx',
|
|
7
7
|
queries: {
|
|
8
|
-
functions: `[
|
|
9
|
-
(function_declaration name: (identifier) @name) @def
|
|
10
|
-
(generator_function_declaration name: (identifier) @name) @def
|
|
11
|
-
(lexical_declaration
|
|
12
|
-
(variable_declarator
|
|
13
|
-
name: (identifier) @name
|
|
14
|
-
value: (arrow_function)
|
|
15
|
-
)
|
|
16
|
-
) @def
|
|
8
|
+
functions: `[
|
|
9
|
+
(function_declaration name: (identifier) @name) @def
|
|
10
|
+
(generator_function_declaration name: (identifier) @name) @def
|
|
11
|
+
(lexical_declaration
|
|
12
|
+
(variable_declarator
|
|
13
|
+
name: (identifier) @name
|
|
14
|
+
value: (arrow_function)
|
|
15
|
+
)
|
|
16
|
+
) @def
|
|
17
17
|
]`,
|
|
18
18
|
classes: `(class_declaration name: (type_identifier) @name) @def`,
|
|
19
19
|
methods: `(method_definition name: (property_identifier) @name) @def`,
|
|
20
20
|
interfaces: `(interface_declaration name: (type_identifier) @name) @def`,
|
|
21
21
|
enums: `(enum_declaration name: (identifier) @name) @def`,
|
|
22
22
|
types: `(type_alias_declaration name: (type_identifier) @name) @def`,
|
|
23
|
-
|
|
24
|
-
(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
variables: `(program (lexical_declaration
|
|
24
|
+
(variable_declarator name: (identifier) @name)) @def)`,
|
|
25
|
+
imports: `[
|
|
26
|
+
(import_statement
|
|
27
|
+
source: (string (string_fragment) @source)
|
|
28
|
+
) @def
|
|
29
|
+
(call_expression
|
|
30
|
+
function: (import)
|
|
31
|
+
arguments: (arguments (string (string_fragment) @source))
|
|
32
|
+
) @def
|
|
33
|
+
(lexical_declaration
|
|
34
|
+
(variable_declarator
|
|
35
|
+
value: (call_expression
|
|
36
|
+
function: (identifier) @_req
|
|
37
|
+
arguments: (arguments (string (string_fragment) @source))
|
|
38
|
+
)
|
|
39
|
+
)
|
|
40
|
+
) @def
|
|
39
41
|
]`,
|
|
40
|
-
exports: `[
|
|
41
|
-
(export_statement
|
|
42
|
-
declaration: (function_declaration name: (identifier) @name)
|
|
43
|
-
)
|
|
44
|
-
(export_statement
|
|
45
|
-
declaration: (class_declaration name: (type_identifier) @name)
|
|
46
|
-
)
|
|
47
|
-
(export_statement
|
|
48
|
-
declaration: (interface_declaration name: (type_identifier) @name)
|
|
49
|
-
)
|
|
50
|
-
(export_statement
|
|
51
|
-
declaration: (enum_declaration name: (identifier) @name)
|
|
52
|
-
)
|
|
53
|
-
(export_statement
|
|
54
|
-
declaration: (lexical_declaration
|
|
55
|
-
(variable_declarator name: (identifier) @name)
|
|
56
|
-
)
|
|
57
|
-
)
|
|
58
|
-
(export_statement
|
|
59
|
-
(export_clause (export_specifier name: (identifier) @name))
|
|
60
|
-
)
|
|
61
|
-
(export_statement
|
|
62
|
-
declaration: (type_alias_declaration name: (type_identifier) @name)
|
|
63
|
-
)
|
|
64
|
-
(export_statement
|
|
65
|
-
declaration: (generator_function_declaration name: (identifier) @name)
|
|
66
|
-
)
|
|
67
|
-
(export_statement
|
|
68
|
-
value: (identifier) @name
|
|
69
|
-
)
|
|
42
|
+
exports: `[
|
|
43
|
+
(export_statement
|
|
44
|
+
declaration: (function_declaration name: (identifier) @name)
|
|
45
|
+
)
|
|
46
|
+
(export_statement
|
|
47
|
+
declaration: (class_declaration name: (type_identifier) @name)
|
|
48
|
+
)
|
|
49
|
+
(export_statement
|
|
50
|
+
declaration: (interface_declaration name: (type_identifier) @name)
|
|
51
|
+
)
|
|
52
|
+
(export_statement
|
|
53
|
+
declaration: (enum_declaration name: (identifier) @name)
|
|
54
|
+
)
|
|
55
|
+
(export_statement
|
|
56
|
+
declaration: (lexical_declaration
|
|
57
|
+
(variable_declarator name: (identifier) @name)
|
|
58
|
+
)
|
|
59
|
+
)
|
|
60
|
+
(export_statement
|
|
61
|
+
(export_clause (export_specifier name: (identifier) @name))
|
|
62
|
+
)
|
|
63
|
+
(export_statement
|
|
64
|
+
declaration: (type_alias_declaration name: (type_identifier) @name)
|
|
65
|
+
)
|
|
66
|
+
(export_statement
|
|
67
|
+
declaration: (generator_function_declaration name: (identifier) @name)
|
|
68
|
+
)
|
|
69
|
+
(export_statement
|
|
70
|
+
value: (identifier) @name
|
|
71
|
+
)
|
|
70
72
|
]`,
|
|
71
|
-
calls: `[
|
|
72
|
-
(call_expression function: (identifier) @callee) @def
|
|
73
|
-
(call_expression function: (member_expression object: (_) @receiver property: (property_identifier) @callee)) @def
|
|
74
|
-
(new_expression constructor: (identifier) @callee) @def
|
|
75
|
-
(new_expression constructor: (member_expression object: (identifier) @receiver property: (property_identifier) @callee)) @def
|
|
76
|
-
(decorator (identifier) @callee) @def
|
|
77
|
-
(
|
|
78
|
-
(
|
|
79
|
-
(
|
|
80
|
-
(
|
|
73
|
+
calls: `[
|
|
74
|
+
(call_expression function: (identifier) @callee) @def
|
|
75
|
+
(call_expression function: (member_expression object: (_) @receiver property: (property_identifier) @callee)) @def
|
|
76
|
+
(new_expression constructor: (identifier) @callee) @def
|
|
77
|
+
(new_expression constructor: (member_expression object: (identifier) @receiver property: (property_identifier) @callee)) @def
|
|
78
|
+
(decorator (identifier) @callee) @def
|
|
79
|
+
(decorator (call_expression arguments: (arguments (identifier) @callee))) @def
|
|
80
|
+
(decorator (call_expression arguments: (arguments (object (pair value: (identifier) @callee))))) @def
|
|
81
|
+
(decorator (call_expression arguments: (arguments (object (pair value: (array (identifier) @callee)))))) @def
|
|
82
|
+
(decorator (call_expression arguments: (arguments (arrow_function body: (identifier) @callee)))) @def
|
|
83
|
+
(decorator (call_expression arguments: (arguments (object (pair value: (arrow_function body: (identifier) @callee)))))) @def
|
|
84
|
+
(jsx_self_closing_element name: (identifier) @callee) @def
|
|
85
|
+
(jsx_opening_element name: (identifier) @callee) @def
|
|
86
|
+
(jsx_self_closing_element name: (member_expression object: (identifier) @receiver property: (property_identifier) @callee)) @def
|
|
87
|
+
(jsx_opening_element name: (member_expression object: (identifier) @receiver property: (property_identifier) @callee)) @def
|
|
81
88
|
]`,
|
|
82
|
-
heritage: `[
|
|
83
|
-
(class_declaration
|
|
84
|
-
name: (type_identifier) @child
|
|
85
|
-
(class_heritage (extends_clause value: (identifier) @parent))
|
|
86
|
-
) @def
|
|
87
|
-
(class_declaration
|
|
88
|
-
name: (type_identifier) @child
|
|
89
|
-
(class_heritage (implements_clause (type_identifier) @parent))
|
|
90
|
-
) @def
|
|
89
|
+
heritage: `[
|
|
90
|
+
(class_declaration
|
|
91
|
+
name: (type_identifier) @child
|
|
92
|
+
(class_heritage (extends_clause value: (identifier) @parent))
|
|
93
|
+
) @def
|
|
94
|
+
(class_declaration
|
|
95
|
+
name: (type_identifier) @child
|
|
96
|
+
(class_heritage (implements_clause (type_identifier) @parent))
|
|
97
|
+
) @def
|
|
91
98
|
]`,
|
|
92
|
-
reExports: `[
|
|
93
|
-
(export_statement
|
|
94
|
-
source: (string (string_fragment) @source)
|
|
95
|
-
(export_clause (export_specifier name: (identifier) @name))
|
|
96
|
-
) @def
|
|
97
|
-
(export_statement
|
|
98
|
-
source: (string (string_fragment) @source)
|
|
99
|
-
"*"
|
|
100
|
-
) @def
|
|
99
|
+
reExports: `[
|
|
100
|
+
(export_statement
|
|
101
|
+
source: (string (string_fragment) @source)
|
|
102
|
+
(export_clause (export_specifier name: (identifier) @name))
|
|
103
|
+
) @def
|
|
104
|
+
(export_statement
|
|
105
|
+
source: (string (string_fragment) @source)
|
|
106
|
+
"*"
|
|
107
|
+
) @def
|
|
101
108
|
]`,
|
|
102
|
-
typeBindings: `[
|
|
103
|
-
(lexical_declaration
|
|
104
|
-
(variable_declarator
|
|
105
|
-
name: (identifier) @var
|
|
106
|
-
value: (new_expression constructor: (identifier) @type)
|
|
107
|
-
)
|
|
108
|
-
)
|
|
109
|
-
(lexical_declaration
|
|
110
|
-
(variable_declarator
|
|
111
|
-
name: (identifier) @var
|
|
112
|
-
type: (type_annotation (type_identifier) @type)
|
|
113
|
-
)
|
|
114
|
-
)
|
|
115
|
-
(required_parameter
|
|
116
|
-
pattern: (identifier) @var
|
|
117
|
-
type: (type_annotation (type_identifier) @type)
|
|
118
|
-
)
|
|
119
|
-
(public_field_definition
|
|
120
|
-
name: (property_identifier) @var
|
|
121
|
-
type: (type_annotation (type_identifier) @type)
|
|
122
|
-
)
|
|
109
|
+
typeBindings: `[
|
|
110
|
+
(lexical_declaration
|
|
111
|
+
(variable_declarator
|
|
112
|
+
name: (identifier) @var
|
|
113
|
+
value: (new_expression constructor: (identifier) @type)
|
|
114
|
+
)
|
|
115
|
+
)
|
|
116
|
+
(lexical_declaration
|
|
117
|
+
(variable_declarator
|
|
118
|
+
name: (identifier) @var
|
|
119
|
+
type: (type_annotation (type_identifier) @type)
|
|
120
|
+
)
|
|
121
|
+
)
|
|
122
|
+
(required_parameter
|
|
123
|
+
pattern: (identifier) @var
|
|
124
|
+
type: (type_annotation (type_identifier) @type)
|
|
125
|
+
)
|
|
126
|
+
(public_field_definition
|
|
127
|
+
name: (property_identifier) @var
|
|
128
|
+
type: (type_annotation (type_identifier) @type)
|
|
129
|
+
)
|
|
123
130
|
]`,
|
|
124
|
-
assignmentChains: `[
|
|
125
|
-
(lexical_declaration
|
|
126
|
-
(variable_declarator
|
|
127
|
-
name: (identifier) @target
|
|
128
|
-
value: (identifier) @source
|
|
129
|
-
)
|
|
130
|
-
)
|
|
131
|
+
assignmentChains: `[
|
|
132
|
+
(lexical_declaration
|
|
133
|
+
(variable_declarator
|
|
134
|
+
name: (identifier) @target
|
|
135
|
+
value: (identifier) @source
|
|
136
|
+
)
|
|
137
|
+
)
|
|
131
138
|
]`,
|
|
132
|
-
returnTypes: `[
|
|
133
|
-
(function_declaration
|
|
134
|
-
name: (identifier) @name
|
|
135
|
-
return_type: (type_annotation (type_identifier) @returnType)
|
|
136
|
-
)
|
|
137
|
-
(lexical_declaration
|
|
138
|
-
(variable_declarator
|
|
139
|
-
name: (identifier) @name
|
|
140
|
-
value: (arrow_function
|
|
141
|
-
return_type: (type_annotation (type_identifier) @returnType)
|
|
142
|
-
)
|
|
143
|
-
)
|
|
144
|
-
)
|
|
145
|
-
(class_declaration
|
|
146
|
-
name: (type_identifier) @className
|
|
147
|
-
body: (class_body
|
|
148
|
-
(method_definition
|
|
149
|
-
name: (property_identifier) @name
|
|
150
|
-
return_type: (type_annotation (type_identifier) @returnType)
|
|
151
|
-
)
|
|
152
|
-
)
|
|
153
|
-
)
|
|
139
|
+
returnTypes: `[
|
|
140
|
+
(function_declaration
|
|
141
|
+
name: (identifier) @name
|
|
142
|
+
return_type: (type_annotation (type_identifier) @returnType)
|
|
143
|
+
)
|
|
144
|
+
(lexical_declaration
|
|
145
|
+
(variable_declarator
|
|
146
|
+
name: (identifier) @name
|
|
147
|
+
value: (arrow_function
|
|
148
|
+
return_type: (type_annotation (type_identifier) @returnType)
|
|
149
|
+
)
|
|
150
|
+
)
|
|
151
|
+
)
|
|
152
|
+
(class_declaration
|
|
153
|
+
name: (type_identifier) @className
|
|
154
|
+
body: (class_body
|
|
155
|
+
(method_definition
|
|
156
|
+
name: (property_identifier) @name
|
|
157
|
+
return_type: (type_annotation (type_identifier) @returnType)
|
|
158
|
+
)
|
|
159
|
+
)
|
|
160
|
+
)
|
|
154
161
|
]`,
|
|
155
|
-
callResultBindings: `[
|
|
156
|
-
(lexical_declaration
|
|
157
|
-
(variable_declarator
|
|
158
|
-
name: (identifier) @var
|
|
159
|
-
value: (call_expression function: (identifier) @callee)
|
|
160
|
-
)
|
|
161
|
-
)
|
|
162
|
-
(lexical_declaration
|
|
163
|
-
(variable_declarator
|
|
164
|
-
name: (identifier) @var
|
|
165
|
-
value: (call_expression function: (member_expression object: (_) @receiver property: (property_identifier) @callee))
|
|
166
|
-
)
|
|
167
|
-
)
|
|
162
|
+
callResultBindings: `[
|
|
163
|
+
(lexical_declaration
|
|
164
|
+
(variable_declarator
|
|
165
|
+
name: (identifier) @var
|
|
166
|
+
value: (call_expression function: (identifier) @callee)
|
|
167
|
+
)
|
|
168
|
+
)
|
|
169
|
+
(lexical_declaration
|
|
170
|
+
(variable_declarator
|
|
171
|
+
name: (identifier) @var
|
|
172
|
+
value: (call_expression function: (member_expression object: (_) @receiver property: (property_identifier) @callee))
|
|
173
|
+
)
|
|
174
|
+
)
|
|
168
175
|
]`,
|
|
169
176
|
},
|
|
170
177
|
resolveImport(raw, fromFile, root, aliases) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lang-ts.js","sourceRoot":"","sources":["../../src/parser/lang-ts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGrC,MAAM,IAAI,GAAa;IACrB,EAAE,EAAE,YAAY;IAChB,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,iBAAiB;IAC3B,OAAO,EAAE;QACP,SAAS,EAAE;;;;;;;;;MAST;QACF,OAAO,EAAE,wDAAwD;QACjE,OAAO,EAAE,4DAA4D;QACrE,UAAU,EAAE,4DAA4D;QACxE,KAAK,EAAE,kDAAkD;QACzD,KAAK,EAAE,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