Skip to content

x/tools/gopls: incorrect metadata invalidation when changing package name #52500

@findleyr

Description

@findleyr

Gopls doesn't correctly invalidate package data when moving a file to a new package:
https://cs.opensource.google/go/x/tools/+/master:internal/lsp/cache/snapshot.go;l=1842;drc=37590b385d564de6d3b0aedae2b5821b3f357d1d

As a result, it's pretty easy to break gopls' metadata by toggling package names. Repro: move a file from package x_test to package x, wait a second, then move it back to package x_test: the resulting file will not be contained in any package...

Filing this issue to track the fix, and to associate with the new gopls/metadata label.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions