fix(code-editor): simplify onMount callback parameters for clarity

This commit is contained in:
cfngc4594 2025-02-24 13:34:56 +08:00
parent 4aee0048ab
commit 4557cee251

View File

@ -44,8 +44,7 @@ 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}` : ""
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) => {