lsp: improve user experience with null modules #2300
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 beforecalling it in order to avoid Vim errors.
lsp: handle using gopls outside of GOPATH mode and module mode
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.