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); 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) => {