Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Commit

Permalink
Tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Aug 21, 2020
1 parent 3e1a236 commit 16bf9ad
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/tsWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,11 @@ export function create(ctx: IWorkerContext, createData: ICreateData): TypeScript

// @ts-ignore - This is available in a webworker
if (typeof importScripts === "undefined") {
console.warn("Monaco is not using webworker workers, and that is needed to support the customWorkerPath flag")
console.warn("Monaco is not using webworkers for background tasks, and that is needed to support the customWorkerPath flag")
} else {
// @ts-ignore - This is available in a webworker
importScripts(createData.customWorkerPath)
// @ts-ignore - This should come from
// @ts-ignore - This should come from the above eval
if(!self.extendTSWorkerFactory) {
throw new Error(`The script at ${createData.customWorkerPath} does not add extendTSWorkerFactory to self`)
}
Expand Down
1 change: 0 additions & 1 deletion test/custom-worker.html
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ <h3>Custom webworker</h3>

document.getElementById('logDTS').onclick = async () => {
const model = editor.getModel()

const worker = await monaco.languages.typescript.getTypeScriptWorker()
const thisWorker = await worker(model.uri)
const dts = await thisWorker.getDTSEmitForFile(model.uri.toString())
Expand Down
2 changes: 0 additions & 2 deletions test/custom-worker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/// <reference lib="webworker">

self.extendTSWorkerFactory = (TypeScriptWorker) => {
return class MonacoTSWorker extends TypeScriptWorker {

Expand Down

0 comments on commit 16bf9ad

Please sign in to comment.