From 3312f3bc06738a04e73ea1e78f52683d6d501737 Mon Sep 17 00:00:00 2001 From: amrbashir Date: Wed, 28 Aug 2024 19:43:54 +0300 Subject: [PATCH] fix: update schema filename this is due the recent changes in tauri repo ref: https://github.com/tauri-apps/tauri/pull/10796 --- src/extension.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index aaf1457d..1e810294 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -67,14 +67,19 @@ function registerSchemasHandler(context: vscode.ExtensionContext) { // get schema form local file in node_modules const schemaFile = ( await vscode.workspace.findFiles( - '**/node_modules/@tauri-apps/cli/schema.json' + '**/node_modules/@tauri-apps/cli/{schema.json,config.schema.json}' ) )[0] + if (schemaFile) return readFileSync(schemaFile.fsPath, 'utf-8') async function getSchemaFromRelease(version: string) { + const filename = version.startsWith('1') + ? 'schema.json' + : 'config.schema.json' + const res = await axios.get( - `https://github.com/tauri-apps/tauri/releases/download/tauri-build-v${version}/schema.json` + `https://github.com/tauri-apps/tauri/releases/download/tauri-build-v${version}/${filename}` ) return res.status == 200 ? JSON.stringify(res.data) : null }