Compare commits

...

5 Commits

Author SHA1 Message Date
celestial-vault eab3d9eacb add code back after merge with main 2025-07-14 16:41:00 -07:00
celestial-vault 375dc5d76b merge conflicts 2025-07-14 15:36:17 -07:00
celestial-vault 3296b2700f merge conflicts 2025-06-18 18:17:09 -07:00
celestial-vault 681c1d525a changeset 2025-06-10 23:47:06 -07:00
celestial-vault 4b7c927122 pass linter errors with read_file 2025-06-10 23:44:03 -07:00
2 changed files with 25 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": minor
---
Pass linter diagnostics with the read_file tool
+20 -1
View File
@@ -41,6 +41,7 @@ import os from "os"
import * as path from "path"
import { serializeError } from "serialize-error"
import * as vscode from "vscode"
import { diagnosticsToProblemsString } from "@integrations/diagnostics"
import { ToolResponse, USE_EXPERIMENTAL_CLAUDE4_FEATURES } from "."
import { ToolParamName, ToolUse, ToolUseName } from "../assistant-message"
import { constructNewFileContent } from "../assistant-message/diff"
@@ -839,10 +840,28 @@ export class ToolExecutor {
// now execute the tool like normal
const content = await extractTextFromFile(absolutePath)
// Get diagnostics for this specific file only
const fileUri = vscode.Uri.file(absolutePath)
const fileDiagnostics = vscode.languages.getDiagnostics(fileUri)
// Format diagnostics if any exist
let diagnosticsMessage = ""
if (fileDiagnostics.length > 0) {
const problemsString = await diagnosticsToProblemsString(
[[fileUri, fileDiagnostics]],
[vscode.DiagnosticSeverity.Error, vscode.DiagnosticSeverity.Warning],
)
diagnosticsMessage = `\n\n---\nNOTE: This file has linter issues. Only address these if they're relevant to your current task:\n${problemsString}\n---`
}
// Combine content with diagnostics
const finalContent = content + diagnosticsMessage
// Track file read operation
await this.fileContextTracker.trackFileContext(relPath, "read_tool")
this.pushToolResult(content, block)
this.pushToolResult(finalContent, block)
await this.saveCheckpoint()
break
}