Skip to content

[I] ServerHost

Environment and client callbacks needed to embed the TypeSpec language server.

PropertyModifierTypeDescription
applyEditreadonly(paramOrEdit) => Promise<ApplyWorkspaceEditResult>Ask the client to apply a workspace edit, for example to repair imports after a file rename.
compilerHostreadonlyCompilerHostBase compiler I/O host; the server wraps it to read open documents and cache files.
getOpenDocumentByURLreadonly(url) => TextDocument | undefinedLook up the current open document by its original URI; return undefined for closed documents.
logreadonly(log) => voidReceive server messages for display, persistence, or filtering by the embedding application.
sendDiagnosticsreadonly(params) => voidPublish diagnostics to the client, including empty lists that clear previously reported diagnostics.
throwInternalErrors?readonlybooleanRethrow unexpected compilation errors instead of publishing error diagnostics. Defaults to false.