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

ALE's completion source for deoplete prevents you from pressing enter sometimes #2492

Closed
edgard opened this issue May 11, 2019 · 27 comments
Closed
Labels

Comments

@edgard
Copy link

edgard commented May 11, 2019

I'm currently using deoplete for my completion needs. While it mostly works together with ale, there are still some annoyances that happens when the two are loaded in.

For example, right now, if a complete is started, i can't double-enter to just enter the word without any completion. ALE hijacks the menu and keeps it open.

Is there a way to complete disable all completion integration/functions on ALE?

@w0rp
Copy link
Member

w0rp commented May 11, 2019

Use let g:ale_completion_enabled = 0, which is the default.

@w0rp w0rp closed this as completed May 11, 2019
@edgard
Copy link
Author

edgard commented May 11, 2019

This is not really working. Even with the completion_enabled = 0, there seems to be some kind of hijacking happening on the completion menu.

https://asciinema.org/a/qmNGrVXR260LOYSxMUNJEiBtH

You can see that with ALE enabled when i type "set" and enter, it doesn't matter how many times i press enter, it never leaves the line and do the enter. Even with the option set. As soon as I disable ALE, it works.

@w0rp
Copy link
Member

w0rp commented May 11, 2019

Which version of Vim are you using? That shouldn't happen.

@edgard
Copy link
Author

edgard commented May 11, 2019

Neovim 0.3.5

@w0rp
Copy link
Member

w0rp commented May 11, 2019

Does it stop happening when you use :ALEDisable?

@edgard
Copy link
Author

edgard commented May 11, 2019

Nope, still happens. :(

@w0rp
Copy link
Member

w0rp commented May 11, 2019

Have you tried setting let g:ale_completion_enabled = 0 before ALE is loaded? I recommend getting on #vim-ale on Freenode to talk about this more, as that will be faster.

@w0rp w0rp reopened this May 11, 2019
@w0rp w0rp added the bug label May 11, 2019
@w0rp w0rp changed the title Way to completely disable completion ALE's completion source for deoplete prevents you from pressing enter sometimes May 11, 2019
@w0rp
Copy link
Member

w0rp commented May 11, 2019

We spoke about this on IRC. A minimal config for repeating this bug is here: https://gist.github.com/edgard/8bb9c4d7596cc20a645f1f690c19007d

The problem appears to be caused by context['is_async'] = True in the completion source for deoplete, which is what the deoplete documentation tells you to do. This doesn't need to be done for languages ALE can't prevent completion data for, but it still breaks it anyway. Replacing return [] with return None at the end seems to fix the problem, even though the documentation tells you not to do that.

I've pushed that change now. Let me know if it fixes the bug.

@w0rp
Copy link
Member

w0rp commented May 11, 2019

If that fixes the bug, then I'll also throw in a check later to disable the source if there aren't any language server linters available for the current filetype that ALE can use to provide completion information. That will prevent some more issues in the future.

@edgard
Copy link
Author

edgard commented May 11, 2019

Yep! Updated from repo and re-added noinsert to completeopt and now it seems to be working properly! Awesome! Thanks!

@w0rp
Copy link
Member

w0rp commented May 11, 2019

Great! Thank you for letting me know about the bug. Later on, someone can tweak the completion source to not even try to provide completion data if the buffer doesn't have any ALE linters enabled which can provide completion data.

@w0rp w0rp closed this as completed May 11, 2019
@dsifford
Copy link
Contributor

So.... Hate to be the bearer of bad news, but... This update for whatever reason bricked ale's completion completely for me. Completion from ale is no longer listed at all.

@dsifford
Copy link
Contributor

And I just confirmed that reverting the return None back to return [] fixes the issue.

@w0rp w0rp reopened this May 11, 2019
@w0rp
Copy link
Member

w0rp commented May 11, 2019

@dsifford Okay, do you want to fix it? Try to make it work without also causing the issue brought up here.

@dsifford
Copy link
Contributor

Can't dig into it until maybe sometime next week. But just for the time being, can you or @edgard confirm that you're even able to get ale to completions through deoplete anymore?

Because if we "fixed" the issue of having to hit enter twice to insert a newline by bricking the ale completions completely, I'd consider that more of a regression than a fix and it should be reverted immediately until the real issue can be found.

@w0rp
Copy link
Member

w0rp commented May 12, 2019

I'd rather not include Deoplete integration than have it cause problems for people. I think the easiest way to fix this would be to add the check to see if the buffer has linters enabled, and then return None if there aren't any. I'll do that soon, and then both things should work.

w0rp added a commit that referenced this issue May 12, 2019
@w0rp
Copy link
Member

w0rp commented May 12, 2019

@edgard @dsifford Okay, git pull again and try that out. Now None should be returned when there's nothing that ALE could get completion information from, and [] will be returned when ALE is able to ask for some completion data. Hopefully that should work.

@dsifford
Copy link
Contributor

@w0rp You are the master. 🥇

After trying it for a minute or two, it seems to be working as expected again for me. I'll report back if something turns up, but looks like it should be good now. 🙏

@w0rp
Copy link
Member

w0rp commented May 12, 2019

Great! 👍 I'll wait for a response from @edgard before closing this.

@edgard
Copy link
Author

edgard commented May 12, 2019

Just to confirm that it still works! Thank you!! :)

@w0rp
Copy link
Member

w0rp commented May 12, 2019

Okay, thank you for letting me know. 👍

@w0rp w0rp closed this as completed May 12, 2019
@moritzheiber
Copy link

I'm hitting this bug again right now, after having updated my plugins. As far as I can see the latest commit which is supposedly "fixing" this issue was included in the update. I also run Deoplete and Ale side-by-side. Forcefully disabling Ale (just commenting Plug w0rp/ale) "fixes" it, although that would probably not be my preferred solution. I'd be happy for any pointers.

@w0rp
Copy link
Member

w0rp commented May 16, 2019

Would you like to try and fix it?

@moritzheiber
Copy link

@w0rp Absolutely, what should I do?

@w0rp w0rp reopened this May 16, 2019
@w0rp
Copy link
Member

w0rp commented May 16, 2019

Okay, I'm going to remove the Deoplete completion source until someone can fix it.

@moritzheiber
Copy link

For context, we had a chat on IRC and "solved" it by disabling deoplete as a completion source

@w0rp w0rp closed this as completed in 975cc7a May 16, 2019
@w0rp
Copy link
Member

w0rp commented May 16, 2019

I remove Deoplete support completely for now, until this can be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants