mirror of
https://litchi.icu/ngc2207/judge.git
synced 2025-05-18 13:37:42 +00:00
fix(playground): update Monaco editor loader configuration and adjust editor reference type
This commit is contained in:
parent
d1d8edb8cc
commit
e1f51cf3b9
@ -1,6 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import * as monaco from "monaco-editor";
|
||||
import { connectToLanguageServer } from "@/lib/lsp";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { Editor, loader } from "@monaco-editor/react";
|
||||
@ -41,12 +40,13 @@ int main() {
|
||||
},
|
||||
};
|
||||
|
||||
loader.config({ monaco });
|
||||
loader.config({ paths: { vs: "/vs" } });
|
||||
|
||||
export default function PlaygroundPage() {
|
||||
const [language, setLanguage] = useState<string>("c");
|
||||
const file = files[language];
|
||||
const editorRef = useRef<monaco.editor.IStandaloneCodeEditor | null>(null);
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const editorRef = useRef<any | null>(null);
|
||||
const webSocketRef = useRef<WebSocket | null>(null);
|
||||
const languageClientRef = useRef<MonacoLanguageClient | null>(null);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user