feat: support pull diagnostics in the LSP client (C#, Kotlin, etc) (#23771)

This commit is contained in:
Luke Parker
2026-04-23 09:24:11 +10:00
committed by Aiden Cline
parent 58db41b4b9
commit e383df4b17
12 changed files with 1123 additions and 121 deletions

View File

@@ -258,7 +258,7 @@ export const ApplyPatchTool = Tool.define(
for (const change of fileChanges) {
if (change.type === "delete") continue
const target = change.movePath ?? change.filePath
yield* lsp.touchFile(target, true)
yield* lsp.touchFile(target, "document")
}
const diagnostics = yield* lsp.diagnostics()

View File

@@ -186,7 +186,7 @@ export const EditTool = Tool.define(
})
let output = "Edit applied successfully."
yield* lsp.touchFile(filePath, true)
yield* lsp.touchFile(filePath, "document")
const diagnostics = yield* lsp.diagnostics()
const normalizedFilePath = AppFileSystem.normalizePath(filePath)
const block = LSP.Diagnostic.report(filePath, diagnostics[normalizedFilePath] ?? [])

View File

@@ -55,7 +55,7 @@ export const LspTool = Tool.define(
const available = yield* lsp.hasClients(file)
if (!available) throw new Error("No LSP server available for this file type.")
yield* lsp.touchFile(file, true)
yield* lsp.touchFile(file, "document")
const result: unknown[] = yield* (() => {
switch (args.operation) {

View File

@@ -75,7 +75,7 @@ export const ReadTool = Tool.define(
})
const warm = Effect.fn("ReadTool.warm")(function* (filepath: string) {
yield* lsp.touchFile(filepath, false).pipe(Effect.ignore, Effect.forkIn(scope))
yield* lsp.touchFile(filepath).pipe(Effect.ignore, Effect.forkIn(scope))
})
const readSample = Effect.fn("ReadTool.readSample")(function* (

View File

@@ -67,7 +67,7 @@ export const WriteTool = Tool.define(
})
let output = "Wrote file successfully."
yield* lsp.touchFile(filepath, true)
yield* lsp.touchFile(filepath, "document")
const diagnostics = yield* lsp.diagnostics()
const normalizedFilepath = AppFileSystem.normalizePath(filepath)
let projectDiagnosticsCount = 0