ale icon indicating copy to clipboard operation
ale copied to clipboard

Error when trying to use ale

Open vikramsg opened this issue 9 years ago • 27 comments

I installed vim 8 from source and setup PATH to point to the installation. Then I installed ale using Vundle. But whenever I try to use vim I get the following error

"!s:has_features" [Not edited] --No lines in buffer-- Error detected while processing /home/vikram/.vim/bundle/ale/plugin/ale.vim: line 23: ALE requires NeoVim >= 0.1.5 or Vim 8 with +timers +job +channel line 24: Please update your editor appropriately.

vikramsg avatar Jan 23 '17 19:01 vikramsg

Can you paste the output of

vim --version | grep 'timers\|job\|channel'

ninjawithaneedle avatar Jan 24 '17 05:01 ninjawithaneedle

+channel -hangul_input +netbeans_intg +timers +clipboard +job +path_extra +user_commands

vikramsg avatar Jan 24 '17 09:01 vikramsg

Can you find out which of https://github.com/w0rp/ale/blob/d7ed49f84964aebdaa180b553e83943cd85c5d20/plugin/ale.vim#L19 is causing s:has_features to be false?

vim +'if has("timers")
    echom("timers")
if exists("*job_start")
    echom("job_start")
if exists("*ch_close_in")
    echom("ch_close_in")
' +messages

What does the above command output?

ninjawithaneedle avatar Jan 24 '17 09:01 ninjawithaneedle

timers job_start ch_close_in Messages maintainer: Bram Moolenaar [email protected] timers job_start ch_close_in

vikramsg avatar Jan 24 '17 10:01 vikramsg

That is weird. Are you sure, you are seeing the error with the version of vim you used above? It sounds like you have two vim binaries in your path. Just making sure.

ninjawithaneedle avatar Jan 24 '17 10:01 ninjawithaneedle

I do have two vim binaries. One is the original vim that is 7. And one that I installed and am pointing to by setting the PATH variable. So once I start using vim after this, I should only be getting vim 8, right. This is what vim --version tells me.

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 23 2017 20:30:21) Included patches: 1-222

vikramsg avatar Jan 24 '17 13:01 vikramsg

I'm guessing that something is wrong with the version of Vim you compiled. Maybe try compiling a newer version of Vim.

w0rp avatar Jan 24 '17 14:01 w0rp

I compiled directly from the git source.

vikramsg avatar Jan 24 '17 14:01 vikramsg

I just performed a git revert XXXXX and got this too although I installed Ale through vim-plug.

$ vim --version | grep 'timers\|job\|channel'
+channel         -hangul_input    +netbeans_intg   +timers
+clipboard       +job             +path_extra      +user_commands
$ vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 31 2017 07:14:31)
...
...
$ which vim
/usr/local/bin/vim

I'm on macOS Sierra and I installed Vim 8 using brew install vim.

fredrikaverpil avatar Feb 11 '17 18:02 fredrikaverpil

Could you paste the output for the following?

:echo has('timers')
:echo exists('*job_start')
:echo exists('*ch_close_in')

That's what the plugin tests for if you're using Vim.

w0rp avatar Feb 11 '17 22:02 w0rp

I recommend installing MacVim from the official release binaries posted on GitHub. https://github.com/macvim-dev/macvim/releases

w0rp avatar Feb 11 '17 22:02 w0rp

I made a screen recording: https://asciinema.org/a/6w3129na3gu33a86l7w3qwy40 I don't think this is an Ale issue, at least not in my case. But I'm not sure what's going on...

fredrikaverpil avatar Feb 13 '17 21:02 fredrikaverpil

That series of errors is interesting.

The first error is that the features check fails.

let s:has_features = has('timers') && exists('*job_start') && exists('*ch_close_in')

That's what ALE checks for in Vim. Now you're running it there while editing a git commit message, so that might have some special behaviour.

The following errors come from airline's integration with ALE, and I can fix that pretty easily. It's complaining because a global variable for ALE isn't defined, because the check which stops ALE from doing anything meaningful happens before that variable is defined. So, I can just define the variables before the check is made, and those errors will go away.

Could you paste the output of the :echo lines I mentioned above? Do you get this when running Vim all the time, or just when editing git commits?

w0rp avatar Feb 13 '17 21:02 w0rp

I might silence the warning if the filetype is something for git commits.

w0rp avatar Feb 13 '17 21:02 w0rp

The output of all the echo lines were 1 when vim worked fine and they were all 0 during the git commit editing.

fredrikaverpil avatar Feb 13 '17 21:02 fredrikaverpil

Aha! So the errors only appear while editing diffs with git, then? I think I should be able to repeat that and fix it. ALE just shouldn't do much of anything while you're using Vim to edit a commit message, etc.

w0rp avatar Feb 13 '17 21:02 w0rp

So the errors only appear while editing diffs with git, then?

For me, yep, this only happens during git editing of a diff or revert.

fredrikaverpil avatar Feb 13 '17 22:02 fredrikaverpil

If you try again now, those particular errors should hopefully be gone.

w0rp avatar Feb 13 '17 23:02 w0rp

I performed a :PlugUpdate, tried again and I got this:

screen shot 2017-02-14 at 08 28 13

Hitting enter a few times and I see this:

screen shot 2017-02-14 at 08 30 07

fredrikaverpil avatar Feb 14 '17 07:02 fredrikaverpil

Okay, I have pushed a patch now which should get airline to shut the Hell up in these situations. Now there are two global flags set by ALE for loading. There is g:loaded_ale, which other plugins can check to see if ALE is installed, and g:loaded_ale_dont_use_this_in_other_plugins_please, which no plugin should ever use. Hopefully the name should make that obvious enough.

w0rp avatar Feb 14 '17 09:02 w0rp