Skip to content

x/tools/gopls: add a work-around for file watching bug in VS Code #40812

Open
@stamblerre

Description

@stamblerre

VS Code currently does not allow the language server to watch files outside of the workspace root: microsoft/vscode#100870.

This means that users who open subdirectories of modules or modules with replace directives may see bugs because gopls's view of the workspace state is incorrect.

@heschik has suggested that we should add a work-around to address this -- we could clear out the entire cache when we see >= 10 (or fewer?) batched didChangeWatchedFiles notifications. We can do this for any module with a replace directive or for any workspace whose root is not the module root.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ToolsThis 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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions