feat: support pull diagnostics in the LSP client (C#, Kotlin, etc) (#23771)
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
@@ -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] ?? [])
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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* (
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user