Skip to content
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

How can I get all locations of a element with jedi ? #611

Closed
sametmax opened this issue Jul 27, 2015 · 2 comments
Closed

How can I get all locations of a element with jedi ? #611

sametmax opened this issue Jul 27, 2015 · 2 comments

Comments

@sametmax
Copy link

I wish to use jedi manually to find all the elements named in a certain way. E.G : if I have the word "index", I want to find all variables, classes, functions, methods and attributes in all importable packages containing the string "index" in their name, and get their dotted path + the module file path containing it (if it exists).

Now the documentation only show high level usages of Jedi : given a script, you type something, it autocompletes it. But since you had to implement a scanner for all modules, and a parser for all elements, I figured Jedi probably can do what I want.

How would I do it ?

@davidhalter
Copy link
Owner

Well it's intentionally documented in the API documentation, because it's not part of the API and it's therefore subject to change.

However if you just try to play with Jedi for a bit, you can try to play with Module.used_names, which will give you all the names that are used. After that you can play with the names Name.is_definition and Name.get_definition and so on.

I will not give you a solution for your problem. I don't have the time to. But if you have further questions I can maybe help you a bit.

@davidhalter
Copy link
Owner

This would be a feature of the parser (that will be released in a few months, hopefully): #630

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants