@codechart/core 0.1.0 → 0.7.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/README.md +8 -3
- package/THIRD_PARTY_NOTICES.md +263 -0
- package/dist/grammars/javascript-tags.scm +99 -0
- package/dist/grammars/python-tags.scm +14 -0
- package/dist/grammars/tree-sitter-bash.wasm +0 -0
- package/dist/grammars/tree-sitter-css.wasm +0 -0
- package/dist/grammars/tree-sitter-html.wasm +0 -0
- package/dist/grammars/tree-sitter-javascript.wasm +0 -0
- package/dist/grammars/tree-sitter-json.wasm +0 -0
- package/dist/grammars/tree-sitter-python.wasm +0 -0
- package/dist/grammars/tree-sitter-sql.wasm +0 -0
- package/dist/grammars/tree-sitter-tsx.wasm +0 -0
- package/dist/grammars/tree-sitter-typescript.wasm +0 -0
- package/dist/grammars/tree-sitter-yaml.wasm +0 -0
- package/dist/grammars/typescript-tags.scm +23 -0
- package/dist/index.d.ts +499 -24
- package/dist/index.js +4270 -259
- package/package.json +15 -3
package/README.md
CHANGED
|
@@ -8,7 +8,12 @@ It is the part both products must agree on:
|
|
|
8
8
|
- **Truth checks** — anchor reading, mention checks and the checks that compare a claim with the code and the git diff; map layout (elkjs).
|
|
9
9
|
- **Git rules** — changed files, log, preview and diff, and which diagram a change should produce.
|
|
10
10
|
- **Review notes** — the note format, parser, merge, carry-over and storage, plus shared page and review file naming.
|
|
11
|
-
- **Config** — the `.codechart.yaml` schema, loader and repo-root lookup.
|
|
11
|
+
- **Config** — the `.codechart.yaml` schema, loader and repo-root lookup, and `writePinned`, which writes the `map.pinned` names sorted by id and leaves the rest of the file as it was.
|
|
12
|
+
- **Code layer** — reads a repo's files, their symbols (classes, functions, methods, types) and their calls with tree-sitter, for TypeScript, JavaScript and Python. `parseRepo` reads a whole repo, `parseCode` one file, and `openCodeIndex` keeps one repo current: a save re-parses only the files whose content hash changed, then re-matches only the code another file's change can reach (reverse indexes for imports and names); a file with a syntax error keeps its last good symbols, and the last good imports and export names its text still names. Imports resolve to repo files (relative paths, tsconfig `paths`, package `exports` and `imports`, npm, yarn and pnpm workspaces mapped to their source) and imported names are followed through barrel files to where they're defined; an import nothing proves is `unknown`, a package outside the repo `external`. A call is `resolved` only when a resolved import or a same-file definition reaches its function; otherwise it is `name-only`. Python imports resolve following CPython's path finder over the project's source roots (`src/` for files under it; `src/` and the project root for the rest); a module found nowhere in the repo is `external`, and in a file that edits `sys.path`, absolute imports of non-stdlib modules are `unknown`. Files without imports get entities and references instead:
|
|
13
|
+
- Entities: SQL `CREATE TABLE`s, the jobs and steps of `.github/workflows` files, docker-compose services, `package.json` scripts, and Bash functions (as symbols).
|
|
14
|
+
- References: the files workflow `run` steps and npm scripts run, Bash `source` and `.`, HTML `<script src>` and `<link href>`, and CSS `@import`.
|
|
15
|
+
- A reference is `resolved` only to a file of the code layer, and only where its folder is fixed: the page or stylesheet's folder, the package folder for npm scripts, the step's working directory after an `actions/checkout` of the repo, or the script's own folder written with `dirname "$0"` or `BASH_SOURCE`. A URL is `external`, and anything else is `unknown`.
|
|
16
|
+
- `createResolver`, `linkImports` and `linkCode` re-resolve without re-parsing.
|
|
12
17
|
- **Agent presets** — the agents codechart knows, their skill folders, and commander-free helpers to install and remove the skill.
|
|
13
18
|
|
|
14
19
|
The CLI owns everything that talks to a user or an agent: commands, terminal and HTML renderers, PR maps, the update check and the OpenCode plugin.
|
|
@@ -20,11 +25,11 @@ Version `0.x`: the API may change between minor versions. The app pins a version
|
|
|
20
25
|
## Usage
|
|
21
26
|
|
|
22
27
|
```ts
|
|
23
|
-
import { validateSpec, checkMapNodes, layoutSpec, loadConfig } from '@codechart/core';
|
|
28
|
+
import { validateSpec, checkMapNodes, layoutSpec, loadConfig, parseRepo, openCodeIndex } from '@codechart/core';
|
|
24
29
|
```
|
|
25
30
|
|
|
26
31
|
Node 22.12 or later, ESM.
|
|
27
32
|
|
|
28
33
|
## Licence
|
|
29
34
|
|
|
30
|
-
MIT. The map layout uses [elkjs](https://github.com/kieler/elkjs) at runtime, under the EPL-2.0 licence; see the notice in the [CLI package](https://github.com/MiscomLab/codechart/blob/main/packages/cli/THIRD_PARTY_NOTICES.md).
|
|
35
|
+
MIT. The map layout uses [elkjs](https://github.com/kieler/elkjs) at runtime, under the EPL-2.0 licence; see the notice in the [CLI package](https://github.com/MiscomLab/codechart/blob/main/packages/cli/THIRD_PARTY_NOTICES.md). The code layer runs [web-tree-sitter](https://github.com/tree-sitter/tree-sitter) and ships the MIT tree-sitter grammars listed in [THIRD_PARTY_NOTICES.md](https://github.com/MiscomLab/codechart/blob/main/packages/core/THIRD_PARTY_NOTICES.md).
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
`dist/grammars/` holds files copied from these tree-sitter grammars: the compiled `.wasm` parsers and, for JavaScript, TypeScript and Python, the `queries/tags.scm` definition queries. `@derekstride/tree-sitter-sql` ships no `.wasm`: `scripts/build-sql-grammar.sh` in the repository compiles it from the published package.
|
|
4
|
+
|
|
5
|
+
## tree-sitter-javascript 0.25.0
|
|
6
|
+
|
|
7
|
+
- Source: <https://github.com/tree-sitter/tree-sitter-javascript>
|
|
8
|
+
- License: MIT
|
|
9
|
+
|
|
10
|
+
```text
|
|
11
|
+
The MIT License (MIT)
|
|
12
|
+
|
|
13
|
+
Copyright (c) 2014 Max Brunsfeld
|
|
14
|
+
|
|
15
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
16
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
17
|
+
in the Software without restriction, including without limitation the rights
|
|
18
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
19
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
20
|
+
furnished to do so, subject to the following conditions:
|
|
21
|
+
|
|
22
|
+
The above copyright notice and this permission notice shall be included in all
|
|
23
|
+
copies or substantial portions of the Software.
|
|
24
|
+
|
|
25
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
26
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
27
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
28
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
29
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
30
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
31
|
+
SOFTWARE.
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## tree-sitter-python 0.25.0
|
|
35
|
+
|
|
36
|
+
- Source: <https://github.com/tree-sitter/tree-sitter-python>
|
|
37
|
+
- License: MIT
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
The MIT License (MIT)
|
|
41
|
+
|
|
42
|
+
Copyright (c) 2016 Max Brunsfeld
|
|
43
|
+
|
|
44
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
45
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
46
|
+
in the Software without restriction, including without limitation the rights
|
|
47
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
48
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
49
|
+
furnished to do so, subject to the following conditions:
|
|
50
|
+
|
|
51
|
+
The above copyright notice and this permission notice shall be included in all
|
|
52
|
+
copies or substantial portions of the Software.
|
|
53
|
+
|
|
54
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
55
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
56
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
57
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
58
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
59
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
60
|
+
SOFTWARE.
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## tree-sitter-typescript 0.23.2
|
|
64
|
+
|
|
65
|
+
- Source: <https://github.com/tree-sitter/tree-sitter-typescript>
|
|
66
|
+
- License: MIT
|
|
67
|
+
|
|
68
|
+
```text
|
|
69
|
+
The MIT License (MIT)
|
|
70
|
+
|
|
71
|
+
Copyright (c) 2017 Max Brunsfeld
|
|
72
|
+
|
|
73
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
74
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
75
|
+
in the Software without restriction, including without limitation the rights
|
|
76
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
77
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
78
|
+
furnished to do so, subject to the following conditions:
|
|
79
|
+
|
|
80
|
+
The above copyright notice and this permission notice shall be included in all
|
|
81
|
+
copies or substantial portions of the Software.
|
|
82
|
+
|
|
83
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
84
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
85
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
86
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
87
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
88
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
89
|
+
SOFTWARE.
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## tree-sitter-html 0.23.2
|
|
93
|
+
|
|
94
|
+
- Source: <https://github.com/tree-sitter/tree-sitter-html>
|
|
95
|
+
- License: MIT
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
The MIT License (MIT)
|
|
99
|
+
|
|
100
|
+
Copyright (c) 2014 Max Brunsfeld
|
|
101
|
+
|
|
102
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
103
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
104
|
+
in the Software without restriction, including without limitation the rights
|
|
105
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
106
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
107
|
+
furnished to do so, subject to the following conditions:
|
|
108
|
+
|
|
109
|
+
The above copyright notice and this permission notice shall be included in all
|
|
110
|
+
copies or substantial portions of the Software.
|
|
111
|
+
|
|
112
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
113
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
114
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
115
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
116
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
117
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
118
|
+
SOFTWARE.
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## tree-sitter-css 0.25.0
|
|
122
|
+
|
|
123
|
+
- Source: <https://github.com/tree-sitter/tree-sitter-css>
|
|
124
|
+
- License: MIT
|
|
125
|
+
|
|
126
|
+
```text
|
|
127
|
+
The MIT License (MIT)
|
|
128
|
+
|
|
129
|
+
Copyright (c) 2018 Max Brunsfeld
|
|
130
|
+
|
|
131
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
132
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
133
|
+
in the Software without restriction, including without limitation the rights
|
|
134
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
135
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
136
|
+
furnished to do so, subject to the following conditions:
|
|
137
|
+
|
|
138
|
+
The above copyright notice and this permission notice shall be included in all
|
|
139
|
+
copies or substantial portions of the Software.
|
|
140
|
+
|
|
141
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
142
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
143
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
144
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
145
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
146
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
147
|
+
SOFTWARE.
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## tree-sitter-bash 0.25.1
|
|
151
|
+
|
|
152
|
+
- Source: <https://github.com/tree-sitter/tree-sitter-bash>
|
|
153
|
+
- License: MIT
|
|
154
|
+
|
|
155
|
+
```text
|
|
156
|
+
The MIT License (MIT)
|
|
157
|
+
|
|
158
|
+
Copyright (c) 2017 Max Brunsfeld
|
|
159
|
+
|
|
160
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
161
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
162
|
+
in the Software without restriction, including without limitation the rights
|
|
163
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
164
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
165
|
+
furnished to do so, subject to the following conditions:
|
|
166
|
+
|
|
167
|
+
The above copyright notice and this permission notice shall be included in all
|
|
168
|
+
copies or substantial portions of the Software.
|
|
169
|
+
|
|
170
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
171
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
172
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
173
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
174
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
175
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
176
|
+
SOFTWARE.
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## tree-sitter-json 0.24.8
|
|
180
|
+
|
|
181
|
+
- Source: <https://github.com/tree-sitter/tree-sitter-json>
|
|
182
|
+
- License: MIT
|
|
183
|
+
|
|
184
|
+
```text
|
|
185
|
+
The MIT License (MIT)
|
|
186
|
+
|
|
187
|
+
Copyright (c) 2014 Max Brunsfeld
|
|
188
|
+
|
|
189
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
190
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
191
|
+
in the Software without restriction, including without limitation the rights
|
|
192
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
193
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
194
|
+
furnished to do so, subject to the following conditions:
|
|
195
|
+
|
|
196
|
+
The above copyright notice and this permission notice shall be included in all
|
|
197
|
+
copies or substantial portions of the Software.
|
|
198
|
+
|
|
199
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
200
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
201
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
202
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
203
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
204
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
205
|
+
SOFTWARE.
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## @tree-sitter-grammars/tree-sitter-yaml 0.7.1
|
|
209
|
+
|
|
210
|
+
- Source: <https://github.com/tree-sitter-grammars/tree-sitter-yaml>
|
|
211
|
+
- License: MIT
|
|
212
|
+
|
|
213
|
+
```text
|
|
214
|
+
Copyright (c) 2024 tree-sitter-grammars contributors
|
|
215
|
+
Copyright (c) 2019-2021 Ika
|
|
216
|
+
|
|
217
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
218
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
219
|
+
in the Software without restriction, including without limitation the rights
|
|
220
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
221
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
222
|
+
furnished to do so, subject to the following conditions:
|
|
223
|
+
|
|
224
|
+
The above copyright notice and this permission notice shall be included in all
|
|
225
|
+
copies or substantial portions of the Software.
|
|
226
|
+
|
|
227
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
228
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
229
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
230
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
231
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
232
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
233
|
+
SOFTWARE.
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## @derekstride/tree-sitter-sql 0.3.13
|
|
237
|
+
|
|
238
|
+
- Source: <https://github.com/DerekStride/tree-sitter-sql>
|
|
239
|
+
- License: MIT
|
|
240
|
+
|
|
241
|
+
```text
|
|
242
|
+
MIT License
|
|
243
|
+
|
|
244
|
+
Copyright (c) 2021 Derek Stride
|
|
245
|
+
|
|
246
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
247
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
248
|
+
in the Software without restriction, including without limitation the rights
|
|
249
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
250
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
251
|
+
furnished to do so, subject to the following conditions:
|
|
252
|
+
|
|
253
|
+
The above copyright notice and this permission notice shall be included in all
|
|
254
|
+
copies or substantial portions of the Software.
|
|
255
|
+
|
|
256
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
257
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
258
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
259
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
260
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
261
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
262
|
+
SOFTWARE.
|
|
263
|
+
```
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
(
|
|
2
|
+
(comment)* @doc
|
|
3
|
+
.
|
|
4
|
+
(method_definition
|
|
5
|
+
name: (property_identifier) @name) @definition.method
|
|
6
|
+
(#not-eq? @name "constructor")
|
|
7
|
+
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
|
8
|
+
(#select-adjacent! @doc @definition.method)
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
(
|
|
12
|
+
(comment)* @doc
|
|
13
|
+
.
|
|
14
|
+
[
|
|
15
|
+
(class
|
|
16
|
+
name: (_) @name)
|
|
17
|
+
(class_declaration
|
|
18
|
+
name: (_) @name)
|
|
19
|
+
] @definition.class
|
|
20
|
+
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
|
21
|
+
(#select-adjacent! @doc @definition.class)
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
(
|
|
25
|
+
(comment)* @doc
|
|
26
|
+
.
|
|
27
|
+
[
|
|
28
|
+
(function_expression
|
|
29
|
+
name: (identifier) @name)
|
|
30
|
+
(function_declaration
|
|
31
|
+
name: (identifier) @name)
|
|
32
|
+
(generator_function
|
|
33
|
+
name: (identifier) @name)
|
|
34
|
+
(generator_function_declaration
|
|
35
|
+
name: (identifier) @name)
|
|
36
|
+
] @definition.function
|
|
37
|
+
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
|
38
|
+
(#select-adjacent! @doc @definition.function)
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
(
|
|
42
|
+
(comment)* @doc
|
|
43
|
+
.
|
|
44
|
+
(lexical_declaration
|
|
45
|
+
(variable_declarator
|
|
46
|
+
name: (identifier) @name
|
|
47
|
+
value: [(arrow_function) (function_expression)]) @definition.function)
|
|
48
|
+
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
|
49
|
+
(#select-adjacent! @doc @definition.function)
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
(
|
|
53
|
+
(comment)* @doc
|
|
54
|
+
.
|
|
55
|
+
(variable_declaration
|
|
56
|
+
(variable_declarator
|
|
57
|
+
name: (identifier) @name
|
|
58
|
+
value: [(arrow_function) (function_expression)]) @definition.function)
|
|
59
|
+
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
|
60
|
+
(#select-adjacent! @doc @definition.function)
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
(assignment_expression
|
|
64
|
+
left: [
|
|
65
|
+
(identifier) @name
|
|
66
|
+
(member_expression
|
|
67
|
+
property: (property_identifier) @name)
|
|
68
|
+
]
|
|
69
|
+
right: [(arrow_function) (function_expression)]
|
|
70
|
+
) @definition.function
|
|
71
|
+
|
|
72
|
+
(pair
|
|
73
|
+
key: (property_identifier) @name
|
|
74
|
+
value: [(arrow_function) (function_expression)]) @definition.function
|
|
75
|
+
|
|
76
|
+
(
|
|
77
|
+
(call_expression
|
|
78
|
+
function: (identifier) @name) @reference.call
|
|
79
|
+
(#not-match? @name "^(require)$")
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
(call_expression
|
|
83
|
+
function: (member_expression
|
|
84
|
+
property: (property_identifier) @name)
|
|
85
|
+
arguments: (_) @reference.call)
|
|
86
|
+
|
|
87
|
+
(new_expression
|
|
88
|
+
constructor: (_) @name) @reference.class
|
|
89
|
+
|
|
90
|
+
(export_statement value: (assignment_expression left: (identifier) @name right: ([
|
|
91
|
+
(number)
|
|
92
|
+
(string)
|
|
93
|
+
(identifier)
|
|
94
|
+
(undefined)
|
|
95
|
+
(null)
|
|
96
|
+
(new_expression)
|
|
97
|
+
(binary_expression)
|
|
98
|
+
(call_expression)
|
|
99
|
+
]))) @definition.constant
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
(module (expression_statement (assignment left: (identifier) @name) @definition.constant))
|
|
2
|
+
|
|
3
|
+
(class_definition
|
|
4
|
+
name: (identifier) @name) @definition.class
|
|
5
|
+
|
|
6
|
+
(function_definition
|
|
7
|
+
name: (identifier) @name) @definition.function
|
|
8
|
+
|
|
9
|
+
(call
|
|
10
|
+
function: [
|
|
11
|
+
(identifier) @name
|
|
12
|
+
(attribute
|
|
13
|
+
attribute: (identifier) @name)
|
|
14
|
+
]) @reference.call
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
(function_signature
|
|
2
|
+
name: (identifier) @name) @definition.function
|
|
3
|
+
|
|
4
|
+
(method_signature
|
|
5
|
+
name: (property_identifier) @name) @definition.method
|
|
6
|
+
|
|
7
|
+
(abstract_method_signature
|
|
8
|
+
name: (property_identifier) @name) @definition.method
|
|
9
|
+
|
|
10
|
+
(abstract_class_declaration
|
|
11
|
+
name: (type_identifier) @name) @definition.class
|
|
12
|
+
|
|
13
|
+
(module
|
|
14
|
+
name: (identifier) @name) @definition.module
|
|
15
|
+
|
|
16
|
+
(interface_declaration
|
|
17
|
+
name: (type_identifier) @name) @definition.interface
|
|
18
|
+
|
|
19
|
+
(type_annotation
|
|
20
|
+
(type_identifier) @name) @reference.type
|
|
21
|
+
|
|
22
|
+
(new_expression
|
|
23
|
+
constructor: (identifier) @name) @reference.class
|