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

lsp: improve user experience with null modules #2300

Merged
merged 7 commits into from
May 19, 2019

Conversation

bhcleek
Copy link
Collaborator

@bhcleek bhcleek commented May 19, 2019

complete: handle lsp completion error

Call the completion handler with a start position of -1 when there is no
completion start position. The value will not be used, but is necessary
due to the expectations of the callback.

Fixes #2294

lsp: avoid Vim errors when gopls cannot be started

Set the sendMessage method of the lsp instance to a noop when lsp cannot
be started due to not having async jobs available so that the functions
that use sendMessage don't have to check whether it's available before
calling it in order to avoid Vim errors.

lsp: handle using gopls outside of GOPATH mode and module mode
  • warn the user when trying to use gopls when in neither GOPATH mode nor
    module mode.
  • do not initialize gopls when in neither GOPATH mode nor module mode.
completion: cancel when go#lsp#Complete returns non-zero

Cancel completion when go#lsp#Complete returns non-zero. This happens,
for instance, when gopls cannot be initialized due to the file being in
neither GOPATH mode nor in module mode.

help: add an entry to the FAQ about gopls

Add an entry to the FAQ to explain some of the limitations of gopls and
how to work around them.

help: add an FAQ entry about troubleshooting

Add an FAQ entry about using g:go_debug to troubleshoot problems.

Call the completion handler with a start position of -1 when there is no
completion start position. The value will not be used, but is necessary
due to the expectations of the callback.

Fixes fatih#2294
Set the sendMessage method of the lsp instance to a noop when lsp cannot
be started due to not having async jobs available so that the functions
that use `sendMessage` don't have to check whether it's available before
calling it in order to avoid Vim errors.
* warn the user when trying to use gopls when in neither GOPATH mode nor
  module mode.
* do not initialize gopls when in neither GOPATH mode nor module mode.
Cancel completion when `go#lsp#Complete` returns non-zero. This happens,
for instance, when gopls cannot be initialized due to the file being in
neither GOPATH mode nor in module mode.
Add an entry to the FAQ to explain some of the limitations of gopls and
how to work around them.
Add an FAQ entry about using g:go_debug to troubleshoot problems.
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.

completion doesn't work in files that aren't saved to disk
1 participant