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

Watch for changed files #6

Open
fhs opened this issue May 28, 2019 · 4 comments
Open

Watch for changed files #6

fhs opened this issue May 28, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@fhs
Copy link
Collaborator

fhs commented May 28, 2019

When files are changed outside of acme (e.g. git branch change), gopls currently doesn't update its cache. We should implement workspace/didChangeWatchedFiles when gopls supports it (issue golang/go#31553).

We may want to have a temporary workaround for gopls. Perhaps just watch for all matching (.go) files in the workspaces?

@fhs fhs added the enhancement New feature or request label May 28, 2019
fhs added a commit that referenced this issue Jun 8, 2019
Before we were only handling put for formatting.
Now we handle all events related to file synchronization.
We also send all open files to LSP server on startup.

Helps #6
fhs added a commit that referenced this issue Jun 8, 2019
Before we were only handling put for formatting.
Now we handle all events related to file synchronization.
We also send all open files to LSP server on startup.

Helps #6
fhs added a commit that referenced this issue Jun 8, 2019
Before we were only handling put for formatting.
Now we handle all events related to file synchronization.
We also send all open files to LSP server on startup.

Helps #6
@ilanpillemer
Copy link
Contributor

I just ran into this issue. Is the only solution to restart gopls at the moment?

@ilanpillemer
Copy link
Contributor

fyi, I asked on the gopls channel in slack, and apparently file watching is on the roadmap for gopls.

@fhs
Copy link
Collaborator Author

fhs commented Sep 18, 2019

You can execute Get in the window to reload the file in gopls. That usually works if the set of files didn't change, but if you add/remove files, gopls might get so confused that you need to restart it.

@bd339
Copy link

bd339 commented Apr 30, 2022

From the looks of the issue mentioned, this now works in gopls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants