[I] ServerHost
Environment and client callbacks needed to embed the TypeSpec language server.
Properties
Section titled “Properties”| Property | Modifier | Type | Description |
|---|---|---|---|
applyEdit | readonly | (paramOrEdit) => Promise<ApplyWorkspaceEditResult> | Ask the client to apply a workspace edit, for example to repair imports after a file rename. |
compilerHost | readonly | CompilerHost | Base compiler I/O host; the server wraps it to read open documents and cache files. |
getOpenDocumentByURL | readonly | (url) => TextDocument | undefined | Look up the current open document by its original URI; return undefined for closed documents. |
log | readonly | (log) => void | Receive server messages for display, persistence, or filtering by the embedding application. |
sendDiagnostics | readonly | (params) => void | Publish diagnostics to the client, including empty lists that clear previously reported diagnostics. |
throwInternalErrors? | readonly | boolean | Rethrow unexpected compilation errors instead of publishing error diagnostics. Defaults to false. |