Change information
Commit message:
gopls/internal/mcp: fix reporting in go_diagnostics tool
The go_diagnostics tool reports parse and build errors
across the entire workspace. If an array of files
is provided, it reports additional diagnostics (i.e. quick
fixes and go/analysis findings).
The additional diagnostic reporting is broken when
the tool input has more than one file because we
always use the uri of the first file in the input array.
If the input is ["a.go", "b.go"], diagnostics for "b.go"
are reported as coming from "a.go".
Use the correct uri for the diagnostic and add
tests to verify that diagnostics are reported
with the correct file.
Fixes golang/go#79892
Change-Id: I76c506377cdf05ed0e86a799c00085f286701923
Files:
- M gopls/internal/mcp/workspace_diagnostics.go
- M gopls/internal/test/marker/testdata/mcptools/workspace_diagnostics.txt
Change size: S
Delta: 2 files changed, 38 insertions(+), 4 deletions(-)
Branch: refs/heads/master