Skip to content

synchronize with gopls on certain events #2210

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

Merged
merged 3 commits into from
Apr 7, 2019

Conversation

bhcleek
Copy link
Collaborator

@bhcleek bhcleek commented Mar 31, 2019

do not synchronize pseudo-files with gopls
register files with gopls when FileType is set

Register files when FileType is set. This will pre-load gopls and cause
it to start tracking files before it's otherwise needed. Because gopls
will already be loaded, there is less likely to be a delay the first
time a user runs a command that needs it.

synchronize buffers with gopls

Notify gopls when buffers have changed. This won't catch all use cases,
but it least makes sure that gopls is notified when the the file is
changed on disk (e.g. via :GoFmt, :GoRename, or other actions by the
user) and when gopls should consider the file to be closed, because the
buffer was deleted.

Fixes #2207

@bhcleek bhcleek force-pushed the lsp/synchronization branch from 779ec7a to ffe2a58 Compare April 1, 2019 02:06
bhcleek added 2 commits March 31, 2019 20:11
Register files when FileType is set. This will pre-load gopls and cause
it to start tracking files before it's otherwise needed. Because gopls
will already be loaded, there is less likely to be a delay the first
time a user runs a command that needs it.
Notify gopls when buffers have changed. This won't catch all use cases,
but it least makes sure that gopls is notified when the the file is
changed on disk (e.g. via `:GoFmt`, `:GoRename`, or other actions by the
user) and when gopls should consider the file to be closed, because the
buffer was deleted.
@bhcleek bhcleek force-pushed the lsp/synchronization branch from ffe2a58 to c2fc185 Compare April 1, 2019 03:12
@bhcleek bhcleek merged commit 686167f into fatih:master Apr 7, 2019
@bhcleek bhcleek deleted the lsp/synchronization branch April 7, 2019 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Preload gopls asynchronously
1 participant