@vue/language-core 2.0.22 → 2.0.23-alpha.0

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.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { VueCompilerOptions } from './lib/types';
1
2
  export * from './lib/codegen/template';
2
3
  export * from './lib/languageModule';
3
4
  export * from './lib/parsers/scriptSetupRanges';
@@ -11,3 +12,10 @@ export * from './lib/utils/shared';
11
12
  export { tsCodegen } from './lib/plugins/vue-tsx';
12
13
  export * from '@volar/language-core';
13
14
  export type * as CompilerDOM from '@vue/compiler-dom';
15
+ declare module '@volar/language-core' {
16
+ interface Language {
17
+ vue?: {
18
+ compilerOptions: VueCompilerOptions;
19
+ };
20
+ }
21
+ }
@@ -136,7 +136,7 @@ function createVueLanguagePlugin(ts, asFileName, getProjectVersion, isRootFile,
136
136
  })),
137
137
  getServiceScript(root) {
138
138
  for (const code of (0, language_core_1.forEachEmbeddedCode)(root)) {
139
- if (code.id.startsWith('script_')) {
139
+ if (/script_(js|jsx|ts|tsx)/.test(code.id)) {
140
140
  const lang = code.id.substring('script_'.length);
141
141
  return {
142
142
  code,
@@ -6,16 +6,16 @@ const plugin = () => {
6
6
  getEmbeddedCodes(_fileName, sfc) {
7
7
  const names = [];
8
8
  if (sfc.script) {
9
- names.push({ id: 'scriptFormat', lang: sfc.script.lang });
9
+ names.push({ id: 'script_raw', lang: sfc.script.lang });
10
10
  }
11
11
  if (sfc.scriptSetup) {
12
- names.push({ id: 'scriptSetupFormat', lang: sfc.scriptSetup.lang });
12
+ names.push({ id: 'scriptsetup_raw', lang: sfc.scriptSetup.lang });
13
13
  }
14
14
  return names;
15
15
  },
16
16
  resolveEmbeddedCode(_fileName, sfc, embeddedFile) {
17
- const script = embeddedFile.id === 'scriptFormat' ? sfc.script
18
- : embeddedFile.id === 'scriptSetupFormat' ? sfc.scriptSetup
17
+ const script = embeddedFile.id === 'script_raw' ? sfc.script
18
+ : embeddedFile.id === 'scriptsetup_raw' ? sfc.scriptSetup
19
19
  : undefined;
20
20
  if (script) {
21
21
  embeddedFile.content.push([
@@ -25,7 +25,7 @@ const plugin = ctx => {
25
25
  },
26
26
  resolveEmbeddedCode(fileName, sfc, embeddedFile) {
27
27
  const _tsx = useTsx(fileName, sfc);
28
- if (embeddedFile.id.startsWith('script_')) {
28
+ if (/script_(js|jsx|ts|tsx)/.test(embeddedFile.id)) {
29
29
  const tsx = _tsx.generatedScript();
30
30
  if (tsx) {
31
31
  const content = [...tsx.codes];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/language-core",
3
- "version": "2.0.22",
3
+ "version": "2.0.23-alpha.0",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "**/*.js",
@@ -12,7 +12,7 @@
12
12
  "directory": "packages/language-core"
13
13
  },
14
14
  "dependencies": {
15
- "@volar/language-core": "~2.3.1",
15
+ "@volar/language-core": "~2.4.0-alpha.0",
16
16
  "@vue/compiler-dom": "^3.4.0",
17
17
  "@vue/shared": "^3.4.0",
18
18
  "computeds": "^0.0.1",
@@ -25,6 +25,7 @@
25
25
  "@types/minimatch": "^5.1.2",
26
26
  "@types/node": "latest",
27
27
  "@types/path-browserify": "^1.0.1",
28
+ "@volar/typescript": "~2.4.0-alpha.0",
28
29
  "@vue/compiler-sfc": "^3.4.0"
29
30
  },
30
31
  "peerDependencies": {
@@ -35,5 +36,5 @@
35
36
  "optional": true
36
37
  }
37
38
  },
38
- "gitHead": "884c8a553d4fd240167fcb97c6a738564f9d697a"
39
+ "gitHead": "c1b2f64df85617643c1b4b408d99447df3fa2d5f"
39
40
  }