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

cursor moves falsely in Go files for code completion with deoplete #3699

Open bon-ami opened 3 years ago

bon-ami commented 3 years ago

Information

VIM version

NVIM v0.5.0-746-gf7cc3ae0b Build type: RelWithDebInfo Operating System: Windows 10

What went wrong

After every character I type in a go file, ALE detects the error (since I have not yet finished a word), and moves my cursor one character back where the "error" is.

part of related init.vim (config file for my neovim) Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' } let g:deoplete#enable_atstartup = 1 call deoplete#custom#option('sources', { '': ['ale'] }) "vim-go let g:go_code_completion_enabled = 0 "ale let g:ale_completion_autoimport = 1 let g:ale_linters = { 'go': ['gopls'] }

Reproducing the bug

  1. type a character such as i
  2. the cursor goes back to before i

:ALEInfo

Current Filetype: go Available Linters: ['bingo', 'gobuild', 'gofmt', 'golangci-lint', 'golint', 'gometalinter', 'gopls', 'gosimple', 'gotype', 'govet', 'golangserver', 'revive', 'staticcheck'] Linter Aliases: 'gobuild' -> ['go build'] 'govet' -> ['go vet'] Enabled Linters: ['gopls'] Ignored Linters: [] Suggested Fixers: 'gofmt' - Fix Go files with go fmt. 'goimports' - Fix Go files imports with goimports. '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. Linter Variables:

let g:ale_go_go_executable = 'go' let g:ale_go_golangci_lint_executable = 'golangci-lint' let g:ale_go_golangci_lint_options = '--enable-all' let g:ale_go_golangci_lint_package = 0 let g:ale_go_gopls_executable = 'gopls' let g:ale_go_gopls_init_options = {} let g:ale_go_gopls_options = '--mode stdio' let g:ale_go_langserver_executable = 'go-langserver' let g:ale_go_langserver_options = '' 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_disable_lsp = 0 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 = {'go': ['gopls']} let g:ale_linters_explicit = 0 let g:ale_linters_ignore = {} let g:ale_list_vertical = 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 = 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_root = {} 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_sign_highlight_linenrs = 0 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:

(executable check - success) gopls (started) 'cmd /s/c "gopls --mode stdio"'

bon-ami commented 3 years ago

reproduced with following setting, let g:deoplete#enable_at_startup = 0 let g:ale_completion_enabled = 1