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

cmd/govim: become git-aware #863

Open
myitcv opened this issue Apr 17, 2020 · 1 comment
Open

cmd/govim: become git-aware #863

myitcv opened this issue Apr 17, 2020 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@myitcv
Copy link
Member

myitcv commented Apr 17, 2020

In a recent discussion with @findleyr investigating golang/go#38403, we hypothesised that one potential cause of problems could be floods of file changes sent to gopls by a govim instance accidentally left open whilst a git rebase is in progress.

@findleyr made the comment that gopls should be able to handle such cases.

But whether or not gopls can/will ever handle such cases, it seems sensible to make govim git-aware. That is to say, when git starts doing some work (that could potentially cause a storm of file changes, e.g. changing branch), put govim into a mode where it buffers file change events until the git command finishes.

This would have the massive advantage of not requiring the user to close all editor sessions (which is where the file watchers are created) every time you do something git-related.

(Incidentally, gopls will never become git-aware; the LSP server requires the client to tell it about all file events; so this is one case where the solution has to sit in the client. Contrast the alternative solution of gopls properly handling file change storms in normal operation as opposed to all clients debouncing changes; in that case, yes, all clients could debounce changes, but it makes much more sense to do that once, correctly, in the server)

cc @leitzler

@myitcv myitcv added the enhancement New feature or request label Apr 17, 2020
@myitcv myitcv added this to the Unplanned milestone Apr 17, 2020
@cespare
Copy link
Contributor

cespare commented Apr 22, 2020

In the meantime, being able to restart gopls via govim (#77) would be a massive help for these situations.

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

2 participants