Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: no AST for file after adding and removing file #34218

Closed
inliquid opened this issue Sep 10, 2019 · 6 comments
Closed

x/tools/gopls: no AST for file after adding and removing file #34218

inliquid opened this issue Sep 10, 2019 · 6 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@inliquid
Copy link

  1. VS Code
  2. gopls@master
  3. Windows

After adding model/friends.go and then removing it, I'm getting this error anytime I want to import model package:

could not import ***/***/***/pkg/data/model (failed to cache file file:///c:/Users/***/***/***/***/***/***/pkg/data/model/friends.go: no AST for file:///c:/Users/***/***/***/***/***/***/pkg/data/model/friends.go: open c:\Users\***\***\***\***\***\***\pkg\data\model\friends.go: The system cannot find the file specified.)
@gopherbot gopherbot added this to the Unreleased milestone Sep 10, 2019
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Sep 10, 2019
@stamblerre
Copy link
Contributor

Support for watching changed files is still experimental. Can you reproduce this issue if you add the following to your VSCode settings?

"gopls": {
    "watchFileChanges": true
}

@inliquid
Copy link
Author

I added and removed file from the editor, not externally. Do you mean that gopls will not recognize even those changes made with the editor?

@inliquid
Copy link
Author

I checked and got same issue with "watchFileChanges": true.

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 12, 2019
@pdf
Copy link

pdf commented Oct 15, 2019

Possibly related #34678

@gopherbot
Copy link

Change https://golang.org/cl/201221 mentions this issue: internal/lsp: modify approach to watching changed files

@golang golang deleted a comment from gopherbot Oct 17, 2019
gopherbot pushed a commit to golang/tools that referenced this issue Oct 22, 2019
This change modifies the invalidContent function to take a file change
type. This allows us to eliminate the separate invalidateMetadata
function. The logic of watching changed files is then further pushed
into the caching layer.

Updates golang/go#34218

Change-Id: Id31b3931c45ec408b6e7b4a362e00f9091ba4f70
Reviewed-on: https://go-review.googlesource.com/c/tools/+/201221
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
@stamblerre
Copy link
Contributor

Duplicate of #31553

@stamblerre stamblerre marked this as a duplicate of #31553 Dec 4, 2019
@golang golang locked and limited conversation to collaborators Dec 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants