-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
4,246 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/components/code-editor/useWorker.ts |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import React from "react"; | ||
import { render, screen } from "@testing-library/react"; | ||
import App from "./App"; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,35 @@ | ||
// This file is ignoring elint check with .eslintignore | ||
// Be careful when you edit this file | ||
|
||
import * as monaco from 'monaco-editor'; | ||
import * as monaco from "monaco-editor"; | ||
// @ts-ignore | ||
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'; | ||
import editorWorker from "monaco-editor/esm/vs/editor/editor.worker?worker"; | ||
// @ts-ignore | ||
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker'; | ||
import jsonWorker from "monaco-editor/esm/vs/language/json/json.worker?worker"; | ||
// @ts-ignore | ||
import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker'; | ||
import cssWorker from "monaco-editor/esm/vs/language/css/css.worker?worker"; | ||
// @ts-ignore | ||
import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker'; | ||
import htmlWorker from "monaco-editor/esm/vs/language/html/html.worker?worker"; | ||
// @ts-ignore | ||
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'; | ||
import tsWorker from "monaco-editor/esm/vs/language/typescript/ts.worker?worker"; | ||
|
||
// @ts-ignore | ||
self.MonacoEnvironment = { | ||
getWorker(_: any, label: string) { | ||
if (label === 'json') { | ||
return new jsonWorker(); | ||
} | ||
if (label === 'css' || label === 'scss' || label === 'less') { | ||
return new cssWorker(); | ||
} | ||
if (label === 'html' || label === 'handlebars' || label === 'razor') { | ||
return new htmlWorker(); | ||
} | ||
if (label === 'typescript' || label === 'javascript') { | ||
return new tsWorker(); | ||
} | ||
return new editorWorker(); | ||
} | ||
getWorker(_: any, label: string) { | ||
if (label === "json") { | ||
return new jsonWorker(); | ||
} | ||
if (label === "css" || label === "scss" || label === "less") { | ||
return new cssWorker(); | ||
} | ||
if (label === "html" || label === "handlebars" || label === "razor") { | ||
return new htmlWorker(); | ||
} | ||
if (label === "typescript" || label === "javascript") { | ||
return new tsWorker(); | ||
} | ||
return new editorWorker(); | ||
}, | ||
}; | ||
|
||
monaco.languages.typescript.typescriptDefaults.setEagerModelSync(true); | ||
monaco.languages.typescript.typescriptDefaults.setEagerModelSync(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters