Skip to content

x/tools/gopls: slow diagnostics after adding/removing an import #61344

Closed
@findleyr

Description

@findleyr

I just noticed that in certain packages, diagnostics are very slow after adding or removing an import (or making any other metadata-affecting change).

It looks like I introduced an awaitLoaded(...) call into the critical path re-typechecking a package (via resolveImportGraph). When the package being edited is low level, this results in reloading its entire reverse-transitive closure.

As an invariant, we should always be able to operate on the current package without reloading everything.

  • add a benchmark for this operation, which is common thanks to goimports on save
  • fix the logic of resolveImportGraph

Metadata

Metadata

Assignees

Labels

FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions