@vue/language-service 2.0.24 → 2.0.26-alpha.1

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.
@@ -916,7 +916,7 @@
916
916
  ],
917
917
  "description": {
918
918
  "kind": "markdown",
919
- "value": "\n在一个 `*.vue` 文件中可以为任何项目特定需求使用额外的自定义块。举例来说,一个用作写文档的 `<docs>` 块。这里是一些自定义块的真实用例:\n\n- [Gridsome:`<page-query>`](https://gridsome.org/docs/querying-data/)\n- [vite-plugin-vue-gql:`<gql>`](https://github.com/wheatjs/vite-plugin-vue-gql)\n- [vue-i18n:`<i18n>`](https://github.com/intlify/bundle-tools/tree/main/packages/vite-plugin-vue-i18n#i18n-custom-block)\n\n自定义块的处理需要依赖工具链。如果你想要在构建中集成你的自定义语块,请参见 [SFC 自定义块集成工具链指南](https://cn.vuejs.org/guide/scaling-up/tooling.html#sfc-custom-block-integrations)获取更多细节。\n"
919
+ "value": "\n在一个 `*.vue` 文件中可以为任何项目特定需求使用额外的自定义块。举例来说,一个用作写文档的 `<docs>` 块。这里是一些自定义块的真实用例:\n\n- [Gridsome:`<page-query>`](https://gridsome.org/docs/querying-data/)\n- [vite-plugin-vue-gql:`<gql>`](https://github.com/wheatjs/vite-plugin-vue-gql)\n- [vue-i18n:`<i18n>`](https://github.com/intlify/bundle-tools/tree/main/packages/unplugin-vue-i18n#i18n-custom-block)\n\n自定义块的处理需要依赖工具链。如果你想要在构建中集成你的自定义语块,请参见 [SFC 自定义块集成工具链指南](https://cn.vuejs.org/guide/scaling-up/tooling.html#sfc-custom-block-integrations)获取更多细节。\n"
920
920
  },
921
921
  "references": [
922
922
  {
package/index.d.ts CHANGED
@@ -13,11 +13,3 @@ declare module '@volar/language-service' {
13
13
  }
14
14
  export declare function getFullLanguageServicePlugins(ts: typeof import('typescript')): LanguageServicePlugin[];
15
15
  export declare function getHybridModeLanguageServicePlugins(ts: typeof import('typescript'), getTsPluginClient: typeof import("@vue/typescript-plugin/lib/client")): LanguageServicePlugin[];
16
- export declare const commands: {
17
- parseSfc: string;
18
- detectNameCasing: string;
19
- convertTagsToKebabCase: string;
20
- convertTagsToPascalCase: string;
21
- convertPropsToKebabCase: string;
22
- convertPropsToCamelCase: string;
23
- };
package/index.js CHANGED
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.commands = void 0;
18
17
  exports.getFullLanguageServicePlugins = getFullLanguageServicePlugins;
19
18
  exports.getHybridModeLanguageServicePlugins = getHybridModeLanguageServicePlugins;
20
19
  __exportStar(require("@volar/language-service"), exports);
@@ -67,7 +66,7 @@ function getFullLanguageServicePlugins(ts) {
67
66
  }
68
67
  const languageService = created.provide['typescript/languageService']();
69
68
  if (context.project.vue) {
70
- const proxy = (0, common_1.proxyLanguageServiceForVue)(ts, context.language, languageService, context.project.vue.compilerOptions, context.project.typescript.asUri);
69
+ const proxy = (0, common_1.proxyLanguageServiceForVue)(ts, context.language, languageService, context.project.vue.compilerOptions, s => context.project.typescript?.uriConverter.asUri(s));
71
70
  languageService.getCompletionsAtPosition = proxy.getCompletionsAtPosition;
72
71
  languageService.getCompletionEntryDetails = proxy.getCompletionEntryDetails;
73
72
  languageService.getCodeFixesAtPosition = proxy.getCodeFixesAtPosition;
@@ -94,7 +93,7 @@ function getFullLanguageServicePlugins(ts) {
94
93
  languageService,
95
94
  languageServiceHost: context.project.typescript.languageServiceHost,
96
95
  isTsPlugin: false,
97
- getFileId: context.project.typescript.asUri,
96
+ getFileId: s => context.project.typescript.uriConverter.asUri(s),
98
97
  };
99
98
  return {
100
99
  async collectExtractProps(...args) {
@@ -139,14 +138,6 @@ function getHybridModeLanguageServicePlugins(ts, getTsPluginClient) {
139
138
  }
140
139
  return plugins;
141
140
  }
142
- exports.commands = {
143
- parseSfc: 'vue.parseSfc',
144
- detectNameCasing: 'vue.detectNameCasing',
145
- convertTagsToKebabCase: 'vue.convertTagsToKebabCase',
146
- convertTagsToPascalCase: 'vue.convertTagsToPascalCase',
147
- convertPropsToKebabCase: 'vue.convertPropsToKebabCase',
148
- convertPropsToCamelCase: 'vue.convertPropsToCamelCase',
149
- };
150
141
  function getCommonLanguageServicePlugins(ts, getTsPluginClient) {
151
142
  return [
152
143
  (0, volar_service_typescript_twoslash_queries_1.create)(ts),
@@ -175,7 +166,7 @@ function getCommonLanguageServicePlugins(ts, getTsPluginClient) {
175
166
  name: 'vue-parse-sfc',
176
167
  capabilities: {
177
168
  executeCommandProvider: {
178
- commands: [exports.commands.parseSfc],
169
+ commands: [types_1.commands.parseSfc],
179
170
  },
180
171
  },
181
172
  create() {
@@ -191,30 +182,30 @@ function getCommonLanguageServicePlugins(ts, getTsPluginClient) {
191
182
  capabilities: {
192
183
  executeCommandProvider: {
193
184
  commands: [
194
- exports.commands.detectNameCasing,
195
- exports.commands.convertTagsToKebabCase,
196
- exports.commands.convertTagsToPascalCase,
197
- exports.commands.convertPropsToKebabCase,
198
- exports.commands.convertPropsToCamelCase,
185
+ types_1.commands.detectNameCasing,
186
+ types_1.commands.convertTagsToKebabCase,
187
+ types_1.commands.convertTagsToPascalCase,
188
+ types_1.commands.convertPropsToKebabCase,
189
+ types_1.commands.convertPropsToCamelCase,
199
190
  ],
200
191
  }
201
192
  },
202
193
  create(context) {
203
194
  return {
204
195
  executeCommand(command, [uri]) {
205
- if (command === exports.commands.detectNameCasing) {
196
+ if (command === types_1.commands.detectNameCasing) {
206
197
  return (0, nameCasing_1.detect)(context, vscode_uri_1.URI.parse(uri));
207
198
  }
208
- else if (command === exports.commands.convertTagsToKebabCase) {
199
+ else if (command === types_1.commands.convertTagsToKebabCase) {
209
200
  return (0, nameCasing_1.convertTagName)(context, vscode_uri_1.URI.parse(uri), types_1.TagNameCasing.Kebab, getTsPluginClient(context));
210
201
  }
211
- else if (command === exports.commands.convertTagsToPascalCase) {
202
+ else if (command === types_1.commands.convertTagsToPascalCase) {
212
203
  return (0, nameCasing_1.convertTagName)(context, vscode_uri_1.URI.parse(uri), types_1.TagNameCasing.Pascal, getTsPluginClient(context));
213
204
  }
214
- else if (command === exports.commands.convertPropsToKebabCase) {
205
+ else if (command === types_1.commands.convertPropsToKebabCase) {
215
206
  return (0, nameCasing_1.convertAttrName)(context, vscode_uri_1.URI.parse(uri), types_1.AttrNameCasing.Kebab, getTsPluginClient(context));
216
207
  }
217
- else if (command === exports.commands.convertPropsToCamelCase) {
208
+ else if (command === types_1.commands.convertPropsToCamelCase) {
218
209
  return (0, nameCasing_1.convertAttrName)(context, vscode_uri_1.URI.parse(uri), types_1.AttrNameCasing.Camel, getTsPluginClient(context));
219
210
  }
220
211
  },
@@ -56,7 +56,7 @@ function create(ts, getTsPluginClient) {
56
56
  }
57
57
  let ast;
58
58
  let sourceCodeOffset = document.offsetAt(selection);
59
- const fileName = context.project.typescript?.asFileName(sourceScript.id)
59
+ const fileName = context.project.typescript?.uriConverter.asFileName(sourceScript.id)
60
60
  ?? sourceScript.id.fsPath.replace(/\\/g, '/');
61
61
  if (sourceScript.generated) {
62
62
  const serviceScript = sourceScript.generated.languagePlugin.typescript?.getServiceScript(sourceScript.generated.root);
@@ -53,7 +53,7 @@ function create(ts, getTsPluginClient) {
53
53
  const additionalEdit = {};
54
54
  const code = [...(0, language_core_1.forEachEmbeddedCode)(vueVirtualCode)].find(code => code.id === (sfc.scriptSetup ? 'scriptsetup_raw' : 'script_raw'));
55
55
  const lastImportNode = (0, vue_extract_file_1.getLastImportNode)(ts, script.ast);
56
- const incomingFileName = context.project.typescript?.asFileName(vscode_uri_1.URI.parse(importUri))
56
+ const incomingFileName = context.project.typescript?.uriConverter.asFileName(vscode_uri_1.URI.parse(importUri))
57
57
  ?? vscode_uri_1.URI.parse(importUri).fsPath.replace(/\\/g, '/');
58
58
  let importPath;
59
59
  const serviceScript = sourceScript.generated?.languagePlugin.typescript?.getServiceScript(vueVirtualCode);
package/lib/types.d.ts CHANGED
@@ -6,5 +6,13 @@ export declare enum AttrNameCasing {
6
6
  Kebab = 0,
7
7
  Camel = 1
8
8
  }
9
+ export declare const commands: {
10
+ parseSfc: string;
11
+ detectNameCasing: string;
12
+ convertTagsToKebabCase: string;
13
+ convertTagsToPascalCase: string;
14
+ convertPropsToKebabCase: string;
15
+ convertPropsToCamelCase: string;
16
+ };
9
17
  export * from '@volar/language-service/lib/types';
10
18
  export * from '@vue/language-core/lib/types';
package/lib/types.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.AttrNameCasing = exports.TagNameCasing = void 0;
17
+ exports.commands = exports.AttrNameCasing = exports.TagNameCasing = void 0;
18
18
  var TagNameCasing;
19
19
  (function (TagNameCasing) {
20
20
  TagNameCasing[TagNameCasing["Kebab"] = 0] = "Kebab";
@@ -25,6 +25,14 @@ var AttrNameCasing;
25
25
  AttrNameCasing[AttrNameCasing["Kebab"] = 0] = "Kebab";
26
26
  AttrNameCasing[AttrNameCasing["Camel"] = 1] = "Camel";
27
27
  })(AttrNameCasing || (exports.AttrNameCasing = AttrNameCasing = {}));
28
+ exports.commands = {
29
+ parseSfc: 'vue.parseSfc',
30
+ detectNameCasing: 'vue.detectNameCasing',
31
+ convertTagsToKebabCase: 'vue.convertTagsToKebabCase',
32
+ convertTagsToPascalCase: 'vue.convertTagsToPascalCase',
33
+ convertPropsToKebabCase: 'vue.convertPropsToKebabCase',
34
+ convertPropsToCamelCase: 'vue.convertPropsToCamelCase',
35
+ };
28
36
  // only export types of depend packages
29
37
  __exportStar(require("@volar/language-service/lib/types"), exports);
30
38
  __exportStar(require("@vue/language-core/lib/types"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/language-service",
3
- "version": "2.0.24",
3
+ "version": "2.0.26-alpha.1",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "data",
@@ -16,23 +16,23 @@
16
16
  "update-html-data": "node ./scripts/update-html-data.js"
17
17
  },
18
18
  "dependencies": {
19
- "@volar/language-core": "~2.4.0-alpha.2",
20
- "@volar/language-service": "~2.4.0-alpha.2",
21
- "@volar/typescript": "~2.4.0-alpha.2",
19
+ "@volar/language-core": "~2.4.0-alpha.11",
20
+ "@volar/language-service": "~2.4.0-alpha.11",
21
+ "@volar/typescript": "~2.4.0-alpha.11",
22
22
  "@vue/compiler-dom": "^3.4.0",
23
- "@vue/language-core": "2.0.24",
23
+ "@vue/language-core": "2.0.26-alpha.1",
24
24
  "@vue/shared": "^3.4.0",
25
- "@vue/typescript-plugin": "2.0.24",
25
+ "@vue/typescript-plugin": "2.0.26-alpha.1",
26
26
  "computeds": "^0.0.1",
27
27
  "path-browserify": "^1.0.1",
28
- "volar-service-css": "0.0.56",
29
- "volar-service-emmet": "0.0.56",
30
- "volar-service-html": "0.0.56",
31
- "volar-service-json": "0.0.56",
32
- "volar-service-pug": "0.0.56",
33
- "volar-service-pug-beautify": "0.0.56",
34
- "volar-service-typescript": "0.0.56",
35
- "volar-service-typescript-twoslash-queries": "0.0.56",
28
+ "volar-service-css": "volar-2.4",
29
+ "volar-service-emmet": "volar-2.4",
30
+ "volar-service-html": "volar-2.4",
31
+ "volar-service-json": "volar-2.4",
32
+ "volar-service-pug": "volar-2.4",
33
+ "volar-service-pug-beautify": "volar-2.4",
34
+ "volar-service-typescript": "volar-2.4",
35
+ "volar-service-typescript-twoslash-queries": "volar-2.4",
36
36
  "vscode-html-languageservice": "^5.2.0",
37
37
  "vscode-languageserver-textdocument": "^1.0.11",
38
38
  "vscode-uri": "^3.0.8"
@@ -40,8 +40,8 @@
40
40
  "devDependencies": {
41
41
  "@types/node": "latest",
42
42
  "@types/path-browserify": "latest",
43
- "@volar/kit": "~2.4.0-alpha.2",
43
+ "@volar/kit": "~2.4.0-alpha.11",
44
44
  "vscode-languageserver-protocol": "^3.17.5"
45
45
  },
46
- "gitHead": "bca79db09e413ef29c17b910271c123a7a68806f"
46
+ "gitHead": "38830a5e043a97158c7123995914bce6a875125a"
47
47
  }