From 4557cee251d9a5ce5ac373978e198c70adf04d09 Mon Sep 17 00:00:00 2001 From: cfngc4594 Date: Mon, 24 Feb 2025 13:34:56 +0800 Subject: [PATCH] fix(code-editor): simplify onMount callback parameters for clarity --- src/components/code-editor.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/code-editor.tsx b/src/components/code-editor.tsx index d82fa9f..1119300 100644 --- a/src/components/code-editor.tsx +++ b/src/components/code-editor.tsx @@ -44,9 +44,8 @@ export default function CodeEditor() { const serverConfig = SUPPORTED_LANGUAGE_SERVERS.find((s) => s.id === language); if (serverConfig) { - const lspUrl = `${serverConfig.protocol}://${serverConfig.hostname}${ - serverConfig.port ? `:${serverConfig.port}` : "" - }${serverConfig.path || ""}`; + const lspUrl = `${serverConfig.protocol}://${serverConfig.hostname}${serverConfig.port ? `:${serverConfig.port}` : "" + }${serverConfig.path || ""}`; const url = normalizeUrl(lspUrl); const webSocket = new WebSocket(url); @@ -109,7 +108,7 @@ export default function CodeEditor() { beforeMount={(monaco) => { shikiToMonaco(highlighter, monaco); }} - onMount={(editor, _monaco) => { + onMount={(editor) => { setEditor(editor); }} // onValidate={(markers) => {