The open source coding agent.
TypeScript
tweak: adjust lsp wording a bit more to encourage fixing
Aiden Cline096e14d787ad
diff --git a/packages/opencode/src/tool/edit.ts b/packages/opencode/src/tool/edit.tsindex 7ace4e4a262..26db5b22836 100644--- a/packages/opencode/src/tool/edit.ts+++ b/packages/opencode/src/tool/edit.ts@@ -129,7 +129,7 @@ export const EditTool = Tool.define("edit", {const limited = errors.slice(0, MAX_DIAGNOSTICS_PER_FILE)const suffix =errors.length > MAX_DIAGNOSTICS_PER_FILE ? `\n... and ${errors.length - MAX_DIAGNOSTICS_PER_FILE} more` : ""- output += `\n\nLSP errors detected in this file:\n<diagnostics file="${filePath}">\n${limited.map(LSP.Diagnostic.pretty).join("\n")}${suffix}\n</diagnostics>`+ output += `\n\nLSP errors detected in this file, please fix:\n<diagnostics file="${filePath}">\n${limited.map(LSP.Diagnostic.pretty).join("\n")}${suffix}\n</diagnostics>`}return {diff --git a/packages/opencode/src/tool/write.ts b/packages/opencode/src/tool/write.tsindex d621a6e26bf..cfcf6a0dab7 100644--- a/packages/opencode/src/tool/write.ts+++ b/packages/opencode/src/tool/write.ts@@ -59,7 +59,7 @@ export const WriteTool = Tool.define("write", {const suffix =errors.length > MAX_DIAGNOSTICS_PER_FILE ? `\n... and ${errors.length - MAX_DIAGNOSTICS_PER_FILE} more` : ""if (file === normalizedFilepath) {- output += `\n\nLSP errors detected in this file:\n<diagnostics file="${filepath}">\n${limited.map(LSP.Diagnostic.pretty).join("\n")}${suffix}\n</diagnostics>`+ output += `\n\nLSP errors detected in this file, please fix:\n<diagnostics file="${filepath}">\n${limited.map(LSP.Diagnostic.pretty).join("\n")}${suffix}\n</diagnostics>`continue}if (projectDiagnosticsCount >= MAX_PROJECT_DIAGNOSTICS_FILES) continue