Closed blueyed closed 3 years ago
It uses jedi.settings
though also for additional modules etc: https://github.com/blueyed/jedi-vim/blob/50abb5e95a8d496dbda7b04a9bb78e4a6cd0a968/pythonx/jedi_vim.py#L205-L209
FWIW I've used this for now: https://github.com/davidhalter/jedi-vim/pull/851/files#diff-795a775c12a507b481a669a1ead1839eR473-R483 (_same_definitions
).
I think that's probably fair..?
Why don't you clear always?
Reusing Script is definitely not a good idea. It can be reused, but not if the code is changed. So it only make sense to reuse it for e.g. goto and completions.
This is now implemented. Happy to get some feedback about the current solution. If there's none, I will probably close here at some point.
The Script is now not reused, but a lot of other things are. I think the Jedi API is now in the right shape.
I've noticed that when comparing two lists of definitions for the same "place" it will not compare equal, because
self._inference_state
(an object, apparently recreated always?) is also included in__eq__
: https://github.com/jedi/jedi/blob/9cdc4d6039d0df70aa759fa23371ea92c5c8fc72/jedi/api/classes.py#L603-L607This appears due to using a new
jedi.Script
instance.Therefore I've wondered if it would be good to re-use a single
Script
instance in jedi-vim (per environment)?Otherwise I'll probably just use a custom method for comparison. (it's for the usages, where I want to re-use a quickfix list for the same definitions)
@davidhalter