Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALEHover text not appearing in floating preview #4757

Open
jsit opened this issue Apr 18, 2024 · 1 comment
Open

ALEHover text not appearing in floating preview #4757

jsit opened this issue Apr 18, 2024 · 1 comment
Labels

Comments

@jsit
Copy link
Contributor

jsit commented Apr 18, 2024

Information

VIM version

NVIM v0.9.0

Operating System: macOS

What went wrong

g:ale_hover_to_floating_preview doesn't seem to be working for :ALEHover

From the help docs:

When using Neovim or Vim with popupwin, if g:ale_hover_to_floating_preview or g:ale_floating_preview is set to 1, the hover information will show in a floating window.

Reproducing the bug

My minimal vimrc:

set runtimepath+=$HOME/.vim/bundle/ale
let g:ale_hover_cursor = 1
let g:ale_hover_to_floating_preview = 1
  1. Use the vimrc above
  2. Open a TypeScript file
  3. Move cursor over a variable
  4. Notice the :ALEHover info shows in the echo line, not in the floating preview

I tried doing :ALEDisable | ALEEnable to reload the settings, but this doesn't help.

I'm also not sure why these settings aren't showing up in :ALEInfo?

:ALEInfo

Expand
 Current Filetype: typescriptreact
Available Linters: ['cspell', 'deno', 'eslint', 'standard', 'tslint', 'tsserver', 'typecheck', 'xo']
  Enabled Linters: ['eslint', 'tsserver']
  Ignored Linters: []
 Suggested Fixers:
  '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.
 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 = 0
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '[%linter%/%severity%] %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 = {'typescript': ['eslint', 'prettier'], 'typescriptreact': ['eslint', 'prettier'], 'json': ['prettier'], 'javascript': ['eslint', 'prettier'], 'css': ['stylelint'], 'javascriptreact': ['eslint']}
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 = 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 = {'mustache': ['ember-template-lint'], 'typescript': ['eslint', 'tsserver'], 'scss': ['stylelint'], 'typescriptreact': ['eslint', 'tsserver'], 'javascriptreact': ['eslint'], 'json': ['eslint'], 'html': ['pa11y'], 'handlebars': ['ember-template-lint'], 'javascript': ['eslint'], 'css': ['stylelint'], 'markdown': ['proselint']}
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%/%severity%] %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 = {'ControlP': {'ale_enabled': 0}}
let g:ale_pattern_options_enabled = v:null
let g:ale_root = {}
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_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) yarn
(finished - exit code 0) ['/bin/bash', '-c', 'cd ''/Users/xxx/Code'' && ''yarn'' eslint -f json --stdin --stdin-filename ''/Users/xxx/Code/test.tsx'' < ''/Users/xxx/tmp/nvim.xxx/NFKavt/1/test.tsx''']
<<>>
[{"filePath":"/Users/xxx/Code/test.tsx","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]}]
<<>>
(executable check - success) .yarn/sdks/typescript/bin/tsserver
(started) ['/bin/bash', '-c', '''.yarn/sdks/typescript/bin/tsserver''']
@jsit jsit added the bug label Apr 18, 2024
@jsit
Copy link
Contributor Author

jsit commented Apr 18, 2024

It looks like the truncated_echo conditional on line 47 of autoload/ale/hover.vim is evaluating to true, preventing it from getting to the floating preview check:

elseif get(l:options, 'truncated_echo', 0)
if !empty(a:response.body.displayString)
call ale#cursor#TruncatedEcho(a:response.body.displayString)
endif
elseif g:ale_hover_to_floating_preview || g:ale_floating_preview
call ale#floating_preview#Show(split(a:response.body.displayString, "\n"), {
\ 'filetype': 'ale-preview.message',
\})

If I comment out lines 47-50, it works as expected.

I don't know how to make this not true?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant