mirror of
https://github.com/tauri-apps/tauri-vscode.git
synced 2026-01-31 00:35:18 +01:00
fix: update schema filename
this is due the recent changes in tauri repo ref: https://github.com/tauri-apps/tauri/pull/10796
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user