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

LSP completions trigger linting #2675

Closed
frangio opened this issue Aug 3, 2019 · 1 comment
Closed

LSP completions trigger linting #2675

frangio opened this issue Aug 3, 2019 · 1 comment

Comments

@frangio
Copy link
Contributor

frangio commented Aug 3, 2019

In a Rust file with completions enabled, when the completions are triggered the diagnostics are updated as if linting had been triggered. This naturally results in several errors caused by being mid-edit, and is specially annoying with slow LSP servers like RLS because by the time the diagnostics are shown as highlights they're out of sync with the actual buffer contents.

Looking at the code and tinkering with it I'm thinking it may be the following line that's causing this behavior. It would also explain why I'm not seeing the behavior with tsserver, since it's handled differently.

" Send a message saying the buffer has changed first, otherwise
" completions won't know what text is nearby.
call ale#lsp#NotifyForChanges(l:id, l:buffer)

Information

NVIM v0.3.8
Build type: Release

Operating System: Linux

:ALEInfo

 Current Filetype: rust
Available Linters: ['cargo', 'rls', 'rustc']
  Enabled Linters: ['rls']
 Suggested Fixers: 
  'remove_trailing_lines' - Remove all blank lines at the end of a file.
  'rustfmt' - Fix Rust files with Rustfmt.
  'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
 Linter Variables:

let g:ale_rust_rls_config = {}
let g:ale_rust_rls_executable = 'rls'
let g:ale_rust_rls_toolchain = ''
 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_insert_leave = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'normal'
let g:ale_linter_aliases = {}
let g:ale_linters = {'javascript': ['tsserver'], 'rust': ['rls'], 'typescript': ['tsserver']}
let g:ale_linters_explicit = 0
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_lsp_root = {}
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 = 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 = 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 = v:null
let g:ale_type_map = {}
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/sh', '-c', '''rls''']
@w0rp
Copy link
Member

w0rp commented Aug 19, 2019

This problem can't be fixed without changing language server protocol itself. See here: microsoft/language-server-protocol#737

@w0rp w0rp closed this as completed Aug 19, 2019
@w0rp w0rp added the wontfix label Aug 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants