Goto definition

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

Goto definition

WingIDE - User mailing list

Hi,

I'm working with Wing IDE Pro 5.1.11

 

When  I use the "goto definition" option it works great if I'm in the same file of the function I search.

But in other cases not.

 

For example I have in abc.py class X with several methods

If I create instance of class X in main.py and try to use "goto definition" on class method it says it can't find it.

 

Of course , due to the import ,the class is known and the code is running.

 

How can I get it to work?

Configuration change?

 

 

best regards ,

Gil Idelson

 


_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Goto definition

WingIDE - User mailing list
On 11/8/16 11:44 AM, Gil Idelson via wingide-users wrote:
> When  I use the "goto definition" option it works great if I'm in the
> same file of the function I search.
>
> But in other cases not.
>
> For example I have in abc.py class X with several methods
>
> If I create instance of class X in main.py and try to use "goto
> definition" on class method it says it can't find it.

This can happen if the module imported cannot be found by Wing's static
analyzer and the first step in diagnosing it is to see if goto
definition works on the module name.  If it doesn't, you may need to add
to the python path in Wing's Project Properties dialog.

Cheers,

John
_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Goto definition

WingIDE - User mailing list

Hi,

"goto defintion" works on the class name but not on file name that I import nor on class methods.

The auto complete is not working also.

 

I have a code in my main debug file that go over all the sub directories in the project and add them to the sys.path (PYTHONPATH)

That way I don’t need to update Wing IDE configuration on any directory of python files I added to the project.

 

This code works very well but maybe it the source of my problem?

Does "goto definition" need the PYTHONPATH to be fully defined in the Wing IDE settings, and not in run time?

Although , I checked the checkbox that state "Analyze main debug file for sys.path changes" ?

My main debug file contains the code I mentioned above with the sys.path updates.

 

Please help.

This make my work with Wing IDE very annoying because I have to search anything instead of pressing F4 (goto definition)

 

best regards ,

Gil Idelson

 

-----Original Message-----
From: Wing IDE Support [mailto:[hidden email]]
Sent: Tuesday, November 08, 2016 7:12 PM
To: Gil Idelson; [hidden email]
Subject: Re: [wingide-users] Goto definition

 

EXTERNAL EMAIL

 

 

On 11/8/16 11:44 AM, Gil Idelson via wingide-users wrote:

> When  I use the "goto definition" option it works great if I'm in the

> same file of the function I search.

> 

> But in other cases not.

> 

> For example I have in abc.py class X with several methods

> 

> If I create instance of class X in main.py and try to use "goto

> definition" on class method it says it can't find it.

 

This can happen if the module imported cannot be found by Wing's static analyzer and the first step in diagnosing it is to see if goto definition works on the module name.  If it doesn't, you may need to add to the python path in Wing's Project Properties dialog.

 

Cheers,

 

John


_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Goto definition

WingIDE - User mailing list
In reply to this post by WingIDE - User mailing list

I solved it for now by using:

obj = class

isinstance(obj,class)

 

Both "goto definition" and auto complete are working now but I wonder if this the best way to achieve this.

One big downside for this solution, is that its working only in debug mode.

 

best regards ,

Gil Idelson

 

From: Gil Idelson
Sent: Wednesday, November 09, 2016 10:57 AM
To: 'Wing IDE Support'; [hidden email]
Subject: RE: [wingide-users] Goto definition

 

Hi,

"goto defintion" works on the class name but not on file name that I import nor on class methods.

The auto complete is not working also.

 

I have a code in my main debug file that go over all the sub directories in the project and add them to the sys.path (PYTHONPATH)

That way I don’t need to update Wing IDE configuration on any directory of python files I added to the project.

 

This code works very well but maybe it the source of my problem?

Does "goto definition" need the PYTHONPATH to be fully defined in the Wing IDE settings, and not in run time?

Although , I checked the checkbox that state "Analyze main debug file for sys.path changes" ?

My main debug file contains the code I mentioned above with the sys.path updates.

 

Please help.

This make my work with Wing IDE very annoying because I have to search anything instead of pressing F4 (goto definition)

 

best regards ,

Gil Idelson

 

-----Original Message-----
From: Wing IDE Support [[hidden email]]
Sent: Tuesday, November 08, 2016 7:12 PM
To: Gil Idelson; [hidden email]
Subject: Re: [wingide-users] Goto definition

 

EXTERNAL EMAIL

 

 

On 11/8/16 11:44 AM, Gil Idelson via wingide-users wrote:

> When  I use the "goto definition" option it works great if I'm in the

> same file of the function I search.

> 

> But in other cases not.

> 

> For example I have in abc.py class X with several methods

> 

> If I create instance of class X in main.py and try to use "goto

> definition" on class method it says it can't find it.

 

This can happen if the module imported cannot be found by Wing's static analyzer and the first step in diagnosing it is to see if goto definition works on the module name.  If it doesn't, you may need to add to the python path in Wing's Project Properties dialog.

 

Cheers,

 

John


_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Goto definition

WingIDE - User mailing list
In reply to this post by WingIDE - User mailing list
The python path usually needs to be set in the project properties.  Wing
will try to analyze the main file but will only pick up very
straightforward changes -- this feature was implemented for buildout
projects that add string literals to sys.path before anything else.

It is odd, though, that goto definition works sometimes but not other
times.  Could you send a sample of your code to [hidden email]?

Thanks,

John

On 11/9/16 3:57 AM, Gil Idelson wrote:

> Hi,
>
> "goto defintion" works on the class name but not on file name that I
> import nor on class methods.
>
> The auto complete is not working also.
>
>
>
> I have a code in my main debug file that go over all the sub directories
> in the project and add them to the sys.path (PYTHONPATH)
>
> That way I don’t need to update Wing IDE configuration on any directory
> of python files I added to the project.
>
>
>
> This code works very well but maybe it the source of my problem?
>
> Does "goto definition" need the PYTHONPATH to be fully defined in the
> Wing IDE settings, and not in run time?
>
> Although , I checked the checkbox that state "Analyze main debug file
> for sys.path changes" ?
>
> My main debug file contains the code I mentioned above with the sys.path
> updates.
>
>
>
> Please help.
>
> This make my work with Wing IDE very annoying because I have to search
> anything instead of pressing F4 (goto definition)
>
>
>
> best regards ,
>
> Gil Idelson
>
>
>
> -----Original Message-----
> From: Wing IDE Support [mailto:[hidden email]]
> Sent: Tuesday, November 08, 2016 7:12 PM
> To: Gil Idelson; [hidden email]
> Subject: Re: [wingide-users] Goto definition
>
>
>
> EXTERNAL EMAIL
>
>
>
>
>
> On 11/8/16 11:44 AM, Gil Idelson via wingide-users wrote:
>
>> When  I use the "goto definition" option it works great if I'm in the
>
>> same file of the function I search.
>
>>
>
>> But in other cases not.
>
>>
>
>> For example I have in abc.py class X with several methods
>
>>
>
>> If I create instance of class X in main.py and try to use "goto
>
>> definition" on class method it says it can't find it.
>
>
>
> This can happen if the module imported cannot be found by Wing's static
> analyzer and the first step in diagnosing it is to see if goto
> definition works on the module name.  If it doesn't, you may need to add
> to the python path in Wing's Project Properties dialog.
>
>
>
> Cheers,
>
>
>
> John
>

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Goto definition

WingIDE - User mailing list
In reply to this post by WingIDE - User mailing list
Gil Idelson via wingide-users wrote:

> I solved it for now by using:
>
> obj = class
>
> isinstance(obj,class)
>
> Both "goto definition" and auto complete are working now but I wonder if
> this the best way to achieve this.
>
> One big downside for this solution, is that its working only in debug mode.

FYI, in debug mode the type of obj is introspected from the runtime and
so it should be known even without the 'instance'.

Also, you would need "obj = class()" not "obj = class" if indeed obj is
an instance of class.  Otherwise obj is the class and not an instance.
But either way Wing should have known type of obj if it knew type of class.

Not sure if this illuminates anything or not, but thought I'd comment...

--

Stephan Deibel
Wingware | Python IDE

The Intelligent Development Environment for Python Programmers

wingware.com

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Loading...