-
-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No definitions found for certain scenario #880
Comments
The problem is not that it wouldn't find |
Why did you close this? In the last paragraph of my original post, I say: line 177 calls the registerCamChain function with |
Hmm ok. I see. I still think that this is quite hard to understand. I'm reopening. However inheritance is hard to understand, if you want to do it right. IMO this kind of code can be Sorry for closing prematurely and not reading your issue fully, because the description was actually good. I just tend to close aggressively to keep the tracker clean (and my limited time resources down). |
Could you please finish your sentence here? Here is a simpler example of the same problem, where Jedi fails to find the definition based on context elsewhere in the project of where/with what type of arguments the function is called:
__init__.py:
MyCalibrator.py:
MySensor.py:
MyUtil.py:
main.py:
Jedi fails to find definition of the
|
Sorry again. IMO this kind of code can be understood, but I'm not sure it will be in the next one or two years. Understanding this form of inheritance is possible, but it's hard to implement and I have other plans currently. I'll leave it open however. If anyone (you?) wants to look into this, the ~ Dave |
I see. Is this kind of functionality not really useful to professional Python developers (I'm new to the language), that it is something you don't see as being urgent to implement? What do you use when writing Python to quickly and efficiently call functions/methods which (like in this example) you can't autocomplete/immediately jump to definitions of? |
Well, I guess for "professionals" there's other issues that are more important. Among the issues are lacking virtuelenv support, lacking Django support and so on. I think the case you mentioned is something that is not very typical for Python. I also think that it's not a good pattern to change the state in such a function (and therefore probably nobody ever had that issue before). |
What do you mean? |
This is usually a bad idea. It should be part of the instance creation call, IMO. |
I realized that the only way we would ever fix that is by implementing #1059. |
Please see a detailed description and discussion in tkf/emacs-jedi#281, which turns out to be probably a Jedi issue. In brief:
git clone https://github.com/ethz-asl/kalibr
addDesignVariables
. No definitions are found, yet theaddDesignVariables
function is defined in IccSensors.py, which is a python file in the same directory.Here is a Python console session showing the fault (courtesy syohex - which shows that I'm not the only one affected):
I am running Ubuntu 14.04 and:
Since line 177 calls the registerCamChain function with
camChain
(anIccCameraChain
object) argument, Jedi should make the guess thatself.CameraChain
is anIccCameraChain
object and thus should be able to find the definition ofaddDesignVariables
on line 49, which is a method of theIccCameraChain
class.The text was updated successfully, but these errors were encountered: