File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 22
33## [ Unreleased]
44
5+ - Fix LSP published diagnostics to filter to the opened file.
56- Add ` textDocument/documentSymbol ` support for ` buf lsp serve ` .
67
78## [ v1.59.0] - 2025-10-20
Original file line number Diff line number Diff line change @@ -459,7 +459,7 @@ func (f *file) RefreshIR(ctx context.Context) {
459459 Session : session ,
460460 }
461461 })
462- results , report , err := incremental .Run (
462+ results , diagnosticReport , err := incremental .Run (
463463 ctx ,
464464 f .lsp .queryExecutor ,
465465 queries ... ,
@@ -480,8 +480,12 @@ func (f *file) RefreshIR(ctx context.Context) {
480480 file .IndexSymbols (ctx )
481481 }
482482 }
483+ // Only hold on to diagnostics where the primary span is for this path.
484+ fileDiagnostics := xslices .Filter (diagnosticReport .Diagnostics , func (d report.Diagnostic ) bool {
485+ return d .Primary ().Path () == f .objectInfo .Path ()
486+ })
483487 diagnostics , err := xslices .MapError (
484- report . Diagnostics ,
488+ fileDiagnostics ,
485489 reportDiagnosticToProtocolDiagnostic ,
486490 )
487491 if err != nil {
You can’t perform that action at this time.
0 commit comments