Skip to content

Commit

Permalink
feat: enable javascript worker
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean committed May 30, 2023
1 parent 9034caa commit 640975f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion demo/src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import getPreferencesServiceOverride from 'vscode/service-override/preferences'
import getSnippetServiceOverride from 'vscode/service-override/snippets'
import EditorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'
import JsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker'
import TypescriptWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'
import { createConfiguredEditor } from 'vscode/monaco'
import 'vscode/default-extensions/theme-defaults'
Expand All @@ -39,7 +40,8 @@ interface WorkerConstructor {
export type WorkerLoader = () => WorkerConstructor | Promise<WorkerConstructor>
const workerLoaders: Partial<Record<string, WorkerLoader>> = {
editorWorkerService: () => EditorWorker,
json: () => JsonWorker
json: () => JsonWorker,
javascript: () => TypescriptWorker
}
window.MonacoEnvironment = {
getWorker: async function (moduleId, label) {
Expand Down

0 comments on commit 640975f

Please sign in to comment.