-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpackage.json
More file actions
397 lines (397 loc) · 16.8 KB
/
package.json
File metadata and controls
397 lines (397 loc) · 16.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
{
"name": "code-blocks",
"publisher": "selfint",
"displayName": "Code Blocks",
"description": "Move code blocks around",
"repository": {
"url": "https://github.com/selfint/code-blocks",
"type": "git"
},
"bugs": {
"url": "https://github.com/selfint/code-blocks/issues",
"email": "selfint@gmail.com"
},
"homepage": "https://github.com/selfint/code-blocks#readme",
"icon": "assets/extension-logo.png",
"galleryBanner": {
"color": "#6295E3",
"theme": "dark"
},
"version": "0.8.1",
"private": true,
"license": "MIT",
"engines": {
"vscode": "^1.105.0"
},
"categories": [
"Visualization",
"Other"
],
"keywords": [
"blocks",
"code-blocks",
"refactor",
"tree-sitter",
"treesitter",
"visualization"
],
"preview": false,
"extensionKind": [
"ui"
],
"activationEvents": [
"onLanguage"
],
"main": "./out/extension.js",
"contributes": {
"customEditors": [
{
"viewType": "codeBlocks.editor",
"displayName": "Code Blocks",
"selector": [
{
"filenamePattern": "*"
}
],
"priority": "option"
}
],
"commands": [
{
"command": "codeBlocks.open",
"title": "Code Blocks: Open active file in Code Blocks editor"
},
{
"command": "codeBlocks.openToTheSide",
"title": "Code Blocks: Open active file in Code Blocks editor to the side"
},
{
"command": "codeBlocks.toggleActive",
"title": "Code Blocks: Toggle extension"
},
{
"command": "codeBlocks.toggleBlockMode",
"title": "Code Blocks: Toggle block mode"
},
{
"command": "codeBlocks.moveUp",
"title": "Code Blocks: Move selected block up"
},
{
"command": "codeBlocks.moveDown",
"title": "Code Blocks: Move selected block down"
},
{
"command": "codeBlocks.navigateUp",
"title": "Code Blocks: Navigate to previous block"
},
{
"command": "codeBlocks.navigateDown",
"title": "Code Blocks: Navigate to next block"
},
{
"command": "codeBlocks.navigateUpForce",
"title": "Code Blocks: Force navigate to previous block"
},
{
"command": "codeBlocks.navigateDownForce",
"title": "Code Blocks: Force navigate to next block"
},
{
"command": "codeBlocks.selectBlock",
"title": "Code Blocks: Select current block"
},
{
"command": "codeBlocks.openTreeViewer",
"title": "Code Blocks: Open tree viewer"
},
{
"command": "codeBlocks.selectParent",
"title": "Code Blocks: Scope selection - parent"
},
{
"command": "codeBlocks.selectChild",
"title": "Code Blocks: Scope selection - child"
},
{
"command": "codeBlocks.selectNext",
"title": "Code Blocks: Scope selection - next"
},
{
"command": "codeBlocks.selectPrevious",
"title": "Code Blocks: Scope selection - previous"
},
{
"command": "codeBlocks.toggleBlockModeColors",
"title": "Code Blocks: Toggle block mode colors"
}
],
"keybindings": [
{
"command": "codeBlocks.moveUp",
"key": "alt+left",
"when": "editorTextFocus && codeBlocks.blockMode"
},
{
"command": "codeBlocks.moveDown",
"key": "alt+right",
"when": "editorTextFocus && codeBlocks.blockMode"
},
{
"command": "codeBlocks.navigateUp",
"key": "ctrl+left",
"mac": "cmd+left",
"when": "editorTextFocus && codeBlocks.blockMode"
},
{
"command": "codeBlocks.navigateDown",
"key": "ctrl+right",
"mac": "cmd+right",
"when": "editorTextFocus && codeBlocks.blockMode"
},
{
"command": "codeBlocks.navigateUpForce",
"key": "ctrl+up",
"mac": "cmd+up",
"when": "editorTextFocus && codeBlocks.blockMode"
},
{
"command": "codeBlocks.navigateDownForce",
"key": "ctrl+down",
"mac": "cmd+down",
"when": "editorTextFocus && codeBlocks.blockMode"
},
{
"command": "codeBlocks.selectNext",
"key": "shift+right",
"mac": "shift+right",
"when": "editorTextFocus && codeBlocks.blockMode"
},
{
"command": "codeBlocks.selectPrevious",
"key": "shift+left",
"mac": "shift+left",
"when": "editorTextFocus && codeBlocks.blockMode"
},
{
"command": "codeBlocks.selectParent",
"key": "shift+up",
"mac": "shift+up",
"when": "editorTextFocus && codeBlocks.blockMode"
},
{
"command": "codeBlocks.selectChild",
"key": "shift+down",
"mac": "shift+down",
"when": "editorTextFocus && codeBlocks.blockMode"
}
],
"configuration": {
"title": "CodeBlocks",
"properties": {
"codeBlocks.colors.enabled": {
"type": "boolean",
"description": "Whether block mode colors are enabled",
"default": false
},
"codeBlocks.colors.sibling": {
"type": "string",
"description": "Background color of current block's siblings. Can be any valid css string.",
"default": "var(--vscode-editor-selectionHighlightBackground)"
},
"codeBlocks.colors.parent": {
"type": "string",
"description": "Background color of current block's parent (only visible if there's no previous or next sibling). Can be any valid css string.",
"default": "var(--vscode-editor-linkedEditingBackground)"
},
"codeBlocks.ignoredLanguageIds": {
"type": "array",
"markdownDescription": "Array of VScode [languageId](https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers)s not to install/load parsers for.",
"default": [
"plaintext",
"Log",
"ignore"
]
},
"codeBlocks.queries": {
"type": "array",
"markdownDescription": "Tree-sitter [queries](https://tree-sitter.github.io/tree-sitter/using-parsers#query-syntax) to generate blocks, must contain a `@capture` (note that the entire match will be a block, not just the capture). Specified per [language ID](https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers), example: `\"[python]\": {\"codeBlocks.queries\": [ \"(class_definition) @item\", \"(function_definition) @item\", \"(decorated_definition) @item\" ]}`",
"editPresentation": "multilineText",
"scope": "language-overridable"
},
"codeBlocks.npmPackageName": {
"markdownDescription": "NPM package name of the tree-sitter grammar to use (defaults to `tree-sitter-<languageId>`). Specified per [language ID](https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers), example: `\"[yaml]\": {\"codeBlocks.npmPackageName\": \"@tree-sitter-grammars/tree-sitter-yaml\"}`.",
"scope": "language-overridable",
"type": [
"string",
"null"
]
},
"codeBlocks.parserName": {
"type": [
"string",
"null"
],
"markdownDescription": "Name to save parser as (defaults to `tree-sitter-<languageID>`). Specified per [language ID](https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers), example: `\"[typescriptreact]\": {\"codeBlocks.parserName\": \"tree-sitter-typescript\"}`.",
"scope": "language-overridable"
},
"codeBlocks.subdirectory": {
"type": [
"string",
"null"
],
"markdownDescription": "Name of the subdirectory containing the tree-sitter grammar inside the npm package (leave empty to use the root directory). Use when an npm package contains multiple grammars. Specified per [language ID](https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers), example: `\"[typescript]\": {\"codeBlocks.subdirectory\": \"typescript\"}`.",
"scope": "language-overridable"
}
}
},
"configurationDefaults": {
"[github-actions-workflow]": {
"codeBlocks.npmPackageName": "@tree-sitter-grammars/tree-sitter-yaml",
"codeBlocks.parserName": "tree-sitter-yaml"
},
"[jsonc]": {
"codeBlocks.npmPackageName": "tree-sitter-json"
},
"[zig]": {
"codeBlocks.npmPackageName": "@tree-sitter-grammars/tree-sitter-zig"
},
"[kotlin]": {
"codeBlocks.npmPackageName": "@tree-sitter-grammars/tree-sitter-kotlin"
},
"[yaml]": {
"codeBlocks.npmPackageName": "@tree-sitter-grammars/tree-sitter-yaml"
},
"[toml]": {
"codeBlocks.npmPackageName": "@tree-sitter-grammars/tree-sitter-toml"
},
"[xml]": {
"codeBlocks.npmPackageName": "@tree-sitter-grammars/tree-sitter-xml",
"codeBlocks.subdirectory": "xml"
},
"[markdown]": {
"codeBlocks.npmPackageName": "@tree-sitter-grammars/tree-sitter-markdown"
},
"[shellscript]": {
"codeBlocks.npmPackageName": "tree-sitter-bash",
"codeBlocks.parserName": "tree-sitter-bash"
},
"[rust]": {
"codeBlocks.queries": [
"(([ (attribute_item) (line_comment) ] @header . [ (attribute_item) (line_comment) ]* @header )? . (function_item) @item)",
"(([ (attribute_item) (line_comment) ] @header . [ (attribute_item) (line_comment) ]* @header )? . (mod_item) @item)",
"(([ (attribute_item) (line_comment) ] @header . [ (attribute_item) (line_comment) ]* @header )? . (struct_item) @item)",
"(([ (attribute_item) (line_comment) ] @header . [ (attribute_item) (line_comment) ]* @header )? . (impl_item) @item)",
"(([ (attribute_item) (line_comment) ] @header . [ (attribute_item) (line_comment) ]* @header )? . (enum_item) @item)",
"(([ (attribute_item) (line_comment) ] @header . [ (attribute_item) (line_comment) ]* @header )? . (field_declaration) @item)",
"(match_arm) @arm"
]
},
"[typescript]": {
"codeBlocks.subdirectory": "typescript",
"codeBlocks.queries": [
"( (comment)* @header . (class_declaration) @item)",
"( (comment)* @header . (method_definition) @item)",
"( (comment)* @header . (function_declaration) @item)",
"( (comment)* @header . (export_statement) @item)"
]
},
"[typescriptreact]": {
"codeBlocks.npmPackageName": "tree-sitter-typescript",
"codeBlocks.parserName": "tree-sitter-typescript",
"codeBlocks.subdirectory": "tsx",
"codeBlocks.queries": [
"( (comment)* @header . (class_declaration) @item)",
"( (comment)* @header . (method_definition) @item)",
"( (comment)* @header . (function_declaration) @item)",
"( (comment)* @header . (export_statement) @item)",
"(jsx_element) @item",
"(jsx_self_closing_element) @item"
]
},
"[javascriptreact]": {
"codeBlocks.npmPackageName": "tree-sitter-javascript",
"codeBlocks.parserName": "tree-sitter-javascript",
"codeBlocks.queries": [
"( (comment)* @header . (class_declaration) @item)",
"( (comment)* @header . (method_definition) @item)",
"( (comment)* @header . (function_declaration) @item)",
"( (comment)* @header . (export_statement) @item)",
"(jsx_element) @item",
"(jsx_self_closing_element) @item"
]
},
"[svelte]": {
"codeBlocks.npmPackageName": "@tree-sitter-grammars/tree-sitter-svelte",
"codeBlocks.queries": [
"( (comment)* @header . (element) @item)",
"( (comment)* @header . (each_statement) @item)",
"( (comment)* @header . (if_statement) @item)",
"( (comment)* @header . (style_element) @item)",
"( (comment)* @header . (script_element) @item)"
]
},
"[python]": {
"codeBlocks.queries": [
"(class_definition) @item",
"(function_definition) @item",
"(decorated_definition) @item"
]
},
"[java]": {
"codeBlocks.queries": [
"( (block_comment)* @header . (class_declaration) @item)",
"( (block_comment)* @header . (method_declaration) @item)"
]
},
"[csharp]": {
"codeBlocks.npmPackageName": "tree-sitter-c-sharp",
"codeBlocks.parserName": "tree-sitter-c_sharp"
},
"[latex]": {
"codeBlocks.npmPackageName": "@pfoerster/tree-sitter-latex"
},
"[sql]": {
"codeBlocks.npmPackageName": "@derekstride/tree-sitter-sql"
}
}
},
"scripts": {
"install:all": "yarn install --frozen-lockfile && cd webview-ui && yarn install --frozen-lockfile",
"start:webview": "cd webview-ui && yarn run dev",
"build:webview": "cd webview-ui && yarn run build && yarn run check",
"vscode:prepublish": "yarn run esbuild-base --minify",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"pretest": "yarn run compile && yarn run lint",
"test": "node ./out/test/runTest.js",
"esbuild-base": "esbuild ./src/extension.ts --bundle --outfile=out/extension.js --external:vscode --external:tree-sitter --format=cjs --platform=node",
"esbuild": "yarn run esbuild-base --sourcemap",
"esbuild-watch": "yarn run esbuild-base --sourcemap --watch",
"lint": "tsc --noEmit && eslint src --ext ts"
},
"devDependencies": {
"@types/chai": "5.2.3",
"@types/glob": "8.1.0",
"@types/mocha": "10.0.10",
"@types/node": "24.9.2",
"@types/tar": "6.1.13",
"@types/vscode": "1.105.0",
"@types/which": "3.0.4",
"@typescript-eslint/eslint-plugin": "8.46.2",
"@typescript-eslint/parser": "8.46.2",
"@vscode/test-electron": "2.5.2",
"chai": "6.2.0",
"esbuild": "0.25.11",
"eslint": "9.38.0",
"glob": "11.0.3",
"mocha": "11.7.4",
"typescript": "5.9.3",
"typescript-eslint": "8.46.2"
},
"dependencies": {
"tar": "7.5.2",
"tree-sitter": "0.25.0",
"which": "5.0.0"
}
}