@vue/typescript-plugin 2.1.6 → 2.1.8

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/lib/common.d.ts CHANGED
@@ -2,4 +2,4 @@ import { Language, VueCompilerOptions, VueVirtualCode } from '@vue/language-core
2
2
  import type * as ts from 'typescript';
3
3
  import type { RequestContext } from './requests/types';
4
4
  export declare function proxyLanguageServiceForVue<T>(ts: typeof import('typescript'), language: Language<T>, languageService: ts.LanguageService, vueOptions: VueCompilerOptions, asScriptId: (fileName: string) => T): ts.LanguageService;
5
- export declare function getComponentSpans(this: Pick<RequestContext, 'typescript' | 'languageService'>, vueCode: VueVirtualCode, template: NonNullable<VueVirtualCode['sfc']['template']>, spanTemplateRange: ts.TextSpan): ts.TextSpan[];
5
+ export declare function getComponentSpans(this: Pick<RequestContext, 'typescript' | 'languageService'>, vueCode: VueVirtualCode, template: NonNullable<VueVirtualCode['_sfc']['template']>, spanTemplateRange: ts.TextSpan): ts.TextSpan[];
package/lib/common.js CHANGED
@@ -102,7 +102,7 @@ function getCompletionEntryDetails(language, asScriptId, getCompletionEntryDetai
102
102
  const { fileName } = args[6]?.__isAutoImport;
103
103
  const sourceScript = language.scripts.get(asScriptId(fileName));
104
104
  if (sourceScript?.generated?.root instanceof language_core_1.VueVirtualCode) {
105
- const sfc = sourceScript.generated.root.getVueSfc();
105
+ const sfc = sourceScript.generated.root._vueSfc.get();
106
106
  if (!sfc?.descriptor.script && !sfc?.descriptor.scriptSetup) {
107
107
  for (const codeAction of details?.codeActions ?? []) {
108
108
  for (const change of codeAction.changes) {
@@ -172,7 +172,7 @@ function getEncodedSemanticClassifications(ts, language, languageService, asScri
172
172
  const result = getEncodedSemanticClassifications(fileName, span, format);
173
173
  const file = language.scripts.get(asScriptId(fileName));
174
174
  if (file?.generated?.root instanceof language_core_1.VueVirtualCode) {
175
- const { template } = file.generated.root.sfc;
175
+ const { template } = file.generated.root._sfc;
176
176
  if (template) {
177
177
  for (const componentSpan of getComponentSpans.call({ typescript: ts, languageService }, file.generated.root, template, {
178
178
  start: span.start - template.startTagEnd,
@@ -14,7 +14,7 @@ function collectExtractProps(fileName, templateCodeRange) {
14
14
  const checker = program.getTypeChecker();
15
15
  const script = volarFile.generated?.languagePlugin.typescript?.getServiceScript(volarFile.generated.root);
16
16
  const maps = script ? [...language.maps.forEach(script.code)].map(([_sourceScript, map]) => map) : [];
17
- const sfc = volarFile.generated.root.sfc;
17
+ const sfc = volarFile.generated.root._sfc;
18
18
  sourceFile.forEachChild(function visit(node) {
19
19
  if (ts.isPropertyAccessExpression(node)
20
20
  && ts.isIdentifier(node.expression)
package/package.json CHANGED
@@ -1,23 +1,24 @@
1
1
  {
2
2
  "name": "@vue/typescript-plugin",
3
- "version": "2.1.6",
3
+ "version": "2.1.8",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "**/*.js",
7
7
  "**/*.d.ts"
8
8
  ],
9
+ "sideEffects": false,
9
10
  "repository": {
10
11
  "type": "git",
11
12
  "url": "https://github.com/vuejs/language-tools.git",
12
13
  "directory": "packages/typescript-plugin"
13
14
  },
14
15
  "dependencies": {
15
- "@volar/typescript": "~2.4.1",
16
- "@vue/language-core": "2.1.6",
17
- "@vue/shared": "^3.4.0"
16
+ "@volar/typescript": "~2.4.8",
17
+ "@vue/language-core": "2.1.8",
18
+ "@vue/shared": "^3.5.0"
18
19
  },
19
20
  "devDependencies": {
20
21
  "@types/node": "latest"
21
22
  },
22
- "gitHead": "fd61953ce9eb924eeaf4df0bf8d2237267321194"
23
+ "gitHead": "25cccedc53e7361ed4e34296d6ecd43d7de2a095"
23
24
  }