publish bus event after TsClient diagnostics

This commit is contained in:
Alex Alecu
2026-03-17 11:26:04 +02:00
parent bf5b827f2f
commit 573680446e
+8 -1
View File
@@ -3,7 +3,8 @@
// instead of spawning a persistent typescript-language-server process.
// This drops memory from ~500MB persistent to ~50MB peak (0 idle).
import type { LSPClient } from "../lsp/client"
import { LSPClient } from "../lsp/client"
import { Bus } from "../bus"
import { TsCheck } from "./ts-check"
import { Log } from "../util/log"
import { withTimeout } from "../util/timeout"
@@ -28,6 +29,12 @@ export namespace TsClient {
for (const [file, diags] of result) {
diagnostics.set(file, diags)
}
for (const file of result.keys()) {
Bus.publish(LSPClient.Event.Diagnostics, {
path: file,
serverID: client.serverID,
})
}
})
.catch((err) => {
log.error("ts check failed", { error: err })