@vue/typescript-plugin 3.2.3 → 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.
Files changed (2) hide show
  1. package/README.md +70 -17
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -1,28 +1,81 @@
1
- # typescript plugin
1
+ # @vue/typescript-plugin
2
2
 
3
- This is a plug-in for `tsserver` or `typescript-language-server`. It must be installed in a file-system location accessible by the language server or in the `node_modules` directory of projects being edited.
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
- The LSP client must be configured to explicitly enable this plug-in. This is done by passing `initializationOptions` with the appropriate [`plugins`] configuration to the language server:
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
- [`plugins`]: https://github.com/typescript-language-server/typescript-language-server/blob/b224b878652438bcdd639137a6b1d1a6630129e4/docs/configuration.md?plain=1#L27-L31
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
- "initializationOptions": {
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
- "name": "@vue/typescript-plugin",
14
- "location": "/usr/local/lib/node_modules/@vue/language-server",
15
- "languages": ["vue"],
16
- },
17
- ],
18
- },
35
+ { "name": "@vue/typescript-plugin" }
36
+ ]
37
+ }
38
+ }
19
39
  ```
20
40
 
21
- The `languages` field must specify file-types for which the plug-in will be enabled. If the plug-in package is installed in the local `node_modules`, the `location` field may contain any arbitrary string, but MUST be present.
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
- ## Client-specific configuration
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
- - For neovim, see the [details on configuring `tsserver`][nvim].
79
+ ## License
26
80
 
27
- [nvim]: https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#vue-support
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",
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.27",
17
- "@vue/language-core": "3.2.3",
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.3"
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": "efc6882ab62a518b41ab5c8dc1d762c41c862ebc"
26
+ "gitHead": "ee5041d27940cf6f9a5150635d3b13140a9dff54"
27
27
  }