vim/ALE 问题的一些故障排除技巧是什么

What are some troubleshooting techniques for vim/ALE issues

我将 vim 与 w0rp/ale(又名 dense-analysis/ale)一起使用,并且已经使用了好几年。它突然停止工作,我不明白为什么。它既不会 lint 也不会修复。

ALEInfo 显示看似正常的值,但命令历史记录中没有任何命令。

如果我 运行 命令 eslint -f unix --stdin --stdin-filename src/App.js < src/App.js 我会返回预期的 eslint 错误(其中两个)。

(已更新)但是请注意,ALECodeAction returns No active LSPs

我已经尝试删除我的 .eslintrc.json 以防它出现错误(运气不好),并尝试简化/尝试 g:ale_linters 的新组合以防出现问题,但也没有爱.

对某些故障排除方法有什么建议吗?

这是我在 .vimrc:

中尝试过的各种配置
let g:ale_linters_explicit = 1
let g:ale_linter_aliases = {'jsx': ['css', 'javascript']}
let g:ale_sign_column_always = 1
" extended logging
let g:ale_history_log_output = 1
let g:ale_history_enabled = 1

" new fixers & linters 2021-01-15
" let g:ale_fixers = {'javascript': ['xo'], "json": ['prettier']}
" let g:ale_linters = {'javascript': ['xo', 'prettier', 'eslint']}

" ole fixers & linters working until prettier install/Grant
let g:ale_fixers = {
\   '*': ['remove_trailing_lines', 'trim_whitespace'],
\   'javascript': ['eslint'],
\}

" " Only run linters named in ale_linters settings.
let g:ale_linters = {
\   'javascript': ['stylelint', 'eslint'],
\   'jsx': ['stylelint', 'eslint'],
\   'javascript.jsx': ['stylelint', 'eslint'],
\   'bash': ['sh'],
\}

这是 ALEInfo(已更新):

 Current Filetype: javascript.jsx
Available Linters: ['eslint', 'fecs', 'flow', 'flow-language-server', 'jscs', 'jshint', 'standard', 'tsserver', 'xo', 'csslint', 'fecs', 'stylelint', 'eslint', 'fecs', 'flow', 'flow-language-server', 'jscs', 'jshint', 'standard', 'tsserver', 'xo']
  Enabled Linters: ['stylelint', 'eslint']
  Ignored Linters: []
 Suggested Fixers: 
  'eslint' - Apply eslint --fix to a file.
  'fecs' - Apply fecs format 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/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 = v:null
let g:ale_command_wrapper = v:null
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 = v:null
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 = {'*': ['remove_trailing_lines', 'trim_whitespace'], 'javascript': ['eslint']}
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = v:null
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 = {'jsx': ['css', 'javascript']}
let g:ale_linters = {'jsx': ['stylelint', 'eslint'], 'javascript.jsx': ['stylelint', 'eslint'], 'bash': ['sh'], 'javascript': ['stylelint', 'eslint']}
let g:ale_linters_explicit = 1
let g:ale_linters_ignore = {}
let g:ale_list_vertical = v:null
let g:ale_list_window_size = v:null
let g:ale_loclist_msg_format = v:null
let g:ale_lsp_root = {}
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = v:null
let g:ale_maximum_file_size = v:null
let g:ale_open_list = v:null
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 = 1
let g:ale_sign_error = v:null
let g:ale_sign_info = v:null
let g:ale_sign_offset = v:null
let g:ale_sign_style_error = v:null
let g:ale_sign_style_warning = v:null
let g:ale_sign_warning = v:null
let g:ale_sign_highlight_linenrs = v:null
let g:ale_statusline_format = v:null
let g:ale_type_map = v:null
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:

天哪:我不知道发生了什么,但它又开始工作了!也许在我遇到这种 ALE 问题之前,我在几个小时内尝试了很多事情(ALE 是我工作流程的基础)none 其中似乎有帮助:

  1. 重新安装 ALE
  2. 重新安装 stylelint,eslint 包括 npx eslint --init 以开始清理
  3. 尝试更漂亮
  4. 对 configuration/settings 进行了许多更改,包括 剥离除最基本的 pugins 之外的所有内容。
  5. 尝试不同的文件类型设置
  6. aliasing/not 别名 eslint
  7. git 围绕最近的变化一分为二
  8. 正在重启我的机器

并在每次更改后进行测试。

我终于想到了一个解决方案:遗憾的是我不知道 为什么 这首先是个问题,也不知道 为什么 这修复了它,但它在这里。

今天早上,我尝试安装一个 LSP,只是为了笑:typescript-language-server。这没有帮助,但是当我卸载它并再次尝试 ALEInfo 时,它现在可以工作了!