dense-analysis / ale

Check syntax in Vim/Neovim asynchronously and fix files, with Language Server Protocol (LSP) support
BSD 2-Clause "Simplified" License
13.56k stars 1.44k forks source link

Error when processing .fish file #1373

Closed larribas closed 6 years ago

larribas commented 6 years ago

Information

VIM version

NVIM v0.2.3-dev
Build type: RelWithDebInfo

Operating System: Linux - Ubuntu

:ALEInfo

:ALEInfo
 Current Filetype: fish
Available Linters: ['fish']
  Enabled Linters: ['fish']
 Linter Variables:

 Global Variables:

let g:ale_cache_executable_check_failures = 0
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = 100
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = 50
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%code: %%s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 0
let g:ale_fixers = {}
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'always'
let g:ale_lint_on_insert_leave = 0
let g:ale_linter_aliases = {}
let g:ale_linters = {}
let g:ale_linters_explicit = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = 0
let g:ale_open_list = 0
let g:ale_pattern_options = {}
let g:ale_pattern_options_enabled = 0
let g:ale_set_balloons = 0
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = '>>'
let g:ale_sign_info = '--'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = '>>'
let g:ale_sign_style_warning = '--'
let g:ale_sign_warning = '--'
let g:ale_statusline_format = ['%d error(s)', '%d warning(s)', 'OK']
let g:ale_type_map = {}
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
  Command History:
(executable check - success) fish
(started) ['/bin/sh', '-c', 'fish -n ''/tmp/nvim1CKyeZ/2/aliases.fish''']
(finished - exit code 127) ['/bin/sh', '-c', 'fish -n ''/tmp/nvim1CKyeZ/3/aliases.fish''']

<<<OUTPUT STARTS>>>
/tmp/nvim1CKyeZ/3/aliases.fish (line 2): abbr -a mkdir='mkdir -p'
                                         ^
/tmp/nvim1CKyeZ/3/aliases.fish (line 3): abbr -a e='eval $EDITOR'
                                         ^
/tmp/nvim1CKyeZ/3/aliases.fish (line 6): abbr -a bi='bundle install'
                                         ^
/tmp/nvim1CKyeZ/3/aliases.fish (line 7): abbr -a be='bundle exec'
                                         ^
/tmp/nvim1CKyeZ/3/aliases.fish (line 19): abbr -a dc='docker-compose'
                                          ^
<<<OUTPUT ENDS>>>

What went wrong

The following error is printed.

"fish/.config/omf/aliases.fish" 19L, 352C
Error detected while processing function gitgutter#process_buffer[8]..gitgutter#diff#run_d
iff[2]..<SNR>135_NeoVimCallback[29]..<SNR>132_HandleExit[41]..ale_linters#fish#fish#Handle
:
line   14:
E684: list index out of range: 10
E116: Invalid arguments for function len
E116: Invalid arguments for function add

Reproducing the bug

Opening a .fish file with nvim

larribas commented 6 years ago

I'm sorry that I don't have more time right now to look further into the error. It seems to happen for all .fish files.

It could be a gitgutter issue. The lines above don't mean a lot for me. But maybe you can double check and see if they ring like a potential bug in ale.

Thank you for the plugin, btw, great work ;)

w0rp commented 6 years ago

The error format in the test didn't match what fish -n returns in Linux, so I made the error handler handle both error formats.

actionless commented 6 years ago

this change seems to be conflicting with this documentation lines so they should be synchronized with the actual behavior or behavior should be fixed:

https://github.com/w0rp/ale/blob/b047271051d8ef448bf4bac120234205310b232a/doc/ale-fish.txt#L10-L11

actionless commented 6 years ago

also, false-positive results (usually to abbr and alias commands, like in the log provided in the first message) are related to this: https://github.com/fish-shell/fish-shell/issues/977