machao657 / javaparser

Automatically exported from code.google.com/p/javaparser
0 stars 0 forks source link

end line and end column equal to begin line and begin column #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, I'm trying to use this grammar to develop some code completion
functionalities and I have run into a problem that I think you already know.

To obtain the completion options I need to know exactly the position of the
cursor by relation to the node I want to complete. I have tried with the
n.getEndLine() and n.getEndColumn() methods but they return the same value
than n.getBeginLine() and n.getBeginColumn(). I think you already know the
problem since this constructor:
    @Deprecated
    public Node(int line, int column) {

is deprecated.

Also, I have been using javacc for a while but I'm still a super newbie. I
haven't been able to generate the code from the grammar. If you help me to
do this I could change the references to the @Deprecated constructor and
send you a "diff"...

Thanks for you grammar, anyway.
Fernando.

Original issue reported on code.google.com by fergo...@gmail.com on 25 Jun 2008 at 5:56

GoogleCodeExporter commented 9 years ago
I have changed the label "Type-Defect" to "Type-Enhancement", since this 
behavior
never has been completely  implemented.

All help is welcome :), to build the grammar using javacc, if you are a newbie, 
I
recommend you to use the Eclipse IDE and the javacc plugin
(http://eclipse-javacc.sourceforge.net/), it will help you to build the 
grammar. If
you haven't been able to generate the java code, send me a email 
(jgesser@gmail.com).

Original comment by jges...@gmail.com on 25 Jun 2008 at 6:29

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
In some nodes, the begin line and columns has wrong values. 
A TestCase must be created to ensure the correct values. The TestCase can be a
visitor that matches each node identifications with its position in the source 
file.

Original comment by jges...@gmail.com on 26 Jun 2008 at 7:00

GoogleCodeExporter commented 9 years ago
Created a TestCase, patch from Fernando applied (attached), few more bugs found 
with
the test corrected. 

Pending commit and release new version...

Original comment by jges...@gmail.com on 1 Jul 2008 at 2:45

Attachments:

GoogleCodeExporter commented 9 years ago
The issue is fixed, thanks by the help.

Original comment by jges...@gmail.com on 2 Jul 2008 at 1:32

GoogleCodeExporter commented 9 years ago
Thank you for the fix. It works perfectly so far.

Original comment by fergo...@gmail.com on 3 Jul 2008 at 6:23