Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

IndexError when the candidate is bad #23

Open
arnegoeteyn opened this issue Aug 21, 2018 · 0 comments · May be fixed by #24
Open

IndexError when the candidate is bad #23

arnegoeteyn opened this issue Aug 21, 2018 · 0 comments · May be fixed by #24

Comments

@arnegoeteyn
Copy link

When using the Struct::function() syntax deoplete-rust throws the following error.

[deoplete] Traceback (most recent call last):                                                                                                                                
  File "/home/aggoetey/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 220, in _gather_results                                              
    ctx['candidates'] = source.gather_candidates(ctx)                                                                                                                        
  File "/home/aggoetey/.local/share/nvim/plugged/deoplete-rust/rplugin/python3/deoplete/sources/rust.py", line 61, in gather_candidates                                      
    'kind': tokens[4],                                                                                                                                                       
IndexError: list index out of range                                                                                                                                          
Error from rust: IndexError('list index out of range').  Use :messages / see above for error details. 

Adding a simple check in the rust.py file to make sure that len(tokens) > 5 stops this crash from happening and makes it function as expected.

@arnegoeteyn arnegoeteyn linked a pull request Aug 21, 2018 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant