Skip to content

x/tools/gopls: automatically include open packages in the workspace #54261

@findleyr

Description

@findleyr

Noticed indirectly via #53933: when packages are outside of the workspace, autocompletion stops working because it operates on packages in "TypeCheckWorkspace" mode, which means it does have function bodies for packages outside of the workspace.

That's not wrong, but we should automatically include any open packages in the workspace.

For the most part it should "just work" to adjust our workspace package algorithm, we just need to be sure to recompute workspace packages (snapshot.computeWorkspacePackages) following any didOpen or didClose event.

This is low-hanging fruit, as particularly with #53880 it could significantly improve the user experience with go.work files when opening a package outside the workspace: some functionality will still work, and the user will be alerted that other functionality will be degraded.

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 goplsgopls/workspaceIssues related to support for modules or multi-module workspaces.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions