@vue/typescript-plugin 3.0.0-beta.3 → 3.0.0-beta.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/index.js CHANGED
@@ -37,27 +37,27 @@ module.exports = (0, createLanguageServicePlugin_1.createLanguageServicePlugin)(
37
37
  return vue.createParsedCommandLine(ts, ts.sys, tsconfig.replace(windowsPathReg, '/')).vueOptions;
38
38
  }
39
39
  else {
40
- return vue.createParsedCommandLineByJson(ts, ts.sys, info.languageServiceHost.getCurrentDirectory(), {}).vueOptions;
40
+ return vue.createParsedCommandLineByJson(ts, ts.sys, info.languageServiceHost.getCurrentDirectory(), {})
41
+ .vueOptions;
41
42
  }
42
43
  }
43
44
  // https://github.com/JetBrains/intellij-plugins/blob/6435723ad88fa296b41144162ebe3b8513f4949b/Angular/src-js/angular-service/src/index.ts#L69
44
45
  function addVueCommands() {
45
46
  const projectService = info.project.projectService;
46
- projectService.logger.info("Vue: called handler processing " + info.project.projectKind);
47
+ projectService.logger.info('Vue: called handler processing ' + info.project.projectKind);
47
48
  const session = info.session;
48
49
  if (session == undefined) {
49
- projectService.logger.info("Vue: there is no session in info.");
50
+ projectService.logger.info('Vue: there is no session in info.');
50
51
  return;
51
52
  }
52
53
  if (session.addProtocolHandler == undefined) {
53
54
  // addProtocolHandler was introduced in TS 4.4 or 4.5 in 2021, see https://github.com/microsoft/TypeScript/issues/43893
54
- projectService.logger.info("Vue: there is no addProtocolHandler method.");
55
+ projectService.logger.info('Vue: there is no addProtocolHandler method.');
55
56
  return;
56
57
  }
57
- if (session.vueCommandsAdded) {
58
+ if (session.handlers.has('_vue:projectInfo')) {
58
59
  return;
59
60
  }
60
- session.vueCommandsAdded = true;
61
61
  session.addProtocolHandler('_vue:projectInfo', ({ arguments: args }) => {
62
62
  return session.handlers.get('projectInfo')?.({ arguments: args });
63
63
  });
package/lib/common.js CHANGED
@@ -10,13 +10,19 @@ function createVueLanguageServiceProxy(ts, language, languageService, vueOptions
10
10
  const proxyCache = new Map();
11
11
  const getProxyMethod = (target, p) => {
12
12
  switch (p) {
13
- case 'getCompletionsAtPosition': return getCompletionsAtPosition(ts, language, vueOptions, asScriptId, target[p]);
14
- case 'getCompletionEntryDetails': return getCompletionEntryDetails(language, asScriptId, target[p]);
15
- case 'getCodeFixesAtPosition': return getCodeFixesAtPosition(target[p]);
16
- case 'getDefinitionAndBoundSpan': return getDefinitionAndBoundSpan(ts, language, languageService, vueOptions, asScriptId, target[p]);
17
- case 'getQuickInfoAtPosition': return getQuickInfoAtPosition(ts, target, target[p]);
13
+ case 'getCompletionsAtPosition':
14
+ return getCompletionsAtPosition(ts, language, vueOptions, asScriptId, target[p]);
15
+ case 'getCompletionEntryDetails':
16
+ return getCompletionEntryDetails(language, asScriptId, target[p]);
17
+ case 'getCodeFixesAtPosition':
18
+ return getCodeFixesAtPosition(target[p]);
19
+ case 'getDefinitionAndBoundSpan':
20
+ return getDefinitionAndBoundSpan(ts, language, languageService, vueOptions, asScriptId, target[p]);
21
+ case 'getQuickInfoAtPosition':
22
+ return getQuickInfoAtPosition(ts, target, target[p]);
18
23
  // TS plugin only
19
- case 'getEncodedSemanticClassifications': return getEncodedSemanticClassifications(ts, language, target, asScriptId, target[p]);
24
+ case 'getEncodedSemanticClassifications':
25
+ return getEncodedSemanticClassifications(ts, language, target, asScriptId, target[p]);
20
26
  }
21
27
  };
22
28
  return new Proxy(languageService, {
@@ -302,7 +308,8 @@ function getComponentSpans(vueCode, template, spanTemplateRange) {
302
308
  ]);
303
309
  if (template.ast) {
304
310
  for (const node of (0, language_core_1.forEachElementNode)(template.ast)) {
305
- if (node.loc.end.offset <= spanTemplateRange.start || node.loc.start.offset >= (spanTemplateRange.start + spanTemplateRange.length)) {
311
+ if (node.loc.end.offset <= spanTemplateRange.start
312
+ || node.loc.start.offset >= (spanTemplateRange.start + spanTemplateRange.length)) {
306
313
  continue;
307
314
  }
308
315
  if (components.has(node.tag) && !elements.has(node.tag)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/typescript-plugin",
3
- "version": "3.0.0-beta.3",
3
+ "version": "3.0.0-beta.5",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "**/*.js",
@@ -13,8 +13,8 @@
13
13
  "directory": "packages/typescript-plugin"
14
14
  },
15
15
  "dependencies": {
16
- "@volar/typescript": "2.4.14",
17
- "@vue/language-core": "3.0.0-beta.3",
16
+ "@volar/typescript": "2.4.15",
17
+ "@vue/language-core": "3.0.0-beta.5",
18
18
  "@vue/shared": "^3.5.0",
19
19
  "path-browserify": "^1.0.1"
20
20
  },
@@ -22,5 +22,5 @@
22
22
  "@types/node": "^22.10.4",
23
23
  "@types/path-browserify": "^1.0.1"
24
24
  },
25
- "gitHead": "17e3beabc13e9eb59a82fb1a9f0252fd6685e444"
25
+ "gitHead": "3a4648914c60c90444d939cf762a016a4318ca09"
26
26
  }