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

using rtags#ExecuteRCAsync print error when the symbol not indexed #105

Open
pangchol opened this issue Feb 7, 2018 · 1 comment
Open

Comments

@pangchol
Copy link

pangchol commented Feb 7, 2018

I am using vim8 when 'job' and 'channel' feature work, so the vim-rtags will use rtags#ExecuteRCAsync when call rtags#JumpTo. but I find it print error when the jump symbol is not indexed. after test I find it is beacuse rtags#JumpToHandler function do not right handle when the async job return ["Not indexed"].
after I change the "elseif len(results) == 1" condition to
elseif len(results) == 1 && results[0] != "Not indexed"
the error print disappear.
I think it is needed to fixed this little problam.

@mckellyln
Copy link

mckellyln commented Feb 7, 2018

Thanks. I have added similar things to my fork such as:

 function! rtags#DisplayLocations(locations)
     let num_of_locations = len(a:locations)
+    if num_of_locations == 0
+        echohl | echomsg "[vim-rtags] No info returned" | echohl None
+        return
+    endif

 function! rtags#FindSymbols(pattern)
+    if empty(a:pattern)
+        echo "<empty input>"
+        return
+    endif

And also when starting funcs such as FindSymbols, I echo a msg about the cmd started and then clear it when the cmd completes so I can tell it is running still and waiting for results.

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

2 participants