[Geany] feature request: jumping to python module

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Geany] feature request: jumping to python module

Filip Gruszczyński
Hi!

I was thinking today about how geany is awsome and helps me a lot with
my python coding and found a feature, that would make my live so much
easier: it's jumping to function/class/module. I won't give a specific
description, but instead provide examples of how it could work:

-> from mypack.mymodule import MyClass

If I am on MyClass and hit a shortcut, geany would open
mypack/mymodule.py and jump to MyClass class.

-> from django.db.models import CharField

If I am on CharField and hit a shortucut, geany would search python
modules path (usually /usr/lib/python/dist-packages), find
django/db/models.py and jump to CharField

-> from django.db.models import Model

If I am on db and hit a shortuct, geany would open
/usr/lib/python/dist-packages/django/db/__init__.py

-> from mypack.mymodule import MyClass

.. // somewhere in the code

obj = MyClass

and I am on MyClass and hit shortcut, geany would open
mypack/mymodule.py and jump to MyClass.

-> import mypackage.mymodule

obj = mypackage.mymodule.MyClass()

and I am on MyClass and hit shortuct, geany would open
mypack/mymodule.py and jump to MyClass.


Geez, that would so a killer feature for any Python developer :-) Any
chance it could appear in Geany?

--
Filip Gruszczyński
_______________________________________________
Geany mailing list
[hidden email]
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Geany] feature request: jumping to python module

Enrico Tröger
On Thu, 25 Mar 2010 23:48:03 +0100, Filip wrote:

>Hi!
>
>I was thinking today about how geany is awsome and helps me a lot with
>my python coding and found a feature, that would make my live so much
>easier: it's jumping to function/class/module. I won't give a specific
>description, but instead provide examples of how it could work:
>
>-> from mypack.mymodule import MyClass
>
>If I am on MyClass and hit a shortcut, geany would open
>mypack/mymodule.py and jump to MyClass class.
>
>-> from django.db.models import CharField
>
>If I am on CharField and hit a shortucut, geany would search python
>modules path (usually /usr/lib/python/dist-packages), find
>django/db/models.py and jump to CharField
>
>-> from django.db.models import Model
>
>If I am on db and hit a shortuct, geany would open
>/usr/lib/python/dist-packages/django/db/__init__.py
>
>-> from mypack.mymodule import MyClass
>
>.. // somewhere in the code
>
>obj = MyClass
>
>and I am on MyClass and hit shortcut, geany would open
>mypack/mymodule.py and jump to MyClass.
>
>-> import mypackage.mymodule
>
>obj = mypackage.mymodule.MyClass()
>
>and I am on MyClass and hit shortuct, geany would open
>mypack/mymodule.py and jump to MyClass.
>
>
>Geez, that would so a killer feature for any Python developer :-) Any
I completely agree and I want it as well.
That really could be a super douper heavy great fancy feature :).


>chance it could appear in Geany?

Sure, once will write it :).
This could be ideally done as a plugin so it won't disturb non-Python
people :).

As said, I'd like to have this as well and I'm willing to implement it
but no idea when...:(.
Even better would be if someone would faster than me implementing it :).

Regards,
Enrico

--
Get my GPG key from http://www.uvena.de/pub.asc

_______________________________________________
Geany mailing list
[hidden email]
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany

attachment0 (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Geany] feature request: jumping to python module

Filip Gruszczyński
> This could be ideally done as a plugin so it won't disturb non-Python
> people :).

Any chance this plugin could be shipped together with Geany, so it
wouldn't be necessary to build it independently?

> Even better would be if someone would faster than me implementing it :).

I'd love to say, that I am gonna do it, but I really don't fell
competent enough.

--
Filip Gruszczyński
_______________________________________________
Geany mailing list
[hidden email]
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Geany] feature request: jumping to python module

Lex Trotman


2010/3/26 Filip Gruszczyński <[hidden email]>
> This could be ideally done as a plugin so it won't disturb non-Python
> people :).

Any chance this plugin could be shipped together with Geany, so it
wouldn't be necessary to build it independently?

> Even better would be if someone would faster than me implementing it :).

I'd love to say, that I am gonna do it, but I really don't fell
competent enough.


Oh come now, all you are asking for is most of the Python parser, symbol handling and name binding :-D

More seriously, maybe you could investigate some less powerful but simpler? options. 

1. Since the Python tagmanager currently parses imports, look at if you can get it to load any existing local tag files for imported modules.  Then the existing goto tag operations could be extended to open the source file if its not open.

2. And then extend the goto tag operations to open files associated with global tag files as well

The extensions for goto tag to open files should be language independent, just open the source file that generated the symbol. 

And the loading of imports is localised to the Python tagmanager so it won't interfere with other languages even though it isn't a plugin.

Cheers
Lex

--
Filip Gruszczyński
_______________________________________________
Geany mailing list
[hidden email]
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany


_______________________________________________
Geany mailing list
[hidden email]
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Loading...