Skip to content

Commit 3312f3b

Browse files
committed
fix: update schema filename
this is due the recent changes in tauri repo ref: tauri-apps/tauri#10796
1 parent a50b071 commit 3312f3b

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/extension.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,19 @@ function registerSchemasHandler(context: vscode.ExtensionContext) {
6767
// get schema form local file in node_modules
6868
const schemaFile = (
6969
await vscode.workspace.findFiles(
70-
'**/node_modules/@tauri-apps/cli/schema.json'
70+
'**/node_modules/@tauri-apps/cli/{schema.json,config.schema.json}'
7171
)
7272
)[0]
73+
7374
if (schemaFile) return readFileSync(schemaFile.fsPath, 'utf-8')
7475

7576
async function getSchemaFromRelease(version: string) {
77+
const filename = version.startsWith('1')
78+
? 'schema.json'
79+
: 'config.schema.json'
80+
7681
const res = await axios.get(
77-
`https://github.com/tauri-apps/tauri/releases/download/tauri-build-v${version}/schema.json`
82+
`https://github.com/tauri-apps/tauri/releases/download/tauri-build-v${version}/${filename}`
7883
)
7984
return res.status == 200 ? JSON.stringify(res.data) : null
8085
}

0 commit comments

Comments
 (0)