Skip to content

Commit 06166e2

Browse files
KazariEXkermanx
andauthored
refactor(vscode): rewrite with reactive-vscode (#4945)
Co-authored-by: _Kerman <[email protected]>
1 parent 21a0b30 commit 06166e2

14 files changed

+905
-743
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ node_modules
66
.vscode-test-web
77
extensions/*/meta.json
88
extensions/*/stats.html
9+
extensions/vscode/src/generated-meta.ts
910

1011
packages/*/*.d.ts
1112
packages/*/*.js

extensions/vscode/README.md

+48
Original file line numberDiff line numberDiff line change
@@ -254,3 +254,51 @@ Finally you need to make VS Code recognize your new extension and automatically
254254
- [angular](https://github.com/angular/angular) shows how TS server plugin working with language service.
255255
- Syntax highlight is rewritten base on [vue-syntax-highlight](https://github.com/vuejs/vue-syntax-highlight).
256256
- [vscode-fenced-code-block-grammar-injection-example](https://github.com/mjbvz/vscode-fenced-code-block-grammar-injection-example) shows how to inject vue syntax highlight to markdown.
257+
258+
## Commands
259+
260+
<!-- commands -->
261+
262+
| Command | Title |
263+
| ------------------------------ | ------------------------------------------------- |
264+
| `vue.action.restartServer` | Vue: Restart Vue and TS servers |
265+
| `vue.action.doctor` | Vue: Doctor |
266+
| `vue.action.writeVirtualFiles` | Vue (Debug): Write Virtual Files |
267+
| `vue.action.splitEditors` | Vue: Split <script>, <template>, <style> Editors |
268+
| `vue.findAllFileReferences` | Vue: Find File References via Vue Language Server |
269+
270+
<!-- commands -->
271+
272+
## Configs
273+
274+
<!-- configs -->
275+
276+
| Key | Description | Type | Default |
277+
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------- | ----------------------------------- |
278+
| `vue.trace.server` | Traces the communication between VS Code and the language server. | `string` | `"off"` |
279+
| `vue.server.hybridMode` | Vue language server only handles CSS and HTML language support, and tsserver takes over TS language support via TS plugin. | `boolean,string` | `"auto"` |
280+
| `vue.server.includeLanguages` | | `array` | `["vue"]` |
281+
| `vue.server.maxOldSpaceSize` | Set --max-old-space-size option on server process. If you have problem on frequently "Request textDocument/** failed." error, try setting higher memory(MB) on it. | `number,null` | `null` |
282+
| `vue.doctor.status` | Show known problems in status bar. | `boolean` | `true` |
283+
| `vue.splitEditors.icon` | Show split editor icon in title area of editor. | `boolean` | `false` |
284+
| `vue.splitEditors.layout.left` | | `array` | `["script","scriptSetup","styles"]` |
285+
| `vue.splitEditors.layout.right` | | `array` | `["template","customBlocks"]` |
286+
| `vue.updateImportsOnFileMove.enabled` | Enabled update imports on file move. | `boolean` | `true` |
287+
| `vue.codeActions.enabled` | Enabled code actions. | `boolean` | `true` |
288+
| `vue.codeActions.askNewComponentName` | Ask for new component name when extract component. | `boolean` | `true` |
289+
| `vue.codeLens.enabled` | Enabled code lens. | `boolean` | `true` |
290+
| `vue.complete.casing.tags` | Preferred tag name case. | `string` | `"autoPascal"` |
291+
| `vue.complete.casing.props` | Preferred attr name case. | `string` | `"autoKebab"` |
292+
| `vue.autoInsert.dotValue` | Auto-complete Ref value with `.value`. | `boolean` | `false` |
293+
| `vue.autoInsert.bracketSpacing` | Auto add space between double curly brackets: {{|}} -> {{ | }} | `boolean` | `true` |
294+
| `vue.inlayHints.destructuredProps` | Show inlay hints for destructured props. | `boolean` | `false` |
295+
| `vue.inlayHints.missingProps` | Show inlay hints for missing required props. | `boolean` | `false` |
296+
| `vue.inlayHints.inlineHandlerLeading` | Show inlay hints for event argument in inline handlers. | `boolean` | `false` |
297+
| `vue.inlayHints.optionsWrapper` | Show inlay hints for component options wrapper for type support. | `boolean` | `false` |
298+
| `vue.inlayHints.vBindShorthand` | Show inlay hints for v-bind shorthand. | `boolean` | `false` |
299+
| `vue.format.template.initialIndent` | | `boolean` | `true` |
300+
| `vue.format.style.initialIndent` | | `boolean` | `false` |
301+
| `vue.format.script.initialIndent` | | `boolean` | `false` |
302+
| `vue.format.wrapAttributes` | | `string` | `"auto"` |
303+
304+
<!-- configs -->

extensions/vscode/package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -538,15 +538,16 @@
538538
]
539539
},
540540
"scripts": {
541-
"prebuild": "cd ../.. && pnpm run build",
541+
"prebuild": "pnpm run postinstall && pnpm -C ../.. run build",
542542
"build": "node scripts/build",
543543
"build:minify": "pnpm run build -- --minify",
544544
"watch": "pnpm run build -- --watch",
545545
"pack": "pnpm run build:minify && vsce package",
546546
"pack:next": "pnpm run build && vsce package",
547547
"release": "pnpm run build:minify && vsce publish",
548548
"release:next": "pnpm run build && vsce publish --pre-release",
549-
"size": "pnpm run build:minify -- --metafile && esbuild-visualizer --metadata ./meta.json && open ./stats.html"
549+
"size": "pnpm run build:minify -- --metafile && esbuild-visualizer --metadata ./meta.json && open ./stats.html",
550+
"postinstall": "vscode-ext-gen --scope vue"
550551
},
551552
"devDependencies": {
552553
"@types/semver": "^7.5.3",
@@ -559,7 +560,9 @@
559560
"esbuild": "~0.21.0",
560561
"esbuild-plugin-copy": "latest",
561562
"esbuild-visualizer": "latest",
563+
"reactive-vscode": "0.2.7-beta.1",
562564
"semver": "^7.5.4",
565+
"vscode-ext-gen": "^0.5.0",
563566
"vscode-tmlanguage-snapshot": "latest"
564567
}
565568
}

0 commit comments

Comments
 (0)