rust-lang / rust-lang/rust-analyzer
odd output with vim 9 and ALE...
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
hey there 👋
i'm not sure where to post this so apologies in advance if this is the wrong place. i'm seeing rather odd behavior using macvim (MacVim r178 (Vim 9.0.1897)) on macos ventura (13.5.2 (22G91)). here's an example:
it seems to be somehow related to using splits - things appear fine until you open a split at which point certain panels end up in this funky state where the gutter displays repeated @ symbols, the source code is hidden, and line numbers are not available. i think it only impacts code / panels where there are errors / warnings. in the screenshot above, you can see there are "unused" warnings on a few lines. it's easily reproducible.
i've narrowed it down to rust-analyzer - if i disable the linter using ALE's let g:ale_linters = {'rust': []}, the issue no longer happens. if i reenable the linter with let g:ale_linters = {'rust': ['analyzer']} as described here, the issue comes back. my ALE settings are otherwise, fairly stock:
let g:ale_fix_on_save = 0
let g:ale_linters = {'rust': ['analyzer']}
let g:ale_linters_ignore = { 'javascript': ['deno'] }
let g:ale_fixers = { '*': ['trim_whitespace', 'remove_trailing_lines'] }
fwiw, here's the output of `ALEInfo` (click to expand)
Current Filetype: rust
Available Linters: ['analyzer', 'cargo', 'cspell', 'rls', 'rustc']
Linter Aliases:
'analyzer' -> ['rust_analyzer']
Enabled Linters: ['analyzer']
Ignored Linters: []
Suggested Fixers:
'remove_trailing_lines' - Remove all blank lines at the end of a file.
'rustfmt' - Fix Rust files with Rustfmt.
'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
Linter Variables:
" Press Space to read :help for a setting
let g:ale_rust_analyzer_config = {}
let g:ale_rust_analyzer_executable = 'rust-analyzer'
Global Variables:
" Press Space to read :help for a setting
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 = 'auto'
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 = {'*': ['trim_whitespace', 'remove_trailing_lines']}
let g:ale_history_enabled = 1
let g:ale_info_default_mode = 'preview'
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 = {'rust': ['analyzer']}
let g:ale_linters_explicit = 0
let g:ale_linters_ignore = {'javascript': ['deno']}
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_root = {}
let g:ale_set_balloons = 1
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 = 'E'
let g:ale_sign_info = 'I'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = 'E'
let g:ale_sign_style_warning = 'W'
let g:ale_sign_warning = 'W'
let g:ale_sign_highlight_linenrs = 0
let g:ale_type_map = {}
let g:ale_use_neovim_diagnostics_api = 0
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 'all'
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
Command History:
(executable check - success) rust-analyzer
(started) ['/bin/zsh', '-ic', '''rust-analyzer''']
happy to troubleshoot further if it's helpful. any pointers you could send my way would be much appreciated 🙏
rust-analyzer version: rust-analyzer 0.0.0 (0840038f0 2023-09-30) (via: rust-analyzer --version)
rustc version: rustc 1.72.1 (d5c2e9c34 2023-09-13) (via: rustc -V)
relevant settings: CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME are not set, ALE settings are included above. edit: i'm running ALE via vim-plug at https://github.com/dense-analysis/ale/commit/53b01d6a546384a28f1ccbed41baae58d7341da4
fwiw, i installed both rust-analyzer and rustup-init via homebrew
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository files or tests are named. First reproduce the split behavior with MacVim, ALE, and rust-analyzer using the reported versions and settings, then isolate whether diagnostics from ALE or rust-analyzer trigger it. Done means opening a split no longer hides source code or line numbers or fills the gutter with repeated @ symbols when warnings are present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos, rust, vim
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100