-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gopls/internal/lsp/cache: simplify DiagnosePackage
Previously Snapshot.DiagnosePackage would run after type checking, would conditionally invoke the analysis framework just for type error analyzers, and would then munge those diagnostics together with those from type checking, eliminate duplicates and migrating the suggested fixes onto the type-checker errors. However, all its callers immediately then invoke the analysis framework for the full suite for analyzers. This change separates the three steps more clearly: 1) type checking, which produces list/parse/type errors, now available at Package.DiagnosticsForFile(URI). 2) analysis using all analyzers, including the type-error analyzers, which are no longer special. (Consequently the analyzers' findings are reported in more tests.) 3) munging of the results together, in source.CombineDiagnostics. The munging algorithm is no longer quadratic in the number of combined elements. This change removes one of the blockers to the new analysis driver implementation in CL 443099. The tests were updated to assert that type-error analyzers run whenever we see type checker diagnostics. This was painful to do, even by the standards to which we have become accustomed. Change-Id: I2393ad5bc13587ff4bfed86ae586ce658074a501 Reviewed-on: https://go-review.googlesource.com/c/tools/+/456643 Run-TryBot: Alan Donovan <adonovan@google.com> Reviewed-by: Robert Findley <rfindley@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
- Loading branch information
Showing
14 changed files
with
152 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.