mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 07:16:34 +00:00
fix(code-editor): simplify onMount callback parameters for clarity
This commit is contained in:
parent
4aee0048ab
commit
4557cee251
@ -44,9 +44,8 @@ export default function CodeEditor() {
|
|||||||
const serverConfig = SUPPORTED_LANGUAGE_SERVERS.find((s) => s.id === language);
|
const serverConfig = SUPPORTED_LANGUAGE_SERVERS.find((s) => s.id === language);
|
||||||
|
|
||||||
if (serverConfig) {
|
if (serverConfig) {
|
||||||
const lspUrl = `${serverConfig.protocol}://${serverConfig.hostname}${
|
const lspUrl = `${serverConfig.protocol}://${serverConfig.hostname}${serverConfig.port ? `:${serverConfig.port}` : ""
|
||||||
serverConfig.port ? `:${serverConfig.port}` : ""
|
}${serverConfig.path || ""}`;
|
||||||
}${serverConfig.path || ""}`;
|
|
||||||
const url = normalizeUrl(lspUrl);
|
const url = normalizeUrl(lspUrl);
|
||||||
const webSocket = new WebSocket(url);
|
const webSocket = new WebSocket(url);
|
||||||
|
|
||||||
@ -109,7 +108,7 @@ export default function CodeEditor() {
|
|||||||
beforeMount={(monaco) => {
|
beforeMount={(monaco) => {
|
||||||
shikiToMonaco(highlighter, monaco);
|
shikiToMonaco(highlighter, monaco);
|
||||||
}}
|
}}
|
||||||
onMount={(editor, _monaco) => {
|
onMount={(editor) => {
|
||||||
setEditor(editor);
|
setEditor(editor);
|
||||||
}}
|
}}
|
||||||
// onValidate={(markers) => {
|
// onValidate={(markers) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user