VIM version
NVIM v0.5.0-853-ge192a4600
Build type: RelWithDebInfo
Operating System:
Arch Linux
5.9.9
Diagnosic issues are not updated correctly after running ALEFix. Highlights becomes stuck and a ALEReset is necessary. This is highly replicated with the latest code.
Reverting to b74827de99e842dc7698d8d6274486550d90f05a solves all these issues.
coc-nvim and use displayByAle. If I run :ALEFix prettier for the below code it will incorrectly complain:import { useEffect } from 'react'
import { ResizeObserver, ResizeObserverEntry } from '@juggle/resize-observer'
export const useResizeObserver = (el: React.RefObject<HTMLElement>, handler: (entry: ResizeObserverEntry) => void) => {
useEffect(() => {
const currentEl = el.current
const resizeObserver = new ResizeObserver((entries) => {
const [entry] = entries
handler(entry)
})
if (currentEl != null) {
resizeObserver.observe(currentEl, { box: 'border-box' })
}
return () => {
if (currentEl != null) {
resizeObserver.unobserve(currentEl)
}
}
}, [el, handler])
}

Current Filetype: typescript
Available Linters: ['eslint', 'standard', 'tslint', 'tsserver', 'typecheck', 'xo', 'csslint', 'fecs', 'stylelint']
Enabled Linters: ['eslint', 'stylelint']
Ignored Linters: []
Suggested Fixers:
'eslint' - Apply eslint --fix to a file.
'prettier' - Apply prettier to a file.
'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.
'tslint' - Fix typescript files with tslint --fix.
'xo' - Fix JavaScript/TypeScript files using xo --fix.
Linter Variables:
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 = 1
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '[%linter%] %s (%code%)'
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 = {'yaml': ['prettier'], 'typescript': ['prettier'], 'scss': ['prettier'], 'json': ['prettier'], 'javascriptreact': ['prettier'], 'sh': ['shfmt'], 'html': ['prettier'], 'javascript': ['prettier'], 'typescriptreact': ['prettier'], 'css': ['prettier'], 'markdown': ['prettier']}
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 = 400
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 = 0
let g:ale_lint_on_text_changed = 'normal'
let g:ale_linter_aliases = {'typescript': ['typescript', 'css'], 'javascript': ['javascript', 'css'], 'typescriptreact': ['typescript', 'css'], 'javascriptreact': ['javascript', 'css'], 'html': ['html', 'css', 'javascript'], 'mail': ['text']}
let g:ale_linters = {'help': ['alex', 'proselint', 'write-good'], 'typescript': ['stylelint', 'eslint'], 'scss': ['stylelint'], 'typescriptreact': ['stylelint', 'eslint'], 'javascriptreact': ['stylelint', 'eslint'], 'sh': ['shellcheck'], 'text': ['alex', 'proselint', 'write-good'], 'javascript': ['stylelint', 'eslint'], 'css': ['stylelint'], 'markdown': ['alex', 'proselint', 'write-good'], 'mail': ['alex', 'proselint', 'write-good']}
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 = '[%linter%] %s (%code%)'
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_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 = 1
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
Command History:
(executable check - success) /home/sqve/code/game/node_modules/eslint/bin/eslint.js
(finished - exit code 0) ['/usr/bin/zsh', '-c', 'cd ''/home/sqve/code/game'' && ''/home/sqve/code/game/node_modules/eslint/bin/eslint.js'' -f json --stdin --stdin-filename ''/home/sqve/code/game/src/hooks/useResizeObserver.ts'' < ''/tmp/nvimfX50QU/4/useResizeObserver.ts''']
<<<OUTPUT STARTS>>>
[{"filePath":"/home/sqve/code/game/src/hooks/useResizeObserver.ts","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"handle-callback-err","replacedBy":[]},{"ruleId":"no-negated-in-lhs","replacedBy":["no-unsafe-negation"]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"no-path-concat","replacedBy":[]},{"ruleId":"jsx-a11y/accessible-emoji","replacedBy":[]}]}]
<<<OUTPUT ENDS>>>
(executable check - success) /home/sqve/code/game/node_modules/.bin/stylelint
(finished - exit code 0) ['/usr/bin/zsh', '-c', '''/home/sqve/code/game/node_modules/.bin/stylelint'' --stdin-filename ''/home/sqve/code/game/src/hooks/useResizeObserver.ts'' < ''/tmp/nvimfX50QU/5/useResizeObserver.ts''']
<<<NO OUTPUT RETURNED>>>
(started) ['/usr/bin/zsh', '-c', 'cd ''/home/sqve/code/game'' && ''/home/sqve/code/game/node_modules/eslint/bin/eslint.js'' -f json --stdin --stdin-filename ''/home/sqve/code/game/src/hooks/useResizeObserver.ts'' < ''/tmp/nvimfX50QU/6/useResizeObserver.ts''']
(finished - exit code 0) ['/usr/bin/zsh', '-c', '''/home/sqve/code/game/node_modules/.bin/stylelint'' --stdin-filename ''/home/sqve/code/game/src/hooks/useResizeObserver.ts'' < ''/tmp/nvimfX50QU/7/useResizeObserver.ts''']
<<<NO OUTPUT RETURNED>>>
(finished - exit code 0) ['/usr/bin/zsh', '-c', '''/home/sqve/code/game/node_modules/.bin/prettier'' --version']
<<<OUTPUT STARTS>>>
2.2.0
<<<OUTPUT ENDS>>>
(finished - exit code 0) ['/usr/bin/zsh', '-c', 'cd ''/home/sqve/code/game'' && ''/home/sqve/code/game/node_modules/.bin/prettier'' --stdin-filepath ''/home/sqve/code/game/src/hooks/useResizeObserver.ts'' --stdin < ''/tmp/nvimfX50QU/8/useResizeObserver.ts''']
(finished - exit code 0) ['/usr/bin/zsh', '-c', 'cd ''/home/sqve/code/game'' && ''/home/sqve/code/game/node_modules/eslint/bin/eslint.js'' -f json --stdin --stdin-filename ''/home/sqve/code/game/src/hooks/useResizeObserver.ts'' < ''/tmp/nvimfX50QU/9/useResizeObserver.ts''']
<<<OUTPUT STARTS>>>
[{"filePath":"/home/sqve/code/game/src/hooks/useResizeObserver.ts","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"handle-callback-err","replacedBy":[]},{"ruleId":"no-negated-in-lhs","replacedBy":["no-unsafe-negation"]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"no-path-concat","replacedBy":[]},{"ruleId":"jsx-a11y/accessible-emoji","replacedBy":[]}]}]
<<<OUTPUT ENDS>>>
(finished - exit code 0) ['/usr/bin/zsh', '-c', '''/home/sqve/code/game/node_modules/.bin/stylelint'' --stdin-filename ''/home/sqve/code/game/src/hooks/useResizeObserver.ts'' < ''/tmp/nvimfX50QU/10/useResizeObserver.ts''']
<<<NO OUTPUT RETURNED>>>
I'm facing a similar issue, where the errors are displaced by one. It seems like the code has changed but ALE didn't update the cursor markers on that change.

Here's my ale specific configs:
" ale --- {{{
let g:ale_sign_column_always = 1
let g:ale_lint_on_text_changed = 'never'
let g:ale_lint_on_enter = 0
let g:ale_lint_on_filetype_changed = 0
" By default it expects .eslintrc jo be at the root
" For custom eslintrc use:
" let g:ale_javascript_eslint_options = '--config ./config/eslint.config.js'
" Auto fix linting errors on save
let g:ale_linter_aliases = {'jsx': ['css', 'javascript']}
let g:ale_fixers = {
\ 'typescript': ['prettier', 'eslint'],
\ 'typescriptreact': ['prettier', 'eslint'],
\ 'javascript': ['prettier', 'eslint'],
\ 'javascriptreact': ['prettier', 'eslint'],
\ 'scss': ['prettier'],
\ 'css': ['prettier']
\}
let g:ale_fix_on_save = 1
" }}}
I'm having the same issue. The incorrect error messages all come from tsserver, which seems to indicate that the problem could be on coc.nvim's side (though I'm nowhere near knowledgeable enough to say that for sure).
For the moment, I'm using vim-prettier, which doesn't have the same issue.
@jose-elias-alvarez I would assume that issue stems from ale as reverting to a past commit of ale fixes the issues.
I'm having the same issue but with a python source, so it's not only with tsserver
Cannot reproduce the issue on my environment but looking at the commits the only change that may cause an issue like this is this one:
commit 6bebdcfa30b492b7c71316b707d36c4f4d19a1f1
Date: Fri Sep 18 12:11:05 2020 +0200
Improves fixer performance for large buffers
Would be possible for someone experiencing the issue to test with this commit and without it? Or better use git bisect to determine the exact commit that is causing the issue.
well, at least my problem is apparently related to coc.nvim and not ale.
results of my git bisect (in coc.nvim):
git bisect start
# good: [25171cab9b9e9628ba0f82d2974f0e6fd6ab7112] fix: diagnostic.refreshAfterSave (#1236)
git bisect good 25171cab9b9e9628ba0f82d2974f0e6fd6ab7112
# bad: [c9041340eb15f516b562b8fbfcd3c7bd43a63075] commit 652a8a3381aba871030c4845d5932fdab9a6b09d
git bisect bad c9041340eb15f516b562b8fbfcd3c7bd43a63075
# good: [73c05a0871b69b1b2b2475cd8616c7dd8c155306] feat(list): support first option
git bisect good 73c05a0871b69b1b2b2475cd8616c7dd8c155306
# good: [df839e641b927c9424e33f8eb70d009feb1c01b3] fix(float): avoid possible float winid
git bisect good df839e641b927c9424e33f8eb70d009feb1c01b3
# good: [37e2b9d0f87d72950047641e2f6a7a4b0f204248] fix(completion): avoid unnecessary completion refresh
git bisect good 37e2b9d0f87d72950047641e2f6a7a4b0f204248
# good: [adacff28dfabfead7770a1c716006793eeb47e37] feat(language-client): log child process error
git bisect good adacff28dfabfead7770a1c716006793eeb47e37
# good: [df7b5d4f4e64d5dc2fa24dbf8143109afa93539c] commit 721f227aa06ccf2f651ecc00c78502ece1d1aa6b
git bisect good df7b5d4f4e64d5dc2fa24dbf8143109afa93539c
# good: [2476d24473aa01c68012e06a23da83515696a523] commit 0de7494ffe4a4c97ad79d4e0a18e3cf84ddf6468
git bisect good 2476d24473aa01c68012e06a23da83515696a523
# bad: [dce1b5cb87cbafae20a24fe3b17fe9648e84dd4e] commit 7e550643a530e1de72d82e33d8b159d200aa8873
git bisect bad dce1b5cb87cbafae20a24fe3b17fe9648e84dd4e
# bad: [63cbd7bfecb6ed5598b136e859c675ae8e7156ea] commit 437fdaadabe7821f0100748fc8ca8c2f493d5476
git bisect bad 63cbd7bfecb6ed5598b136e859c675ae8e7156ea
# good: [1fe1e02eca07fe1fbe9427e2e8a1b29289f281be] commit 464bb069e2aa19b07a1bd52b77210888aba45187
git bisect good 1fe1e02eca07fe1fbe9427e2e8a1b29289f281be
# first bad commit: [63cbd7bfecb6ed5598b136e859c675ae8e7156ea] commit 437fdaadabe7821f0100748fc8ca8c2f493d5476
@sQVe This seems to have been a problem on coc.nvim side that is already fixed. Would be appreciated if you can verify the issue is solved and close this issue.
@sQVe This seems to have been a problem on coc.nvim side that is already fixed. Would be appreciated if you can verify the issue is solved and close this issue.
I've actually gone and moved all handling of diagnostics over to coc.nvim. I might find time to check this sometime in the future but it will not be a priority.
Maybe we should close this and reopen it if needed?
FWIW, I'm using "diagnostic.displayByAle": true in coc.nvim and it seems to working fine for me now.