Open rhysd opened 3 years ago
@w0rp This issue is related to https://github.com/prabirshrestha/vim-lsp/issues/882
After some investigation, I found that this issue no longer occurred when modifying the code as follows:
set nocompatible
filetype plugin indent on
set rtp+=~/.vim/bundle/ale
let g:ale_set_signs = 1
let g:ale_linters = {}
let g:ale_linters['text'] = ['my-test-linter']
augroup SomeGroupName
autocmd!
autocmd User ALEWantResults call Hook(g:ale_want_results_buffer)
augroup END
function! ShowResults(buffer) abort
let item = {
\ 'bufnr': a:buffer,
\ 'lnum': 1,
\ 'col': 1,
\ 'vcol': 0,
\ 'text': 'this is dummy error message for buffer ' . a:buffer,
\ 'type': 'E',
\ }
call ale#other_source#ShowResults(a:buffer, 'my-test-linter', [item])
endfunction
function! Hook(buffer) abort
call ale#other_source#StartChecking(a:buffer, 'my-test-linter')
call timer_start(0, {-> ShowResults(a:buffer)})
endfunction
Seems that calling ale#other_source#ShowResults
and ale#other_source#StartChecking
synchronously causes this issue.
It's probably some weird bug I need to look into. I'm not sure exactly what, but it's probably something I can fix by playing around with it until it works. If calling the functions from an asynchronous callback works, you can just call them from 0
millisecond timers like you did above for now.
Yes, I added the workaround so this is not blocking issue for me though running code through timer is slower than running it synchronously. So if fixing this issue is hard or time consuming, please feel free to close this as wontfix. In the case, updating document to describe the function is only available in an async callback would be helpful.
Information
VIM version
Operating System: macOS 10.15
What went wrong
I'm making a bridge plugin between vim-lsp and ALE. I noticed that sign is not set when calling
ale#other_source#ShowResults
. Sign is not put even ifsigncolumn=yes
is set (default value isauto
).Reproducing the bug
Assuming that ALE is installed in
~/.vim/bundle
directory.vim -u test_vimrc test.txt
:ALEInfo