Skip to content

Commit 8d1f71a

Browse files
findleyrgopherbot
authored andcommitted
gopls/internal/mcp: avoid pointless diagnostics in the edit workflow
In practice, I frequently see models make a plan that involves multiple files, edit just one of those files, and then run diagnostics, only to observe that diagnostics in related files are consistent with the plan. Hint to apply all edits before running diagnostics, to avoid churn. Change-Id: I16183b3b05638cbf5a1be1a92759e144aca896cc Reviewed-on: https://go-review.googlesource.com/c/tools/+/687876 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Hongxiang Jiang <[email protected]> Auto-Submit: Robert Findley <[email protected]>
1 parent 95aad07 commit 8d1f71a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gopls/internal/mcp/instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The editing workflow is iterative. You should cycle through these steps until th
3636
2. **Find references**: Before modifying the definition of any symbol, use the `go_symbol_references` tool to find all references to that identifier. This is critical for understanding the impact of your change. Read the files containing references to evaluate if any further edits are required.
3737
EXAMPLE: `go_symbol_references({"file":"/path/to/server.go","symbol":"Server.Run"})`
3838

39-
3. **Make edits**: Make the primary edit, as well as any edits to references you identified in the previous step.
39+
3. **Make edits**: Make the required edits, including edits to references you identified in the previous step. Don't proceed to the next step until all planned edits are complete.
4040

4141
4. **Check for errors**: After every code modification, you MUST call the `go_diagnostics` tool. Pass the paths of the files you have edited. This tool will report any build or analysis errors.
4242
EXAMPLE: `go_diagnostics({"files":["/path/to/server.go"]})`

0 commit comments

Comments
 (0)