Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] New Codan checker + questions about ASTRewrite

Hello, Mathias, it's great to see a new contributor :)

2011/8/16 Mathias De Maré <mathias.demare+cdt@xxxxxxxxx>
If I remove the throwing of the exception, the quickfix seems to work just fine. However, I have a feeling the exception is there for a reason.
In addition, ASTRewrite seems to come with a fairly strong warning to ask for more information, so: could I remove the exception, in the case of a 'remove operation' on a preprocessor statement?

I can't relate to that, but I can give you another idea- instead of using ASTRewrite, I think you could get the positions of the ASTNodes which you want to remove and perform the fix directly on the IDocument.
If the ASTNodes are themselves inside a macro expansion, you won't be able to retrieve their file positions, so the quick fix would fail in such a case (but this doesn't make it any less useful of course since that's rare).

I'm still curious about the status of ASTRewrite and rewriting preprocessor nodes.

-- Tomasz

Back to the top