Skip to content

Commit

Permalink
fix: Specify the custom typescript worker on initial initialization, …
Browse files Browse the repository at this point in the history
…to get around issues with the CodeHost not loading correctly
  • Loading branch information
stefan-lacatus committed Mar 12, 2022
1 parent e7abaec commit a13934f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 8 additions & 0 deletions src/editors/basicCodeEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,14 @@ export class MonacoCodeEditor {
allowComments: false,
validate: true,
});

// Customize the typescript worker to add the methods needed by the script editor as well as CodeHost
monaco.languages.typescript.typescriptDefaults.setWorkerOptions({
customWorkerPath: __webpack_public_path__ + "tsCustomWorker.bundle.js",
});
monaco.languages.typescript.javascriptDefaults.setWorkerOptions({
customWorkerPath: __webpack_public_path__ + "tsCustomWorker.bundle.js",
});
}

/**
Expand Down
7 changes: 0 additions & 7 deletions src/editors/typescript/typescriptCodeEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,6 @@ export class TypescriptCodeEditor extends ServiceEditor {
noLib: true,
newLine: monaco.languages.typescript.NewLineKind.LineFeed
});
// customize the worker to add the methods needed by the script editor as well as CodeHost
monaco.languages.typescript.typescriptDefaults.setWorkerOptions({
customWorkerPath: __webpack_public_path__ + "tsCustomWorker.bundle.js",
});
monaco.languages.typescript.javascriptDefaults.setWorkerOptions({
customWorkerPath: __webpack_public_path__ + "tsCustomWorker.bundle.js",
});
// generate the completion for language snippets
this.disposables.push(monaco.languages.registerCompletionItemProvider(Languages.TwxJavascript, {
provideCompletionItems: function (model, position) {
Expand Down

0 comments on commit a13934f

Please sign in to comment.