Skip to content

Commit

Permalink
fix(vue-tsc): update required volar version (#4498)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmatter authored Jun 24, 2024
1 parent 58b4cd8 commit 4a295b6
Show file tree
Hide file tree
Showing 16 changed files with 154 additions and 154 deletions.
2 changes: 1 addition & 1 deletion extensions/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@
"devDependencies": {
"@types/semver": "^7.5.3",
"@types/vscode": "^1.82.0",
"@volar/vscode": "~2.3.1",
"@volar/vscode": "~2.3.4",
"@vue/language-core": "2.0.22",
"@vue/language-server": "2.0.22",
"@vue/typescript-plugin": "2.0.22",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@lerna-lite/publish": "latest",
"@tsslint/cli": "latest",
"@tsslint/config": "latest",
"@volar/language-service": "~2.3.1",
"@volar/language-service": "~2.3.4",
"typescript": "latest",
"vite": "latest",
"vitest": "latest"
Expand Down
2 changes: 1 addition & 1 deletion packages/component-meta/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"directory": "packages/component-meta"
},
"dependencies": {
"@volar/typescript": "~2.3.1",
"@volar/typescript": "~2.3.4",
"@vue/language-core": "2.0.22",
"path-browserify": "^1.0.1",
"vue-component-type-helpers": "2.0.22"
Expand Down
2 changes: 1 addition & 1 deletion packages/language-core/lib/languageModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export function createVueLanguagePlugin<T>(
})),
getServiceScript(root) {
for (const code of forEachEmbeddedCode(root)) {
if (code.id.startsWith('script_')) {
if (/script_(js|jsx|ts|tsx)/.test(code.id)) {
const lang = code.id.substring('script_'.length);
return {
code,
Expand Down
8 changes: 4 additions & 4 deletions packages/language-core/lib/plugins/vue-sfc-scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ const plugin: VueLanguagePlugin = () => {
lang: string;
}[] = [];
if (sfc.script) {
names.push({ id: 'scriptFormat', lang: sfc.script.lang });
names.push({ id: 'script_raw', lang: sfc.script.lang });
}
if (sfc.scriptSetup) {
names.push({ id: 'scriptSetupFormat', lang: sfc.scriptSetup.lang });
names.push({ id: 'scriptsetup_raw', lang: sfc.scriptSetup.lang });
}
return names;
},

resolveEmbeddedCode(_fileName, sfc, embeddedFile) {
const script = embeddedFile.id === 'scriptFormat' ? sfc.script
: embeddedFile.id === 'scriptSetupFormat' ? sfc.scriptSetup
const script = embeddedFile.id === 'script_raw' ? sfc.script
: embeddedFile.id === 'scriptsetup_raw' ? sfc.scriptSetup
: undefined;
if (script) {
embeddedFile.content.push([
Expand Down
2 changes: 1 addition & 1 deletion packages/language-core/lib/plugins/vue-tsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const plugin: VueLanguagePlugin = ctx => {

const _tsx = useTsx(fileName, sfc);

if (embeddedFile.id.startsWith('script_')) {
if (/script_(js|jsx|ts|tsx)/.test(embeddedFile.id)) {
const tsx = _tsx.generatedScript();
if (tsx) {
const content: Code[] = [...tsx.codes];
Expand Down
2 changes: 1 addition & 1 deletion packages/language-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"directory": "packages/language-core"
},
"dependencies": {
"@volar/language-core": "~2.3.1",
"@volar/language-core": "~2.3.4",
"@vue/compiler-dom": "^3.4.0",
"@vue/shared": "^3.4.0",
"computeds": "^0.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/language-plugin-pug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@vue/language-core": "2.0.22"
},
"dependencies": {
"@volar/source-map": "~2.3.1",
"volar-service-pug": "0.0.52"
"@volar/source-map": "~2.3.4",
"volar-service-pug": "0.0.54"
}
}
4 changes: 2 additions & 2 deletions packages/language-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"directory": "packages/language-server"
},
"dependencies": {
"@volar/language-core": "~2.3.1",
"@volar/language-server": "~2.3.1",
"@volar/language-core": "~2.3.4",
"@volar/language-server": "~2.3.4",
"@vue/language-core": "2.0.22",
"@vue/language-service": "2.0.22",
"@vue/typescript-plugin": "2.0.22",
Expand Down
2 changes: 1 addition & 1 deletion packages/language-service/lib/plugins/vue-document-drop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function create(
}

const additionalEdit: vscode.WorkspaceEdit = {};
const code = [...forEachEmbeddedCode(vueVirtualCode)].find(code => code.id === (sfc.scriptSetup ? 'scriptSetupFormat' : 'scriptFormat'))!;
const code = [...forEachEmbeddedCode(vueVirtualCode)].find(code => code.id === (sfc.scriptSetup ? 'scriptsetup_raw' : 'script_raw'))!;
const lastImportNode = getLastImportNode(ts, script.ast);
const incomingFileName = context.language.typescript?.asFileName(URI.parse(importUri))
?? URI.parse(importUri).fsPath.replace(/\\/g, '/');
Expand Down
2 changes: 1 addition & 1 deletion packages/language-service/lib/plugins/vue-sfc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function create(): LanguageServicePlugin {

async resolveEmbeddedCodeFormattingOptions(sourceScript, virtualCode, options) {
if (sourceScript.generated?.root instanceof vue.VueVirtualCode) {
if (virtualCode.id === 'scriptFormat' || virtualCode.id === 'scriptSetupFormat') {
if (virtualCode.id === 'script_raw' || virtualCode.id === 'scriptsetup_raw') {
if (await context.env.getConfiguration?.('vue.format.script.initialIndent') ?? false) {
options.initialIndentLevel++;
}
Expand Down
24 changes: 12 additions & 12 deletions packages/language-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@
"update-html-data": "node ./scripts/update-html-data.js"
},
"dependencies": {
"@volar/language-core": "~2.3.1",
"@volar/language-service": "~2.3.1",
"@volar/typescript": "~2.3.1",
"@volar/language-core": "~2.3.4",
"@volar/language-service": "~2.3.4",
"@volar/typescript": "~2.3.4",
"@vue/compiler-dom": "^3.4.0",
"@vue/language-core": "2.0.22",
"@vue/shared": "^3.4.0",
"@vue/typescript-plugin": "2.0.22",
"computeds": "^0.0.1",
"path-browserify": "^1.0.1",
"volar-service-css": "0.0.52",
"volar-service-emmet": "0.0.52",
"volar-service-html": "0.0.52",
"volar-service-json": "0.0.52",
"volar-service-pug": "0.0.52",
"volar-service-pug-beautify": "0.0.52",
"volar-service-typescript": "0.0.52",
"volar-service-typescript-twoslash-queries": "0.0.52",
"volar-service-css": "0.0.54",
"volar-service-emmet": "0.0.54",
"volar-service-html": "0.0.54",
"volar-service-json": "0.0.54",
"volar-service-pug": "0.0.54",
"volar-service-pug-beautify": "0.0.54",
"volar-service-typescript": "0.0.54",
"volar-service-typescript-twoslash-queries": "0.0.54",
"vscode-html-languageservice": "^5.2.0",
"vscode-languageserver-textdocument": "^1.0.11",
"vscode-uri": "^3.0.8"
},
"devDependencies": {
"@types/node": "latest",
"@types/path-browserify": "latest",
"@volar/kit": "~2.3.1",
"@volar/kit": "~2.3.4",
"vscode-languageserver-protocol": "^3.17.5"
}
}
2 changes: 1 addition & 1 deletion packages/tsc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"vue-tsc": "./bin/vue-tsc.js"
},
"dependencies": {
"@volar/typescript": "~2.3.1",
"@volar/typescript": "~2.3.4",
"@vue/language-core": "2.0.22",
"semver": "^7.5.4"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"directory": "packages/typescript-plugin"
},
"dependencies": {
"@volar/typescript": "~2.3.1",
"@volar/typescript": "~2.3.4",
"@vue/language-core": "2.0.22",
"@vue/shared": "^3.4.0"
},
Expand Down
Loading

0 comments on commit 4a295b6

Please sign in to comment.