VIM version
VIM - Vi IMproved 8.1 (2018 May 17, compiled May 18 2018 13:18:41)
macOS version
Current Filetype:
Available Linters: []
Enabled Linters: []
Linter Variables:
Global Variables:
let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = v:null
let g:ale_command_wrapper = v:null
let g:ale_completion_delay = 100
let g:ale_completion_enabled = 1
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 = '[%linter%] %severity% [%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 = 1
let g:ale_fixers = {'python': ['isort']}
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = v:null
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 0
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 1
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 = v:null
let g:ale_list_vertical = v:null
let g:ale_loclist_msg_format = v:null
let g:ale_max_buffer_history_size = v:null
let g:ale_max_signs = v:null
let g:ale_maximum_file_size = v:null
let g:ale_open_list = v:null
let g:ale_pattern_options = {}
let g:ale_pattern_options_enabled = 0
let g:ale_set_balloons = 1
let g:ale_set_highlights = 0
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 1
let g:ale_sign_error = '•'
let g:ale_sign_info = v:null
let g:ale_sign_offset = v:null
let g:ale_sign_style_error = v:null
let g:ale_sign_style_warning = v:null
let g:ale_sign_warning = '•'
let g:ale_statusline_format = ['%d error(s)', '%d warning(s)', 'OK']
let g:ale_type_map = v:null
let g:ale_use_global_executables = v:null
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
Command History:
" Ale
let g:ale_set_highlights = 0 " Dont underline errors/warnings
nmap <silent> <Leader>k <Plug>(ale_previous_wrap)
nmap <silent> <Leader>j <Plug>(ale_next_wrap)
let g:ale_lint_on_save = 0
let g:ale_lint_on_text_changed = 1
let g:ale_sign_column_always = 1
let g:ale_sign_error = '•'
let g:ale_sign_warning = '•'
hi link ALEErrorSign GruvboxRed
hi link ALEWarningSign GruvboxYellow
let g:ale_completion_enabled = 1
I have installed pyls succesfully on my machine (it executes if I run pyls on my terminal), but for some reason ALE is not detecting it, so autocomplete doesnt work.
Steps for repeating the bug:
import numpy as np
np.a # <-- this should be autocompleting to something
Could you share :ALEInfo when you have a Python file open? Based on the output above, nothing has been loaded. Check how the plugin is installled.
Yeah, here you go, thanks @w0rp !
Current Filetype: python
Available Linters: ['flake8', 'mypy', 'prospector', 'pycodestyle', 'pyflakes', 'pylint', 'pyls']
Enabled Linters: ['flake8', 'mypy', 'pylint']
Linter Variables:
let g:ale_python_flake8_change_directory = 1
let g:ale_python_flake8_executable = 'flake8'
let g:ale_python_flake8_options = ''
let g:ale_python_flake8_use_global = 0
let g:ale_python_mypy_executable = 'mypy'
let g:ale_python_mypy_ignore_invalid_syntax = 0
let g:ale_python_mypy_options = ''
let g:ale_python_mypy_use_global = 0
let g:ale_python_pylint_change_directory = 1
let g:ale_python_pylint_executable = 'pylint'
let g:ale_python_pylint_options = ''
let g:ale_python_pylint_use_global = 0
Global Variables:
let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = 100
let g:ale_completion_enabled = 1
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_filetype_changed = 1
let g:ale_lint_on_save = 0
let g:ale_lint_on_text_changed = 1
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_list_vertical = 0
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 = v:null
let g:ale_open_list = 0
let g:ale_pattern_options = {}
let g:ale_pattern_options_enabled = 0
let g:ale_set_balloons = 1
let g:ale_set_highlights = 0
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 1
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_use_global_executables = v:null
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
Command History:
(executable check - success) flake8
(started) ['/bin/bash', '-c', '''flake8'' --version']
(executable check - failure) mypy
(executable check - failure) pylint
(finished - exit code 0) ['/bin/bash', '-c', '''flake8'' --version']
(executable check - failure) mypy
(executable check - failure) pylint
(finished - exit code 0) ['/bin/bash', '-c', 'cd ''/Users/joaqo'' && ''flake8'' --format=default --stdin-display-name ''/Users/joaqo/a.py'' - < ''/var/folders/ss/sk3lbxrj47x1x9md5y9sprrh0000gn/T/voLgSc4/4/a.py''']
<<<NO OUTPUT RETURNED>>>
Just as a fyi, I was using completor.vim for autocompleting previously, which kinda worked, but I deleted it before trying pyls, so I don't think thats the culprit.
Enabled Linters: ['flake8', 'mypy', 'pylint']
There's your issue. You'll have to enable 'pyls' as a linter to use it for completion. There's no setting for connecting to an LSP while ignoring the diagnostics yet. I've been thinking about it.
Hey @w0rp thanks for the response. I tried adding pyls to my .vimrc as you suggested and autocompletion is working now there, so thanks a lot! Unfortunately though, there's been some strange things happening:
Firstly, I am pretty sure I had already tried adding pyls as a linter in my vimrc and it hadn't worked, but maybe I didn't wait for the autocomplete to kick in (on the first run it sometimes takes a couple seconds to start showing suggestions), this is not really a problem obviously.
But secondly, and more troublingly, I tried the same vimrc and pyls installation on 2 Ubuntu machines and the autocomplete is not working there. Its weird, it works perfectly on my macOS machine but not on the Ubuntu ones. I can run pyls on the terminal on those machines and it runs, but for some reason the autocomplete is not working in vim. I'll append one of those machine's ALEInfo just in case you or someone can figure out whats wrong, thanks again!
Current Filetype: python
Available Linters: ['flake8', 'mypy', 'prospector', 'pycodestyle', 'pyflakes', 'pylint', 'pyls']
Enabled Linters: ['pyls']
Linter Variables:
let g:ale_python_pyls_executable = 'pyls'
let g:ale_python_pyls_use_global = 0
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 = 1
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_filetype_changed = 1
let g:ale_lint_on_save = 0
let g:ale_lint_on_text_changed = 1
let g:ale_lint_on_insert_leave = 0
let g:ale_linter_aliases = {}
let g:ale_linters = {'python': ['pyls']}
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 = 0
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 1
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:
(started) ['/bin/bash', '-c', '''/home/lalo/.virtualenvs/test/bin/pyls''']
Ended up running a vimdiff between the :ALEInfo on the macOS machine vs the Ubuntu machine. Turns out I had these differences:
" macOS
let g:ale_cache_executable_check_failures = 0
let g:ale_maximum_file_size = 0
let g:ale_set_balloons = 0
" Ubuntu
let g:ale_cache_executable_check_failures = v:null
let g:ale_list_vertical = 0
let g:ale_maximum_file_size = v:null
let g:ale_set_balloons = 1
let g:ale_use_global_executables = v:null
As both machines had the exact vimrc I figured these differences had to come from elsewhere, probably a different version of ALE. I updated the ALE version in my Ubuntu machine and it all got resolved! Just logging this here in case someone else has the same problem, cheers!
Cool, sounds good. :+1:
I have a similar problem with pyls enabled, but not autocompleting. Here is my vimrc:
Current Filetype: python
Available Linters: ['flake8', 'mypy', 'prospector', 'pycodestyle', 'pyflakes', 'pylint', 'pyls', 'pyre', 'vulture']
Enabled Linters: ['pyls']
Suggested Fixers:
'add_blank_lines_for_python_control_statements' - Add blank lines before control statements.
'autopep8' - Fix PEP8 issues with autopep8.
'black' - Fix PEP8 issues with black.
'isort' - Sort Python imports with isort.
'remove_trailing_lines' - Remove all blank lines at the end of a file.
'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
'yapf' - Fix Python files with yapf.
Linter Variables:
let g:ale_python_pyls_executable = '/Users/esn89/Library/Python/2.7/bin/pyls'
let g:ale_python_pyls_use_global = 1
Global Variables:
let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = v:null
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = v:null
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_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_completion_enabled = 0
That'll be your issue.
Thanks. !
Most helpful comment
There's your issue. You'll have to enable
'pyls'as a linter to use it for completion. There's no setting for connecting to an LSP while ignoring the diagnostics yet. I've been thinking about it.