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

IndexError when the candidate is bad #23

@arnegoeteyn

Description

@arnegoeteyn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions