try catch around monaco services

This commit is contained in:
Ruben Fiszel
2022-09-26 04:02:27 +02:00
parent 428e96ad2d
commit 6097c26cdb

View File

@@ -40,9 +40,13 @@
updateOptions
} from '$lib/editorUtils'
StandaloneServices.initialize({
...getMessageServiceOverride(document.body)
})
try {
StandaloneServices.initialize({
...getMessageServiceOverride(document.body)
})
} catch (e) {
console.error(e)
}
let divEl: HTMLDivElement | null = null
let editor: monaco.editor.IStandaloneCodeEditor
@@ -230,12 +234,19 @@
if (name == 'deno') {
command && command.dispose()
command = undefined
command = vscode.commands.registerCommand('deno.cache', (uris: DocumentUri[] = []) => {
languageClient.sendRequest(new RequestType('deno/cache'), {
referrer: { uri },
uris: uris.map((uri) => ({ uri }))
})
})
try {
command = vscode.commands.registerCommand(
'deno.cache',
(uris: DocumentUri[] = []) => {
languageClient.sendRequest(new RequestType('deno/cache'), {
referrer: { uri },
uris: uris.map((uri) => ({ uri }))
})
}
)
} catch (err) {
console.error(err)
}
}
websocketAlive[name] = true