mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Code formatter: Fix skipping of non-local declarations
This commit is contained in:
parent
5b682fb34f
commit
2631135c07
1 changed files with 3 additions and 3 deletions
|
@ -246,6 +246,9 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
IASTDeclaration[] decls= tu.getDeclarations();
|
IASTDeclaration[] decls= tu.getDeclarations();
|
||||||
for (int i = 0; i < decls.length; i++) {
|
for (int i = 0; i < decls.length; i++) {
|
||||||
IASTDeclaration declaration = decls[i];
|
IASTDeclaration declaration = decls[i];
|
||||||
|
if (!fTranslationUnitFile.equals(declaration.getContainingFilename())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
declaration.accept(this);
|
declaration.accept(this);
|
||||||
scribe.printNewLine();
|
scribe.printNewLine();
|
||||||
|
@ -270,9 +273,6 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
* @see org.eclipse.cdt.core.dom.ast.ASTVisitor#visit(org.eclipse.cdt.core.dom.ast.IASTDeclaration)
|
* @see org.eclipse.cdt.core.dom.ast.ASTVisitor#visit(org.eclipse.cdt.core.dom.ast.IASTDeclaration)
|
||||||
*/
|
*/
|
||||||
public int visit(IASTDeclaration node) {
|
public int visit(IASTDeclaration node) {
|
||||||
if (!fTranslationUnitFile.equals(node.getContainingFilename())) {
|
|
||||||
return PROCESS_SKIP;
|
|
||||||
}
|
|
||||||
int indentLevel= scribe.indentationLevel;
|
int indentLevel= scribe.indentationLevel;
|
||||||
try {
|
try {
|
||||||
if (node.getNodeLocations()[0] instanceof IASTMacroExpansion) {
|
if (node.getNodeLocations()[0] instanceof IASTMacroExpansion) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue