Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] ASTRewrite: Comment handling

Hi Marco

Well, comment-handling is part of the CDT core infrastructure and should be maintained like any other parts of CDT. We are glad about every bug we can fix in the current implementation. It might be that the comments got a bit neglected due to more important issues that have higher syntactic or semantic impact. Nevertheless, we are interested in any bugs or occurrences of unexpected behavior. When we look at Simon's bug we can easily look at other problems in the comment assignment part as well. So, yes it would be great if you could report the bugs you know about.

Thanks
Thomas



-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Marco Trudel
Sent: Mittwoch, 29. Januar 2014 14:53
To: CDT General developers list.
Subject: Re: [cdt-dev] ASTRewrite: Comment handling

Hi Thomas, Lukas

Is the comment parsing/handling still actively maintained? I saw the paper [1] assumed that the work is no longer maintained.
When trying to use the implementation, I ran into many cases where comments are lost or assigned wrong. So I ended up implementing my own comment handler.
But if it's still maintained I could make bug reports. I have dozens of test cases for my own implementation. In the beginning I ran them through your implementation too but none were handled correctly.
Another big problem I have I reported in this bug: 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=403739

Thanks
Marco

[1] Peter Sommerlad, Guido Zgraggen, Thomas Corbat, Lukas Felber: 
Retaining comments when refactoring code. OOPSLA Companion 2008: 653-662

On 01/29/2014 02:38 PM, Corbat Thomas wrote:
> Hi Simon
>
> At a glance, that indeed looks like a bug. It probably doesn't make sense to have a comment assigned to an (AST) node after the node enclosing the comment. Could you please file a bug, then we (Lukas Felber and I) will have a look at it.
>
> Thanks a lot
> Thomas
>
> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] 
> On Behalf Of Simon Taddiken
> Sent: Mittwoch, 29. Januar 2014 14:21
> To: cdt-dev@xxxxxxxxxxx
> Subject: [cdt-dev] ASTRewrite: Comment handling
>
> Hi,
>
> I'm currently working with the ASTRewrite for moving methods around and stumbled upon the following which I consider to be a bug. Given the following code snippet:
>
> A.h
> #ifndef A_H_
> #define A_H_
>
> class Base {
> };
> class Derived : Base {
> public:
>       void myMethod(int a) {
>           // comment in body
>       }
> };
> #endif /* A_H_ */
>
>
> In this sample, the body comment of the method is considered to be a leading comment to the #endif node by the ASTRewrite for that TranslationUnit. This kind of makes sense because its the next node after the comment, but I feel the comment should rather be associated with the method it stands in. For now it takes some crazy extra effort to move all the comments of one method definition to a copy, because in the sample above, the comment is not associated with any node which belongs to the definition.
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top