acme-lsp icon indicating copy to clipboard operation
acme-lsp copied to clipboard

Watch for changed files

Open fhs opened this issue 5 years ago • 4 comments

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 https://github.com/golang/go/issues/31553).

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

fhs avatar May 28 '19 07:05 fhs

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

ilanpillemer avatar Sep 18 '19 15:09 ilanpillemer

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

ilanpillemer avatar Sep 18 '19 15:09 ilanpillemer

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.

fhs avatar Sep 18 '19 17:09 fhs

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

bd339 avatar Apr 30 '22 20:04 bd339