Skip to content

Commit

Permalink
Fix the monaco loader
Browse files Browse the repository at this point in the history
  • Loading branch information
msm-code committed Jan 24, 2024
1 parent bb85348 commit 980f429
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/mqueryfront/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"@fortawesome/fontawesome-svg-core": "^1.2.36",
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"@fortawesome/react-fontawesome": "^0.1.16",
"@monaco-editor/react": "3.7.5",
"monaco-editor": "^0.21.2",
"@monaco-editor/react": "^4.4.6",
"monaco-editor": "^0.34.1",
"axios": "^1.3.4",
"bootstrap": "^5.1.3",
"filesize": "^8.0.6",
Expand Down
11 changes: 6 additions & 5 deletions src/mqueryfront/src/query/QueryMonaco.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React, { Component } from "react";
import Editor, { monaco } from "@monaco-editor/react";
import * as monaco from "monaco-editor/esm/vs/editor/edcore.main"
import Editor, { loader } from "@monaco-editor/react";
import YARA from "./yara-lang";

monaco.config({ paths: { vs: "/monaco-vs" } });
loader.config({monaco});

class QueryMonaco extends Component {
constructor(props) {
Expand All @@ -17,7 +18,7 @@ class QueryMonaco extends Component {
return;
}

monaco.init().then((monaco) => {
loader.init().then((monaco) => {
this.decorations = this.editor.getModel().deltaDecorations(
[],
[
Expand All @@ -42,7 +43,7 @@ class QueryMonaco extends Component {
handleEditorDidMount(_, editor) {
this.editor = editor;

monaco
loader
.init()
.then((monaco) => {
editor.onDidChangeModelContent((ev) => {
Expand Down Expand Up @@ -122,7 +123,7 @@ class QueryMonaco extends Component {
* Monaco editor initialization
*/

monaco.init().then((monaco) => {
loader.init().then((monaco) => {
// Register a new yara language
monaco.languages.register({ id: "yara" });

Expand Down

0 comments on commit 980f429

Please sign in to comment.