dense-analysis / dense-analysis/ale

Add support for completion inside paired delimiters

Open
#2,105 9 comments 0 reactions 0 assignees View on GitHub
bug LSP
Dominant language
Vim Script
Stars
14k
Forks
1.5k
Avg merge
17h 49m
Merged PRs (30d)
1

Description

It seems that language server completions are not suggested for snippets inside paired delimiters. This makes it difficult to use ALE in conjunction with a delimiter auto-pairing plugin (or when delimiters are manually paired). This does not appear to be a limitation of the language servers, as other LSP clients (e.g., LanguageClient-neovim) can make suggestions inside paired delimiters.

Working examples for golang and python.

screen shot 2018-11-26 at 3 17 14 pm
screen shot 2018-11-26 at 3 18 44 pm

Examples of no completion suggestions when typing inside paired function delimeters:

screen shot 2018-11-26 at 3 17 53 pm
screen shot 2018-11-26 at 3 19 15 pm

This is with the following ALE config:

```vim
Current Filetype: python
Available Linters: ['flake8', 'mypy', 'prospector', 'pycodestyle', 'pyflakes', 'pylint', 'pyls', 'pyre', 'vulture']
Enabled Linters: ['flake8', '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_flake8_auto_pipenv = 0
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_pyls_auto_pipenv = 0
let g:ale_python_pyls_executable = 'pyls'
let g:ale_python_pyls_use_global = 0
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 = ''
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%]% 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 = {'*': ['remove_trailing_lines', 'trim_whitespace'], 'python': ['black']}
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_insert_leave = 0
let g:ale_lint_on_save = 0
let g:ale_lint_on_text_changed = 'never'
let g:ale_linter_aliases = {}
let g:ale_linters = {'go': ['golangserver'], 'python': ['pyls', 'flake8']}
let g:ale_linters_explicit = 0
let g:ale_list_vertical = v:null
let g:ale_list_window_size = v:null
let g:ale_loclist_msg_format = v:null
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = v:null
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 1
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
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 = v:null
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 = v:null
let g:ale_type_map = v:null
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 0
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
Command History:
(started) ['/bin/zsh', '-c', '''pyls''']
```

Moreover, the minimal RC file used is:

```vim
if has('nvim')
let vimplug = "$XDG_DATA_HOME/nvim/site/autoload/plug.vim"
else
let vimplug = "~/.vim/autoload/plug.vim"
endif

let plugins = "$XDG_DATA_HOME/nvim/site/plugins"

let g:ale_completion_enabled = 1

if empty(glob(vimplug))
execute ' !curl -fLo ' . vimplug . ' --create-dirs ' .
\ 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync
endif

call plug#begin(plugins)

Plug 'w0rp/ale'

call plug#end()

let g:ale_linters = {
\ 'python': ['pyls', 'flake8'],
\ 'go': ['golangserver'],
\ }
let g:ale_fixers= {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'python': ['black'],
\ }
let g:ale_fix_on_save = 1
let g:ale_completion_enabled = 1
let g:ale_completion_delay = 100
let g:ale_echo_msg_format = '[%linter%]% code%: %s'
let g:ale_lint_on_enter = 0
let g:ale_lint_on_save = 0
let g:ale_lint_on_text_changed = 'never'
let g:ale_open_list = 1
let g:ale_set_ballons = 1

" set completeopt=longest,menuone,preview,noselect
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.