You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was working on This file, its a basic, less than 200 line PSO implementation, and I was trying to rename num_dimensions. When I typed ,r it would throw me into insert mode with the name deleted, and when typed dimNum to replace it, then hit it returned it to num_dimensions, like I had entered nothing. Replace works fine on the Particles class.
I then tried to run the 'Find Uses of' command ,n and it spat out a long error, which I posted at the bottom. Again, it worked fine on Particle and a couple other vars.
Steps to reproduce
Download the PSO file
Run the <leader>n command on num_dimensions - First appears in the Particle Class, line 53
<Environment: 3.7.1 in /home/Logos/anaconda3> (/home/Logos/anaconda3/bin/python3.7)
<Environment: 3.6.8 in /home/Logos/anaconda3/envs/spinningup> (/home/Logos/anaconda3/envs
/spinningup/bin/python3.6)
<Environment: 3.5.2 in /usr> (/usr/bin/python3.5)
<Environment: 2.7.12 in /usr> (/usr/bin/python2.7)
Settings
g:jedi#popup_select_first = 0 (default: 1)
g:jedi#use_splits_not_buffers = 'bottom' (default: 1)
g:jedi#popup_on_dot = 0 (default: 1)
g:jedi#auto_vim_configuration = 0 (default: 1)
omnifunc=jedi#completions
Last set from ~/.vim/bundle/jedi-vim/autoload/jedi.vim
completeopt=menu,preview
Find Error
Traceback (most recent call last):
File "/home/Logos/.config/nvim/bundle/jedi-vim/pythonx/jedi_vim.py", line 140, in wrapper
return func(*args, **kwargs)
File "/home/Logos/.config/nvim/bundle/jedi-vim/pythonx/jedi_vim.py", line 393, in usages
definitions = script.usages()
File "/home/Logos/anaconda3/envs/spinningup/lib/python3.6/site-packages/jedi/api/__init__.
py", line 310, in usages
return _usages(**kwargs)
File "/home/Logos/anaconda3/envs/spinningup/lib/python3.6/site-packages/jedi/api/__init__.
py", line 304, in _usages
names = usages.usages(self._get_module(), tree_name)
File "/home/Logos/anaconda3/envs/spinningup/lib/python3.6/site-packages/jedi/evaluate/usag
es.py", line 47, in usages
new = _find_names(m, name_leaf)
File "/home/Logos/anaconda3/envs/spinningup/lib/python3.6/site-packages/jedi/evaluate/usag
es.py", line 33, in _find_names
found_names = set(name.goto())
File "/home/Logos/anaconda3/envs/spinningup/lib/python3.6/site-packages/jedi/evaluate/filt
ers.py", line 55, in goto
return self.parent_context.evaluator.goto(self.parent_context, self.tree_name)
File "/home/Logos/anaconda3/envs/spinningup/lib/python3.6/site-packages/jedi/evaluate/__in
it__.py", line 315, in goto
search_global=True, is_goto=True
File "/home/Logos/anaconda3/envs/spinningup/lib/python3.6/site-packages/jedi/_compatibilit
y.py", line 274, in <lambda>
return lambda *args, **kwargs: self.func(obj, *args, **kwargs)
File "/home/Logos/anaconda3/envs/spinningup/lib/python3.6/site-packages/jedi/evaluate/base
_context.py", line 161, in py__getattribute__
return f.filter_name(filters)
File "/home/Logos/anaconda3/envs/spinningup/lib/python3.6/site-packages/jedi/evaluate/find
er.py", line 153, in filter_name
if self._name.get_definition().type == 'import_from':
AttributeError: 'NoneType' object has no attribute 'type'
The text was updated successfully, but these errors were encountered:
This appears to be an error in jedi itself.
Is this reproducible for you given the linked file in a fresh virtualenv, i.e. can this be reproduced easily?
Its a really simple program, not using meta classes or 10 layers of nested classes. It is only using the Math and Random libraries so far. It could easily be reduced to less than 60 lines of actual code, but I just hadn't got that far.
There are commented out imports, but I hadn't implemented those features yet. So far all that's in there is the header, the 2 imports, a super basic cost function, a Particle class, that keeps track of the individual particle objects, and the PSO class, which is the parent class, that keeps track of the aggregate swarm.
Again, I don't know how helpful that information is, but let me know if you guys need anything else. The entire install is about a week old, I haven't had time to fuck it up too badly. The whole point was keeping the environment light so I could keep the dependencies down, so there isn't much on the Ubuntu install other than Anaconda, and a few machine learning libraries.
If you want to help me fix this, I'd be very happy if you tried to reproduce it just with Jedi. This is a Jedi bug and has basically nothing to do with jedi-vim. If you can use jedi.Script().usages() for this and reproduce it, you can just report it in the jedi issue tracker.
Issue
I was working on This file, its a basic, less than 200 line PSO implementation, and I was trying to rename
num_dimensions
. When I typed,r
it would throw me into insert mode with the name deleted, and when typeddimNum
to replace it, then hit it returned it tonum_dimensions
, like I had entered nothing. Replace works fine on theParticles
class.I then tried to run the 'Find Uses of' command
,n
and it spat out a long error, which I posted at the bottom. Again, it worked fine onParticle
and a couple other vars.Steps to reproduce
<leader>n
command onnum_dimensions
- First appears in theParticle
Class, line 53Output of “:version”
Jedi-vim debug information
jedi-vim version
Global Python
Using Python version 3 to access Jedi.
3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34), [GCC 7.3.0]
/home/Logos/anaconda3/envs/spinningup/lib/python3.6/site.py
Jedi
/home/Logos/anaconda3/envs/spinningup/lib/python3.6/site-packages/jedi/__init__.py
Jedi environment: <SameEnvironment: 3.6.8 in /home/Logos/anaconda3/envs/spinningup>
/home/Logos/anaconda3/envs/spinningup/lib/python36.zip
/home/Logos/anaconda3/envs/spinningup/lib/python3.6
/home/Logos/anaconda3/envs/spinningup/lib/python3.6/lib-dynload
/home/Logos/anaconda3/envs/spinningup/lib/python3.6/site-packages
/home/Logos/spinningup
Known environments
/spinningup/bin/python3.6)
Settings
Find Error
The text was updated successfully, but these errors were encountered: