question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

neovim.api.nvim.NvimError: b'Index out of bounds'

See original GitHub issue

I don’t know if the error is for deoplete or deoplete-ternjs

[deoplete] Traceback (most recent call last):                                                                                                                                     
[deoplete] Traceback (most recent call last):                                                                                                                                     
[deoplete]   File "/Users/daniele/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 100, in gather_results                        
[deoplete]   File "/Users/daniele/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 100, in gather_results                        
[deoplete]     ctx['candidates'] = source.gather_candidates(ctx)                                                                                                                  
[deoplete]     ctx['candidates'] = source.gather_candidates(ctx)                                                                                                                  
[deoplete]   File "/Users/daniele/.config/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 351, in gather_candidates                                
[deoplete]   File "/Users/daniele/.config/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 351, in gather_candidates                                
[deoplete]     result = self.completation(pos) or []                                                                                                                              
[deoplete]     result = self.completation(pos) or []                                                                                                                              
[deoplete]   File "/Users/daniele/.config/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 307, in completation                                     
[deoplete]   File "/Users/daniele/.config/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 307, in completation                                     
[deoplete]     data = self.run_command(command, pos)                                                                                                                              
[deoplete]     data = self.run_command(command, pos)                                                                                                                              
[deoplete]   File "/Users/daniele/.config/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 192, in run_command                                      
[deoplete]   File "/Users/daniele/.config/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 192, in run_command                                      
[deoplete]     f = self.buffer_fragment()                                                                                                                                         
[deoplete]     f = self.buffer_fragment()                                                                                                                                         
[deoplete]   File "/Users/daniele/.config/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 274, in buffer_fragment                                  
[deoplete]   File "/Users/daniele/.config/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 274, in buffer_fragment                                  
[deoplete]     "text": self.buffer_slice(buffer, start, end),                                                                                                                     
[deoplete]     "text": self.buffer_slice(buffer, start, end),                                                                                                                     
[deoplete]   File "/Users/daniele/.config/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 242, in buffer_slice                                     
[deoplete]   File "/Users/daniele/.config/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 242, in buffer_slice                                     
[deoplete]     text += buf[pos] + "\n"                                                                                                                                            
[deoplete]     text += buf[pos] + "\n"                                                                                                                                            
[deoplete]   File "/usr/local/lib/python3.5/site-packages/neovim/api/buffer.py", line 45, in __getitem__                                                                          
[deoplete]   File "/usr/local/lib/python3.5/site-packages/neovim/api/buffer.py", line 45, in __getitem__                                                                          
[deoplete]     return self.request('nvim_buf_get_lines', i, i + 1, True)[0]                                                                                                       
[deoplete]     return self.request('nvim_buf_get_lines', i, i + 1, True)[0]                                                                                                       
[deoplete]   File "/usr/local/lib/python3.5/site-packages/neovim/api/common.py", line 44, in request                                                                              
[deoplete]   File "/usr/local/lib/python3.5/site-packages/neovim/api/common.py", line 44, in request                                                                              
[deoplete]     return self._session.request(name, self, *args, **kwargs)                                                                                                          
[deoplete]     return self._session.request(name, self, *args, **kwargs)                                                                                                          
[deoplete]   File "/usr/local/lib/python3.5/site-packages/neovim/api/nvim.py", line 131, in request                                                                               
[deoplete]   File "/usr/local/lib/python3.5/site-packages/neovim/api/nvim.py", line 131, in request                                                                               
[deoplete]     res = self._session.request(name, *args, **kwargs)                                                                                                                 
[deoplete]     res = self._session.request(name, *args, **kwargs)                                                                                                                 
[deoplete]   File "/usr/local/lib/python3.5/site-packages/neovim/msgpack_rpc/session.py", line 98, in request                                                                     
[deoplete]   File "/usr/local/lib/python3.5/site-packages/neovim/msgpack_rpc/session.py", line 98, in request                                                                     
[deoplete]     raise self.error_wrapper(err)                                                                                                                                      
[deoplete]     raise self.error_wrapper(err)                                                                                                                                      
[deoplete] neovim.api.nvim.NvimError: b'Index out of bounds'                                                                                                                      
[deoplete] neovim.api.nvim.NvimError: b'Index out of bounds'                                                                                                                      
[deoplete] Could not get completions from: ternjs.  Use :messages for error details.                                                                                              
[deoplete] Could not get completions from: ternjs.  Use :messages for error details.                                                                                              

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
carlituxcommented, Feb 23, 2017

@joaumg about debuggin use deoplete feature self.debug() and self.info() methods

about the second one really I don’t know looks like is something how tern works most of this code is based on tern_for_vim https://github.com/ternjs/tern_for_vim/blob/master/script/tern.py#L177

0reactions
carlituxcommented, Apr 15, 2017

Assuming there is a race condition on buf size and end, start uses len(buf)

Please reopen this if there are some weird results on autocompletes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pynvim.api.nvim.NvimError: b'Index out of bounds' · Issue #1041
Iterating through the buffer in Ultisnips fails, while it succeeds using the Neovim API (outside of the Ultisnips conext). This call fails. for ......
Read more >
Api - Neovim docs
Nvim exposes a powerful API that can be used by plugins and external processes via RPC, ... Out-of-bounds indices are clamped to the...
Read more >
How to solve treesitter/highlighter: Error executing lua problem ...
I just solved it using :TSInstall vim . Actually, run :checkhealth and the error in there would help in figuring out what is...
Read more >
Nvim - Go Packages
Unlike "line2byte" vim function, throws error for out-of-bounds indexing. If Buffer is unloaded buffer, returns -1. func (*Batch) BufferOption ¶.
Read more >
How to write neovim plugins in Lua - 2n
in lua/whid.lua local api = vim.api local buf, win local function ... (-1) -- ignoring out-of-bounds error (false) with lines (border_lines).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found