Skip to content

Commit

Permalink
feature: use commandMap (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
levivilet authored Feb 9, 2025
1 parent 1143f6f commit 644204e
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import * as JsonWorkerUrl from '../JsonWorkerUrl/JsonWorkerUrl.js'
import * as LoadSchema from '../LoadSchema/LoadSchema.js'

const execute = (method, ...params) => {
if (method === 'Json.loadSchema') {
return LoadSchema.loadSchema(...params)
}
return {}
const commandMap = {
'Json.loadSchema': LoadSchema.loadSchema,
}

export const launchJsonWorker = async () => {
// @ts-ignore
const rpc = await vscode.createRpc({
url: JsonWorkerUrl.jsonWorkerUrl,
name: 'Json Worker',
execute,
commandMap,
})
return rpc
}

0 comments on commit 644204e

Please sign in to comment.