Goto.. and methods that override
Hi there. Another question.
I have a paint() method, that doesn't show up when I search for symbols using Goto ... . The method overrides a paint() in the Container class.
Is there any reason why it is not displayed?
Please sign in to leave a comment.
You are right, only one representative of the hierarchy is presented (guess
which:)
This is done to keep the popup short. Once you get to the root of the
hierarchy you can easily go to overridings.
Eugene.
"Rayz" <no_mail@jetbrains.com> wrote in message
news:7466440.1065619626792.JavaMail.itn@is.intellij.net...
>
using Goto ... . The method overrides a paint() in the Container
class.
>
>
Aaah. Now that's the problem.
NONE of the methods came up in the Goto ... Symbol window; the base method or otherwise.
I think the problem is that if there is no source code for the base class available to the project, then IDEA doesn't show anything.
I think it would be better if it would show the highest level in the hierarchy that it can find.
Are you sure you've checked 'Include non project symbols' option on in
CtrlAltShift+N popup?
--
Best regards,
Maxim Shafirov
JetBrains, Inc / IntelliJ Software
http://www.intellij.com
"Develop with pleasure!"
"Rayz" <no_mail@jetbrains.com> wrote in message
news:32837717.1065636317595.JavaMail.itn@is.intellij.net...
>
or otherwise.
>
available to the project, then IDEA doesn't show anything.
>
hierarchy that it can find.
>
>
>
Yep. I've tried that. Still no paint() method. As I said, there is no source code ... could that be the problem?
S'okay folks. I've seen where I was going wrong.
I was entering paint in the box, then selecting the check-box for non-project files.
If I select it first, then enter paint ... it comes up with a whole load of paint calls; none of which were the one I was looking for in my project though ... :(
Why can't it just return the one in the project? Isn't it likely that it is the one you're looking for?
is the one you're looking for?
Discussable IMO.
--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"
"Rayz" <no_mail@jetbrains.com> wrote in message
news:23291697.1065687735540.JavaMail.itn@is.intellij.net...
>
non-project files.
>
of paint calls; none of which were the one I was looking for in my project
though ... :(
>
is the one you're looking for?
>
Well, I think "goto" should go to the base symbol in the project. So, if I have a method in a base class that's overriden somewhere deeper and I look for it, "goto" should go to the base classe.
However, if a symbol is defined in a library and overriden in my project, I think goto should go to my project version, not the library.
Agree 100%
In my case, the work is done by the paint() method in the project .. I'm not really interested in what the base class version does; I can always get to this by simply loading the class file and clicking on the 'o' in the gutter.
I'd be interested to hear what a few other people think, because it seems to me that the current approach is not quite right.
Marcus Brito wrote:
No I disagree.
GOTO should go - as is now - to where the method is declared given the
DECLARED type of the reference. If the actual type is a subclass that
overrides the method that is irrelevant.
Edo
So if I understand this correctly.
If I have a class called Widget, which overrides JComponent .. then the Goto Symbol should go to the paint() method in JComponent, rather than the one in Widget?
Isn't more likely that I'm interested in Widget?
Rayz wrote:
sorry I think I misunderstood the question.
when using goto from a point in source (ctrl-B) there goto (on a method)
uses (correctly) the DECLARED type to decide where to go..
in the GOTO symbol case, there is no object refernce to act upon ...
so ctrl-alt-shift-N should show my all the definitions of paint() in
all my project's classes (ie your Widget's one)
except when I check the box to include also the libraries (in which case
it should show both Widege.paint and JComponent.paint)
Edo
when using goto from a point in source (ctrl-B) there goto (on a method) uses (correctly) the DECLARED type to decide where to go..
Yep. That's fine. Don't have a problem with the goto declaration stuff. Works very well.
in the GOTO symbol case, there is no object refernce to act upon ... so ctrl-alt-shift-N should show my all the definitions of paint() in all my project's classes (ie your Widget's one) except when I check the box to include also the libraries (in which case it should show both Widege.paint and JComponent.paint)
Yep. That's exactly what I'm trying to say, but explained much more clearly .. thanks.
Unfortunately, that isn't how it works at the moment.
Rayz wrote:
OK, open an SCR then, please.
who knows ... it may be related to this problem I've opened:
http://www.intellij.net/tracker/idea/viewSCR?publicId=17631
Edo