November 20, 2008, 12:22:00 pm *
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: navigating to Java editor from result view  (Read 793 times)
genny
Newbie
*
Posts: 2


« on: June 09, 2008, 01:42:55 pm »

Are there any special tricks/gotchas to be able to open the JDT editor at the right position when clicking on query results?
Shouldn't that work whenever you have a 'select' with a Call or other Java elements?

I think it has worked for me at some point, but not consistently. Right now, no matter what I have in the select clause (aCall, aCall.getLocation(), ..getDeclaringType()) , nothing happens when double clicking on the result entry in the views.

I'm using Eclipse 3.4RC3 - is that a problem? Anyway, I don't see any errors in the Eclipse log.

Thank you - amazing product, anyway.
« Last Edit: June 09, 2008, 01:47:48 pm by genny » Logged
Mathieu Verbaere
Administrator
Newbie
*****
Posts: 26


« Reply #1 on: June 12, 2008, 09:41:08 am »

Hi there,

No, there is no special trick as long as you select a Java element that has a precise position in a compilation unit. If it is a source element, SemmleCode opens the corresponding source file and highlights the source element there. If the element is in a library, SemmleCode simply opens the corresponding class file.

Could you please try the following query for instance?

Code:
from Field f
where f.fromSource()
select f

The results should be clickable, even in Eclipse 3.4RC3. Does it work for you? If not, what is your precise configuration (OS, Java version)? You said it worked at some point; could you also try on a fresh Eclipse with a small project consisting of one class with one field?

Note that if, instead, you ran the query:

Code:
from Field f
where f.fromSource()
select f.getName()

you would get a collection of strings that are not clickable.

Thank you for your feedback.
« Last Edit: June 12, 2008, 09:45:05 am by Mathieu Verbaere » Logged
genny
Newbie
*
Posts: 2


« Reply #2 on: July 01, 2008, 03:27:55 pm »

Sorry for the late reply.

Could you please try the following query for instance?

Code:
from Field f
where f.fromSource()
select f

Well, I tried this on a trivial example class (like this:
Code:
class C{int b;}
), it works fine there. However the result entries are still not clickable with a reasonably big working set.

Does Semmle have any expectations on the working set? I guess it should be a Java working set, but it shouldn't matter if contains one (or more) whole projects or just a single class, should it?

Does it matter if it's a PDE project? (I guess not)

Quote
If not, what is your precise configuration (OS, Java version)?

Eclipse: SDK Version: 3.4.0 Build id: I20080617-2000
Java: Eclipse runs on Sun 1.6.0_06, but JDT compiles against  Sun JRE 1.5.0.14
OS: Debian Lenny, kernel: 2.6.24-1-686 .

Thanks,
Gergo
Logged
Mathieu Verbaere
Administrator
Newbie
*****
Posts: 26


« Reply #3 on: July 05, 2008, 04:00:21 pm »

Hi Gergo,

Unfortunately, we cannot reproduce this behaviour. There is no particular requirement for the working set (apart from it being Java indeed), and of course no restriction on the size either.

I wonder whether it is something specific to the structure/nature of your projects. If you copy one of them, remove all source but one class with one field, do you still have the problem? If yes, could you send us (at support@semmle.com) the .classpath and .project files of that project, after having removed there any sensible information that you do not wish to share?

Thanks in advance.
Logged
Pages: [1]
  Print  
 
Jump to: