biddyweb / checker-framework

Automatically exported from code.google.com/p/checker-framework
Other
0 stars 1 forks source link

Make the Eclipse problem markers narrower #175

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, the Eclipse markers refer to the line the error originates from. 
Consequently, when a user double clicks on a marker in the problems view of 
Eclipse, a whole line gets selected.

It would be nice if double-clicking a marker highlighted a narrower segment of 
the code reported by javac. The compiler reports the start and end positions of 
the code segment related to each problem. The Eclipse markers could use this 
information to point the user to a narrow segment of the line rather than the 
whole line.

Original issue reported on code.google.com by reprogra...@gmail.com on 6 Nov 2012 at 7:10

GoogleCodeExporter commented 9 years ago
My commit at 
https://code.google.com/r/reprogrammer-checker-framework/source/detail?r=6444561
ae795a27eabfdb71ace483d1831245b11&name=switch-to-javac-java-api switches the 
Eclipse plug-in from checkers.eclipse.javac.CommandlineJavacRunner to 
checkers.eclipse.javac.JavacRunner. This change makes it easy to get the 
position information from javac.

Subsequently, my commit at 
https://code.google.com/r/reprogrammer-checker-framework/source/detail?r=abfae84
f199e66d1e7d64d9c2c069cee17fa7438&name=add-position-info-to-markers uses the 
position information from javac to create Eclipse markers that point to 
narrower segments of lines.

Original comment by reprogra...@gmail.com on 6 Nov 2012 at 7:13

GoogleCodeExporter commented 9 years ago
By the way, I sent a message to checker-framework-discuss@googlegroups.com to 
discuss the switch to JavacRunner, but, my message is still pending moderator 
approval.

Original comment by reprogra...@gmail.com on 6 Nov 2012 at 7:15

GoogleCodeExporter commented 9 years ago
> By the way, I sent a message to
> checker-framework-discuss@googlegroups.com to discuss the switch to
> JavacRunner, but, my message is still pending moderator approval.

I'm sorry about that.  I tried to approve it both via the web interface
(where it didn't show up) and by email (which I thought worked but
obviously did not work).  I've sometimes had this problem with Google
Groups before, so I blame Google. :-)  Anyway, I *think* I got it approved
this time.  Please let us know (or email me directly) if problem recurs.
Thanks a lot!

Original comment by michael.ernst@gmail.com on 6 Nov 2012 at 7:37

GoogleCodeExporter commented 9 years ago

Original comment by michael.ernst@gmail.com on 6 Nov 2012 at 7:38

GoogleCodeExporter commented 9 years ago
Beware that I haven't tested my changes extensively. I don't know much about 
your testing strategy. If there are automated tests for the plug-in, please let 
me know.

Original comment by reprogra...@gmail.com on 7 Nov 2012 at 10:55

GoogleCodeExporter commented 9 years ago

Original comment by michael.ernst@gmail.com on 29 Jan 2013 at 6:29

GoogleCodeExporter commented 9 years ago
I have checked in a change that includes the file position range (not line 
column range) for errors reported by the Checker Framework.  These ranges are 
now the second to last entry in the detailed message (before the message's 
text). 

The form of the range is as follows:
( start, end )   
The value can also be "null" when there is no source object corresponding to a 
given error.
So a regex to match the range entry would be:
"\( \d+, \d+ \)|null"

Note the spaces.

Original comment by jbu...@cs.washington.edu on 6 Aug 2013 at 6:39