Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Symbol info command works only in sync mode #102

Open
marxin opened this issue Jan 26, 2018 · 8 comments
Open

Symbol info command works only in sync mode #102

marxin opened this issue Jan 26, 2018 · 8 comments

Comments

@marxin
Copy link

marxin commented Jan 26, 2018

With my recent VIM:

vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12)

The symbol info command runs, I can verify that in rdm.log file. I can also verify that rtags#SymbolInfoHandler is called. However the editor blinks and not info is displayed.
On the other hand, setting:

s:rtagsAsync = 0

works for me.

@marxin
Copy link
Author

marxin commented Jan 26, 2018

First bad revision: c6dcdd4

@marxin
Copy link
Author

marxin commented Jan 27, 2018

And it works fine in NeoVim.

@bartlibert
Copy link

The same issue is also present when using ProjectList

@mckellyln
Copy link

mckellyln commented Apr 11, 2018

For ProjectList I did this -

function! rtags#ProjectList()
    "call rtags#ExecuteThen({ '-w' : '' }, [function('rtags#ProjectListHandler')])
    let result = rtags#ExecuteRC({ '-w' : '' })
    call rtags#ExecuteHandlers(result, [function('rtags#ProjectListHandler')])
endfunction

until I or someone else can figure out the problem with the channel output

@ziegfeld
Copy link

ziegfeld commented Jun 6, 2018

like what mckellyln said, change SymboInfo() in rtags.vim to the below will work

function! rtags#SymbolInfo()
    "call rtags#ExecuteThen({ '-U' : rtags#getCurrentLocation() }, [function('rtags#SymbolInfoHandler')])
    let result = rtags#ExecuteRC({ '-U' : rtags#getCurrentLocation() })
    call rtags#ExecuteHandlers(result, [function('rtags#SymbolInfoHandler')])
endfunction

@Barricade
Copy link

Any update on this?

@mckellyln
Copy link

mckellyln commented Feb 6, 2020

Hi. I'll go figure it out. I used the synchronous method long ago and left it that way, but I did make some changes to the async code for other reasons and will re-visit this.

@mckellyln
Copy link

I found two issues, 1). the vim job handler did not always get all data, especially if the cmd ended quickly. And 2). the output from the async handler has ^@ (NUL) at the end of each line in the list and the join() then does not echo multiple lines correctly.
I fixed these things in my branch, but I also made other changes/improvements.
I test with vim thoroughly but not yet with neovim so I need to do that.
For now, I would just change the two lines in your copy of the plugin to use sync call for this function as shown above.

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

No branches or pull requests

5 participants