vista.vim icon indicating copy to clipboard operation
vista.vim copied to clipboard

Sorting does not work

Open wnts opened this issue 4 years ago • 5 comments

Describe the bug Sorting the vista window does not work

Environment:

  • OS: Debian 10.3
  • Vim/Neovim version:
NVIM v0.4.3
Build type: Debug 
  • This plugin version: 2b0a38a96cb3269955fcc67cffc4cac94b6bfc77
  • I'm using universal-ctags:
    • Ctags version: <!-- output of ctags --version command -->
  • I'm using some LSP client: CoC, commit 0d4f02555e5aaecbd8efef47a70ba2f2c6412d1f

Vista info


    Current FileType: c
Avaliable Executives: ['coc', 'ctags']
    Global Variables:
    let g:vista = {'get_tagline_under_cursor': function('287'), 'winnr': function('285'), 'silent': v:false, 'sort': 0, 'source': {'fpath': '<redacted>/lightdm/src/lightdm.c', 'bufnr': 1, 'get_winid': function('289'), 'fname': 'src/lightdm.c', 'winnr': 1, 'extension': function('294'), 'line': function('292'), 'get_winnr': function('288'), 'filetype': function('290'), 'lines': function('291'), 'winid': 1000, 'line_trimmed': function('293'), 'scope_seperator': function('295')}, 'bufnr': 2, 'provider': 'coc', 'floating_visible': v:false, 'winid': 1001, 'pos': [{'lnum': 1, 'leftcol': 0, 'col': 0, 'topfill': 0, 'topline': 1, 'coladd': 0, 'skipcol': 0, 'curswant': 0}, 2, '1resize 77|vert 1resize 288|2resize 77|vert 2resize 30|'], 'functions': [{'lnum': 56, 'col': 1, 'range': {'end': {'character': 1, 'line': 98}, 'start': {'character': 0, 'line': 54}}, 'selectionRange': {'end': {'character': 6, 'line': 55}, 'start': {'character': 0, 'line': 55}}, 'level': 0, 'kind': 'Function', 'text': 'log_cb'}, {'lnum': 102, 'col': 1, 'range': {'end': {'character': 1, 'line': 115}, 'start': {'character': 0, 'line': 100}}, 'selectionRange': {'end': {'character': 8, 'line': 101}, 'start': {'character': 0, 'line': 101}}, 'level': 0, 'kind': 'Function', 'text': 'log_init'}, {'lnum': 119, 'col': 1, 'range': {'end': {'character': 1, 'line': 135}, 'start': {'character': 0, 'line': 117}}, 'selectionRange': {'end': {'character': 19, 'line': 118}, 'start': {'character': 0, 'line': 118}}, 'level': 0, 'kind': 'Function', 'text': 'get_config_sections'}, {'lnum': 139, 'col': 1, 'range': {'end': {'character': 1, 'line': 156}, 'start': {'character': 0, 'line': 137}}, 'selectionRange': {'end': {'character': 19, 'line': 138}, 'start': {'character': 0, 'line': 138}}, 'level': 0, 'kind': 'Function', 'text': 'set_seat_properties'}, {'lnum': 160, 'col': 1, 'range': {'end': {'character': 1, 'line': 174}, 'start': {'character': 0, 'line': 158}}, 'selectionRange': {'end': {'character': 9, 'line': 159}, 'start': {'character': 0, 'line': 159}}, 'level': 0, 'kind': 'Function', 'text': 'signal_cb'}, {'lnum': 178, 'col': 1, 'range': {'end': {'character': 1, 'line': 181}, 'start': {'character': 0, 'line': 176}}, 'selectionRange': {'end': {'character': 26, 'line': 177}, 'start': {'character': 0, 'line': 177}}, 'level': 0, 'kind': 'Function', 'text': 'display_manager_stopped_cb'}, {'lnum': 185, 'col': 1, 'range': {'end': {'character': 1, 'line': 197}, 'start': {'character': 0, 'line': 183}}, 'selectionRange': {'end': {'character': 11, 'line': 184}, 'start': {'character': 0, 'line': 184}}, 'level': 0, 'kind': 'Function', 'text': 'create_seat'}, {'lnum': 201, 'col': 1, 'range': {'end': {'character': 1, 'line': 216}, 'start': {'character': 0, 'line': 199}}, 'selectionRange': {'end': {'character': 26, 'line': 200}, 'start': {'character': 0, 'line': 200}}, 'level': 0, 'kind': 'Function', 'text': 'service_add_xlocal_seat_cb'}, {'lnum': 220, 'col': 1, 'range': {'end': {'character': 1, 'line': 262}, 'start': {'character': 0, 'line': 218}}, 'selectionRange': {'end': {'character': 31, 'line': 219}, 'start': {'character': 0, 'line': 219}}, 'level': 0, 'kind': 'Function', 'text': 'display_manager_seat_removed_cb'}, {'lnum': 266, 'col': 1, 'range': {'end': {'character': 1, 'line': 275}, 'start': {'character': 0, 'line': 264}}, 'selectionRange': {'end': {'character': 16, 'line': 265}, 'start': {'character': 0, 'line': 265}}, 'level': 0, 'kind': 'Function', 'text': 'xdmcp_session_cb'}, {'lnum': 279, 'col': 1, 'range': {'end': {'character': 1, 'line': 288}, 'start': {'character': 0, 'line': 277}}, 'selectionRange': {'end': {'character': 17, 'line': 278}, 'start': {'character': 0, 'line': 278}}, 'level': 0, 'kind': 'Function', 'text': 'vnc_connection_cb'}, {'lnum': 292, 'col': 1, 'range': {'end': {'character': 1, 'line': 371}, 'start': {'character': 0, 'line': 290}}, 'selectionRange': {'end': {'character': 21, 'line': 291}, 'start': {'character': 0, 'line': 291}}, 'level': 0, 'kind': 'Function', 'text': 'start_display_manager'}, {'lnum': 374, 'col': 1, 'range': {'end': {'character': 1, 'line': 376}, 'start': {'character': 0, 'line': 372}}, 'selectionRange': {'end': {'character': 16, 'line': 373}, 'start': {'character': 0, 'line': 373}}, 'level': 0, 'kind': 'Function', 'text': 'service_ready_cb'}, {'lnum': 380, 'col': 1, 'range': {'end': {'character': 1, 'line': 382}, 'start': {'character': 0, 'line': 378}}, 'selectionRange': {'end': {'character': 20, 'line': 379}, 'start': {'character': 0, 'line': 379}}, 'level': 0, 'kind': 'Function', 'text': 'service_name_lost_cb'}, {'lnum': 386, 'col': 1, 'range': {'end': {'character': 1, 'line': 431}, 'start': {'character': 0, 'line': 384}}, 'selectionRange': {'end': {'character': 15, 'line': 385}, 'start': {'character': 0, 'line': 385}}, 'level': 0, 'kind': 'Function', 'text': 'add_login1_seat'}, {'lnum': 435, 'col': 1, 'range': {'end': {'character': 1, 'line': 439}, 'start': {'character': 0, 'line': 433}}, 'selectionRange': {'end': {'character': 18, 'line': 434}, 'start': {'character': 0, 'line': 434}}, 'level': 0, 'kind': 'Function', 'text': 'remove_login1_seat'}, {'lnum': 443, 'col': 1, 'range': {'end': {'character': 1, 'line': 446}, 'start': {'character': 0, 'line': 441}}, 'selectionRange': {'end': {'character': 15, 'line': 442}, 'start': {'character': 0, 'line': 442}}, 'level': 0, 'kind': 'Function', 'text': 'seat_stopped_cb'}, {'lnum': 450, 'col': 1, 'range': {'end': {'character': 1, 'line': 470}, 'start': {'character': 0, 'line': 448}}, 'selectionRange': {'end': {'character': 18, 'line': 449}, 'start': {'character': 0, 'line': 449}}, 'level': 0, 'kind': 'Function', 'text': 'update_login1_seat'}, {'lnum': 474, 'col': 1, 'range': {'end': {'character': 1, 'line': 477}, 'start': {'character': 0, 'line': 472}}, 'selectionRange': {'end': {'character': 31, 'line': 473}, 'start': {'character': 0, 'line': 473}}, 'level': 0, 'kind': 'Function', 'text': 'login1_can_graphical_changed_cb'}, {'lnum': 481, 'col': 1, 'range': {'end': {'character': 1, 'line': 505}, 'start': {'character': 0, 'line': 479}}, 'selectionRange': {'end': {'character': 32, 'line': 480}, 'start': {'character': 0, 'line': 480}}, 'level': 0, 'kind': 'Function', 'text': 'login1_active_session_changed_cb'}, {'lnum': 509, 'col': 1, 'range': {'end': {'character': 1, 'line': 516}, 'start': {'character': 0, 'line': 507}}, 'selectionRange': {'end': {'character': 15, 'line': 508}, 'start': {'character': 0, 'line': 508}}, 'level': 0, 'kind': 'Function', 'text': 'login1_add_seat'}, {'lnum': 520, 'col': 1, 'range': {'end': {'character': 1, 'line': 527}, 'start': {'character': 0, 'line': 518}}, 'selectionRange': {'end': {'character': 28, 'line': 519}, 'start': {'character': 0, 'line': 519}}, 'level': 0, 'kind': 'Function', 'text': 'login1_service_seat_added_cb'}, {'lnum': 531, 'col': 1, 'range': {'end': {'character': 1, 'line': 536}, 'start': {'character': 0, 'line': 529}}, 'selectionRange': {'end': {'character': 30, 'line': 530}, 'start': {'character': 0, 'line': 530}}, 'level': 0, 'kind': 'Function', 'text': 'login1_service_seat_removed_cb'}, {'lnum': 540, 'col': 1, 'range': {'end': {'character': 1, 'line': 930}, 'start': {'character': 0, 'line': 538}}, 'selectionRange': {'end': {'character': 4, 'line': 539}, 'start': {'character': 0, 'line': 539}}, 'level': 0, 'kind': 'Function', 'text': 'main'}], 'raw': [{'name': 'config_path', 'vlnum': 33, 'line': 39, 'kind': 'Variable'}, {'name': 'loop', 'vlnum': 34, 'line': 40, 'kind': 'Variable'}, {'name': 'log_timer', 'vlnum': 35, 'line': 41, 'kind': 'Variable'}, {'name': 'log_fd', 'vlnum': 36, 'line': 42, 'kind': 'Variable'}, {'name': 'debug', 'vlnum': 37, 'line': 43, 'kind': 'Variable'}, {'name': 'display_manager', 'vlnum': 38, 'line': 45, 'kind': 'Variable'}, {'name': 'display_manager_service', 'vlnum': 39, 'line': 46, 'kind': 'Variable'}, {'name': 'xdmcp_server', 'vlnum': 40, 'line': 47, 'kind': 'Variable'}, {'name': 'xdmcp_client_count', 'vlnum': 41, 'line': 48, 'kind': 'Variable'}, {'name': 'vnc_server', 'vlnum': 42, 'line': 49, 'kind': 'Variable'}, {'name': 'vnc_client_count', 'vlnum': 43, 'line': 50, 'kind': 'Variable'}, {'name': 'exit_code', 'vlnum': 44, 'line': 51, 'kind': 'Variable'}, {'name': 'log_cb', 'vlnum': 7, 'line': 56, 'kind': 'Function'}, {'name': 'log_init', 'vlnum': 8, 'line': 102, 'kind': 'Function'}, {'name': 'get_config_sections', 'vlnum': 9, 'line': 119, 'kind': 'Function'}, {'name': 'set_seat_properties', 'vlnum': 10, 'line': 139, 'kind': 'Function'}, {'name': 'signal_cb', 'vlnum': 11, 'line': 160, 'kind': 'Function'}, {'name': 'display_manager_stopped_cb', 'vlnum': 12, 'line': 178, 'kind': 'Function'}, {'name': 'create_seat', 'vlnum': 13, 'line': 185, 'kind': 'Function'}, {'name': 'service_add_xlocal_seat_cb', 'vlnum': 14, 'line': 201, 'kind': 'Function'}, {'name': 'display_manager_seat_removed_cb', 'vlnum': 15, 'line': 220, 'kind': 'Function'}, {'name': 'xdmcp_session_cb', 'vlnum': 16, 'line': 266, 'kind': 'Function'}, {'name': 'vnc_connection_cb', 'vlnum': 17, 'line': 279, 'kind': 'Function'}, {'name': 'start_display_manager', 'vlnum': 18, 'line': 292, 'kind': 'Function'}, {'name': 'service_ready_cb', 'vlnum': 19, 'line': 374, 'kind': 'Function'}, {'name': 'service_name_lost_cb', 'vlnum': 20, 'line': 380, 'kind': 'Function'}, {'name': 'add_login1_seat', 'vlnum': 21, 'line': 386, 'kind': 'Function'}, {'name': 'remove_login1_seat', 'vlnum': 22, 'line': 435, 'kind': 'Function'}, {'name': 'seat_stopped_cb', 'vlnum': 23, 'line': 443, 'kind': 'Function'}, {'name': 'update_login1_seat', 'vlnum': 24, 'line': 450, 'kind': 'Function'}, {'name': 'login1_can_graphical_changed_cb', 'vlnum': 25, 'line': 474, 'kind': 'Function'}, {'name': 'login1_active_session_changed_cb', 'vlnum': 26, 'line': 481, 'kind': 'Function'}, {'name': 'login1_add_seat', 'vlnum': 27, 'line': 509, 'kind': 'Function'}, {'name': 'login1_service_seat_added_cb', 'vlnum': 28, 'line': 520, 'kind': 'Function'}, {'name': 'login1_service_seat_removed_cb', 'vlnum': 29, 'line': 531, 'kind': 'Function'}, {'name': 'main', 'vlnum': 30, 'line': 540, 'kind': 'Function'}, {'name': '_GStaticAssertCompileTimeAssertion_1', 'vlnum': 47, 'line': 924, 'kind': 'Unknown'}, {'name': 'anon union', 'vlnum': 3, 'line': 927, 'kind': 'Class'}, {'name': 'in', 'vlnum': 4, 'line': 927, 'kind': 'Field'}], 'vlnum2tagname': {'40': 'xdmcp_server', '10': 'set_seat_properties', '11': 'signal_cb', '12': 'display_manager_stopped_cb', '13': 'create_seat', '14': 'service_add_xlocal_seat_cb', '15': 'display_manager_seat_removed_cb', '16': 'xdmcp_session_cb', '17': 'vnc_connection_cb', '18': 'start_display_manager', '19': 'service_ready_cb', '30': 'main', '44': 'exit_code', '33': 'config_path', '34': 'loop', '35': 'log_timer', '36': 'log_fd', '37': 'debug', '38': 'display_manager', '39': 'display_manager_service', '43': 'vnc_client_count', '29': 'login1_service_seat_removed_cb', '20': 'service_name_lost_cb', '21': 'add_login1_seat', '22': 'remove_login1_seat', '23': 'seat_stopped_cb', '24': 'update_login1_seat', '25': 'login1_can_graphical_changed_cb', '26': 'login1_active_session_changed_cb', '27': 'login1_add_seat', '28': 'login1_service_seat_added_cb', '3': 'anon union', '4': 'in', '41': 'xdmcp_client_count', '42': 'vnc_server', '7': 'log_cb', '8': 'log_init', '9': 'get_config_sections', '47': '_GStaticAssertCompileTimeAssertion_1'}}
    let g:vista#executives = ['ale', 'coc', 'ctags', 'lcn', 'nvim_lsp', 'vim_lsc', 'vim_lsp']
    let g:vista#extensions = ['markdown', 'rst']
    let g:vista#finders = ['fzf', 'skim']
    let g:vista#renderer#ctags = 'default'
    let g:vista#renderer#enable_icon = 0
    let g:vista#renderer#icons = {'subroutine': '羚', 'method': '', 'func': '', 'variables': '', 'namespace': '', 'field': '', 'interface': '', 'type': '', 'packages': '', 'property': '襁', 'implementation': '', 'default': '', 'augroup': 'פּ', 'macro': '', 'enumerator': '', 'const': '', 'macros': '', 'map': 'פּ', 'fields': '', 'functions': '', 'enum': '', 'function': '', 'target': '', 'typedef': '', 'variable': '', 'modules': '', 'constant': '', 'struct': '', 'types': '', 'module': '', 'typeParameter': '', 'package': '', 'class': '', 'member': '', 'var': '', 'union': '鬒'}
    let g:vista_blink = [2, 100]
    let g:vista_close_on_jump = 0
    let g:vista_cursor_delay = 400
    let g:vista_default_executive = 'coc'
    let g:vista_disable_statusline = 0
    let g:vista_echo_cursor = 1
    let g:vista_executive_for = {}
    let g:vista_find_absolute_nearest_method_or_function = 0
    let g:vista_find_nearest_method_or_function_delay = 300
    let g:vista_fold_toggle_icons = ['▼', '▶']
    let g:vista_icon_indent = ['└ ', '│ ']
    let g:vista_ignore_kinds = []
    let g:vista_no_mappings = 0
    let g:vista_sidebar_position = 'vertical botright'
    let g:vista_sidebar_width = 30
    let g:vista_stay_on_open = 1
    let g:vista_top_level_blink = [2, 100]
    let g:vista_update_on_text_changed = 0
    let g:vista_update_on_text_changed_delay = 500

Steps to reproduce given the above info init.vim contains same set-up config for CoC as detailed on the project's readme: https://github.com/neoclide/coc.nvim

  1. Open up any project
  2. Open vista window with :Vista!!
  3. Press s key in vista window to sort symbols

Expected behavior Symbols get sorted alphabetically

Actual behavior Symbols don't get sorted, and the following error is displayed:

Error detected while processing function vista#Sort[11]..vista#sidebar#Reload[16]..vista#renderer#Render[1]..<SNR>109_Render[2]..vista#renderer#hir#lsp#Coc[3]..<SNR>110_RenderLSPHirAndThenGroupByKind:                                                                                                                       
line    7:                                                                                                                                                                                                                                                                                                                     
E714: List required

wnts avatar Apr 26 '20 17:04 wnts

Got the same on Vim 8.1 on Windows

n00bmind avatar May 02 '20 10:05 n00bmind

I no longer use the sorting feature. PR welcome.

liuchengxu avatar May 03 '20 00:05 liuchengxu

I have the same issue - Neovim 0.4.4 on macOS Big Sur.

I'll hack on it when I get a bit if no one else is up to it. Vimscript isn't really my "thing", but I'm not entirely inept.

lyndsysimon avatar Mar 09 '21 02:03 lyndsysimon

This comment is intended as a place to put my observations as I'm debugging; I'll be editing it to update thoughts as I go.

In s:Render in renderer.vim, this line seems to be failing when sorting - but not during the initial render. type(a:data) is v:t_list on the initial render, but is v:t_dict when sorting.

lyndsysimon avatar Mar 12 '21 19:03 lyndsysimon

Same issue here, when i put key s, show following:

Error detected while processing function vista#Sort[11]..vista#sidebar#Reload[16]..vista#renderer#Render[1]..<SNR>198_Render[7]..vista#renderer#kind#Render[5]
..31:
line   13:
E686: Argument of sort() must be a List

latest version(2021-04-01)

genmzy avatar Apr 01 '21 03:04 genmzy

It is 2023, and this issue still doesn't solve...

yingmanwumen avatar Apr 17 '23 03:04 yingmanwumen