@vue/typescript-plugin 3.2.4 → 3.2.5
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 +70 -17
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,28 +1,81 @@
|
|
|
1
|
-
# typescript
|
|
1
|
+
# @vue/typescript-plugin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<p>
|
|
4
|
+
<a href="https://www.npmjs.com/package/@vue/typescript-plugin"><img src="https://img.shields.io/npm/v/@vue/typescript-plugin.svg?labelColor=18181B&color=1584FC" alt="NPM version"></a>
|
|
5
|
+
<a href="https://github.com/vuejs/language-tools/blob/master/LICENSE"><img src="https://img.shields.io/github/license/vuejs/language-tools.svg?labelColor=18181B&color=1584FC" alt="License"></a>
|
|
6
|
+
</p>
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
A TypeScript language service plugin that enables `tsserver` to understand `.vue` files. This plugin is used by `@vue/language-server` to collaborate with the TypeScript language service.
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @vue/typescript-plugin --save-dev
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Configuration
|
|
17
|
+
|
|
18
|
+
### VSCode
|
|
19
|
+
|
|
20
|
+
Create `.vscode/settings.json` in your project root:
|
|
8
21
|
|
|
9
22
|
```json
|
|
10
|
-
|
|
23
|
+
{
|
|
24
|
+
"typescript.tsdk": "node_modules/typescript/lib",
|
|
25
|
+
"typescript.enablePromptUseWorkspaceTsdk": true
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### tsconfig.json
|
|
30
|
+
|
|
31
|
+
```jsonc
|
|
32
|
+
{
|
|
33
|
+
"compilerOptions": {
|
|
11
34
|
"plugins": [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
},
|
|
35
|
+
{ "name": "@vue/typescript-plugin" }
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
19
39
|
```
|
|
20
40
|
|
|
21
|
-
|
|
41
|
+
## Provided Features
|
|
42
|
+
|
|
43
|
+
This plugin registers the following Vue-specific commands for `tsserver`:
|
|
44
|
+
|
|
45
|
+
| Command | Description |
|
|
46
|
+
| :--- | :--- |
|
|
47
|
+
| `_vue:projectInfo` | Get project information |
|
|
48
|
+
| `_vue:collectExtractProps` | Collect extractable props |
|
|
49
|
+
| `_vue:getImportPathForFile` | Get import path for a file |
|
|
50
|
+
| `_vue:getAutoImportSuggestions` | Get auto-import suggestions |
|
|
51
|
+
| `_vue:resolveAutoImportCompletionEntry` | Resolve auto-import completion entry |
|
|
52
|
+
| `_vue:isRefAtPosition` | Check if position is a ref |
|
|
53
|
+
| `_vue:getComponentDirectives` | Get component directives |
|
|
54
|
+
| `_vue:getComponentNames` | Get component name list |
|
|
55
|
+
| `_vue:getComponentMeta` | Get component metadata |
|
|
56
|
+
| `_vue:getComponentSlots` | Get component slots |
|
|
57
|
+
| `_vue:getElementAttrs` | Get element attributes |
|
|
58
|
+
| `_vue:getElementNames` | Get element name list |
|
|
59
|
+
| `_vue:resolveModuleName` | Resolve module name |
|
|
60
|
+
| `_vue:documentHighlights-full` | Document highlights |
|
|
61
|
+
| `_vue:encodedSemanticClassifications-full` | Semantic classifications |
|
|
62
|
+
| `_vue:quickinfo` | Quick info |
|
|
63
|
+
|
|
64
|
+
## How it Works
|
|
65
|
+
|
|
66
|
+
This plugin is created using `createLanguageServicePlugin` from `@volar/typescript`. It:
|
|
67
|
+
|
|
68
|
+
1. Reads `vueCompilerOptions` from `tsconfig.json`
|
|
69
|
+
2. Creates a Vue language plugin to process `.vue` files
|
|
70
|
+
3. Intercepts and handles TypeScript language service requests
|
|
71
|
+
4. Registers Vue-specific protocol handlers
|
|
72
|
+
|
|
73
|
+
## Related Packages
|
|
22
74
|
|
|
23
|
-
|
|
75
|
+
- [`@vue/language-core`](../language-core) - Core module
|
|
76
|
+
- [`@vue/language-server`](../language-server) - Language server
|
|
77
|
+
- [`vue-component-meta`](../component-meta) - Component metadata
|
|
24
78
|
|
|
25
|
-
|
|
79
|
+
## License
|
|
26
80
|
|
|
27
|
-
[
|
|
28
|
-
|
|
81
|
+
[MIT](https://github.com/vuejs/language-tools/blob/master/LICENSE) License
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/typescript-plugin",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"**/*.js",
|
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
"directory": "packages/typescript-plugin"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@volar/typescript": "2.4.
|
|
17
|
-
"@vue/language-core": "3.2.
|
|
16
|
+
"@volar/typescript": "2.4.28",
|
|
17
|
+
"@vue/language-core": "3.2.5",
|
|
18
18
|
"@vue/shared": "^3.5.0",
|
|
19
19
|
"path-browserify": "^1.0.1",
|
|
20
|
-
"vue-component-meta": "3.2.
|
|
20
|
+
"vue-component-meta": "3.2.5"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/node": "^22.10.4",
|
|
24
24
|
"@types/path-browserify": "^1.0.1"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "ee5041d27940cf6f9a5150635d3b13140a9dff54"
|
|
27
27
|
}
|