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
Milestone

Comments

@inliquid
Copy link

@inliquid inliquid commented Sep 10, 2019

  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 label Sep 10, 2019
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Sep 10, 2019

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

@inliquid inliquid commented Sep 10, 2019

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

@inliquid inliquid commented Sep 10, 2019

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

@gopherbot gopherbot added the Tools label Sep 12, 2019
@pdf
Copy link

@pdf pdf commented Oct 15, 2019

Possibly related #34678

@gopherbot
Copy link

@gopherbot gopherbot commented Oct 17, 2019

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

@stamblerre stamblerre commented Dec 4, 2019

Duplicate of #31553

@stamblerre stamblerre marked this as a duplicate of #31553 Dec 4, 2019
@stamblerre stamblerre closed this Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.