1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Bug 296192: Extract method removes essential macros and breaks formatting

https://bugs.eclipse.org/bugs/show_bug.cgi?id=296192
Bugfix patch that fixes a case where comments at the end of a block are lost for C code (Comment #2)
This commit is contained in:
Emanuel Graf 2011-01-04 14:50:52 +00:00
parent 6361cd4231
commit 41bb986be0

View file

@ -12,6 +12,7 @@
package org.eclipse.cdt.internal.core.dom.rewrite.commenthandler;
import org.eclipse.cdt.core.dom.ast.IASTComment;
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
@ -29,7 +30,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateParameter;
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompositeTypeSpecifier;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompoundStatement;
/**
* A visitor for the comments. Calls the NodeCommenter to assign the comments.
@ -175,7 +175,7 @@ public class ASTCommenterVisitor extends CPPASTVisitor {
}
@Override
public int leave(IASTStatement statement) {
if(statement instanceof CPPASTCompoundStatement) {
if(statement instanceof IASTCompoundStatement) {
return nodeCommenter.appendFreestandingComments((ASTNode)statement);
}
nodeCommenter.appendComments((ASTNode)statement);