mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-02 09:44:44 +08:00
Expose window.monaco back
This commit is contained in:
parent
8923e700d8
commit
ad562b8e65
2 changed files with 16 additions and 13 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
// We need to set window.MonacoEnvironment before importing vs/editor/editor.api,
|
||||||
|
// because it expects MonacoEnvironment.globalAPI to be set on import
|
||||||
|
import "./monaco_environment";
|
||||||
|
|
||||||
// For the full list of features see [1] and [2]. The Monaco Webpack
|
// For the full list of features see [1] and [2]. The Monaco Webpack
|
||||||
// plugin always ignores certain imports [3], so we ignore these as
|
// plugin always ignores certain imports [3], so we ignore these as
|
||||||
// well. On top of that, we ignore some other features which we
|
// well. On top of that, we ignore some other features which we
|
||||||
|
@ -106,19 +110,6 @@ import { PieceTreeTextBufferBuilder } from "monaco-editor/esm/vs/editor/common/m
|
||||||
|
|
||||||
import { settingsStore } from "../../../lib/settings";
|
import { settingsStore } from "../../../lib/settings";
|
||||||
|
|
||||||
window.MonacoEnvironment = {
|
|
||||||
// Certain browser extensions are Monaco-aware, so we expose it on
|
|
||||||
// the window object
|
|
||||||
globalAPI: true,
|
|
||||||
getWorkerUrl(_workerId, label) {
|
|
||||||
if (label === "json") {
|
|
||||||
return "/assets/language/json/json.worker.js";
|
|
||||||
}
|
|
||||||
|
|
||||||
return "/assets/editor/editor.worker.js";
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
// Force LF for line ending.
|
// Force LF for line ending.
|
||||||
//
|
//
|
||||||
// Monaco infers EOL based on the text content if any, otherwise uses
|
// Monaco infers EOL based on the text content if any, otherwise uses
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
window.MonacoEnvironment = {
|
||||||
|
// Certain browser extensions are Monaco-aware, so we expose it on
|
||||||
|
// the window object
|
||||||
|
globalAPI: true,
|
||||||
|
getWorkerUrl(_workerId, label) {
|
||||||
|
if (label === "json") {
|
||||||
|
return "/assets/language/json/json.worker.js";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "/assets/editor/editor.worker.js";
|
||||||
|
},
|
||||||
|
};
|
Loading…
Add table
Reference in a new issue