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

Symbols in information column of omnicomplete #2094

Open chopfitzroy opened 5 years ago

chopfitzroy commented 5 years ago

Information

VIM version

NVIM v0.2.2
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

Operating System:

Debian Buster

What went wrong

Using a minimal init.vim with completion the following symbols are in the omnicompletion description column {^@ I am going to hazard a guess and say these are line breaks and come from LSP/tsserver.

Would it be possible to omit them, or replace them with a ... and put the whole output (with line breaks) in the buffer up the top (I forget what this is called)

Reproducing the bug

I have uploaded a screenshot of what it looks like here here.

My init.vim:

if empty(glob('~/.config/nvim/autoload/plug.vim'))
  silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

let g:ale_completion_enabled = 1
let g:ale_completion_max_suggestions = 10

call plug#begin('~/.vim/plugged')
Plug 'w0rp/ale'
call plug#end()

set completeopt=menu,menuone,preview,noselect,noinsert

:ALEInfo

Current Filetype: javascript
Available Linters: ['eslint', 'flow', 'flow-language-server', 'jscs', 'jshint', 'standard', 'tsserver', 'xo']
  Enabled Linters: ['eslint', 'flow', 'flow-language-server', 'jscs', 'jshint', 'standard', 'tsserver', 'xo']
 Suggested Fixers:
  'eslint' - Apply eslint --fix to a file.
  'importjs' - automatic imports for javascript
  'prettier' - Apply prettier to a file.
  'prettier_eslint', 'prettier-eslint' - Apply prettier-eslint to a file.
  'prettier_standard', 'prettier-standard' - Apply prettier-standard to a file.
  'remove_trailing_lines' - Remove all blank lines at the end of a file.
  'standard' - Fix JavaScript files using standard --fix
  'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
  'xo' - Fix JavaScript files using xo --fix.
 Linter Variables:
let g:ale_javascript_eslint_executable = 'eslint'
let g:ale_javascript_eslint_options = ''
let g:ale_javascript_eslint_suppress_eslintignore = 0
let g:ale_javascript_eslint_suppress_missing_config = 0
let g:ale_javascript_eslint_use_global = 0
let g:ale_javascript_flow_executable = 'flow'
let g:ale_javascript_flow_ls_executable = 'flow'
let g:ale_javascript_flow_ls_use_global = 0
let g:ale_javascript_flow_use_global = 0
let g:ale_javascript_flow_use_home_config = 0
let g:ale_javascript_flow_use_respect_pragma = 1
let g:ale_javascript_jscs_executable = 'jscs'
let g:ale_javascript_jscs_use_global = 0
let g:ale_javascript_jshint_executable = 'jshint'
let g:ale_javascript_jshint_use_global = 0
let g:ale_javascript_standard_executable = 'standard'
let g:ale_javascript_standard_options = ''
let g:ale_javascript_standard_use_global = 0
let g:ale_javascript_tsserver_config_path = ''
let g:ale_javascript_tsserver_executable = 'tsserver'
let g:ale_javascript_tsserver_use_global = 0
let g:ale_javascript_xo_executable = 'xo'
let g:ale_javascript_xo_options = ''
let g:ale_javascript_xo_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 = 10
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 = 0
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'always'
let g:ale_linter_aliases = {}
let g:ale_linters = {}
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_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:
(executable check - failure) eslint
(executable check - failure) jscs
(executable check - failure) jshint
(executable check - failure) standard
(executable check - failure) xo
(executable check - failure) eslint
(executable check - failure) jscs
(executable check - failure) jshint
(executable check - failure) standard
(executable check - failure) xo
(executable check - failure) eslint
(executable check - failure) jscs
(executable check - failure) jshint
(executable check - failure) standard
(executable check - failure) xo
(executable check - failure) eslint
(executable check - failure) jscs
(executable check - failure) jshint
(executable check - failure) standard
(executable check - failure) xo
w0rp commented 5 years ago

Can you produce a minimal project which repeats the bug? That will make it easier to track down where the message is coming from.

chopfitzroy commented 5 years ago

Sure,

Using the above init.vim:

if empty(glob('~/.config/nvim/autoload/plug.vim'))
  silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

let g:ale_completion_enabled = 1
let g:ale_completion_max_suggestions = 10

call plug#begin('~/.vim/plugged')
Plug 'w0rp/ale'
call plug#end()

set completeopt=menu,menuone,preview,noselect,noinsert

And having tsserver installed, editing a .js file type: Can, it should show the error for all of the Canvas* entries.

Is this what you were asking for?

w0rp commented 5 years ago

Do you have a package.json file I could built a project with, to test this with? I'd like to try with something which produces the same output.

chopfitzroy commented 5 years ago

Hey,

I don't actually have a package.json this just happens when I work with any .js file (haven't tried .ts as I haven't used TypeScript yet) I did open the project in a fresh loopback project and I was able to replicate, I could create a repo for this, but from what I can tell you should be able to reproduce anywhere.

Before we go any further I am correct in thinking I can use tsserver for .js files to?

Cheers.

w0rp commented 5 years ago

Yes, you should be able to use tsserver for .js files. I use tsserver with ALE every day at work, and I haven't seen this issue yet. There may be some more configuration required for repeating this bug.

chopfitzroy commented 5 years ago

Okay I thought it might be my terminal (I use alacritty) but I tested it with gnome-terminal and was able to reproduce the same output. Is there anything custom that needs to be done to set up tsserver appropriately?

w0rp commented 5 years ago

tsserver should work pretty much straight away if you have installed TypeScript into node_modules.

chopfitzroy commented 5 years ago

I am using a global install of TypeScript I wonder if this is the issue, should I try a local install next to my .js files?

w0rp commented 5 years ago

You should just be able to install it into node_modules with npm install or yarn, and it will work without you having to change any settings.