Skip to content

Commit 57b2e64

Browse files
chore: generate
1 parent 346b3e1 commit 57b2e64

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

packages/opencode/src/tool/write.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ export const WriteTool = Tool.defineEffect(
3333
}),
3434
execute: (params: { content: string; filePath: string }, ctx: Tool.Context) =>
3535
Effect.gen(function* () {
36-
const filepath = path.isAbsolute(params.filePath) ? params.filePath : path.join(Instance.directory, params.filePath)
36+
const filepath = path.isAbsolute(params.filePath)
37+
? params.filePath
38+
: path.join(Instance.directory, params.filePath)
3739
yield* assertExternalDirectoryEffect(ctx, filepath)
3840

3941
const exists = yield* fs.existsSafe(filepath)
@@ -74,7 +76,9 @@ export const WriteTool = Tool.defineEffect(
7476
if (errors.length === 0) continue
7577
const limited = errors.slice(0, MAX_DIAGNOSTICS_PER_FILE)
7678
const suffix =
77-
errors.length > MAX_DIAGNOSTICS_PER_FILE ? `\n... and ${errors.length - MAX_DIAGNOSTICS_PER_FILE} more` : ""
79+
errors.length > MAX_DIAGNOSTICS_PER_FILE
80+
? `\n... and ${errors.length - MAX_DIAGNOSTICS_PER_FILE} more`
81+
: ""
7882
if (file === normalizedFilepath) {
7983
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>`
8084
continue

0 commit comments

Comments
 (0)