Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2012-02-15 18:41:26 -0500
committerSergey Prigogin2012-02-15 18:44:03 -0500
commit3453fa6fcd43800486c8d8c95e429f49d4121459 (patch)
treecfe954fdcd2c7dd2c0aff1540895d288fc4789e8 /core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite
parent7ce1c8fa8b0a12bcb2555164f4d39699afb0b89d (diff)
downloadorg.eclipse.cdt-3453fa6fcd43800486c8d8c95e429f49d4121459.tar.gz
org.eclipse.cdt-3453fa6fcd43800486c8d8c95e429f49d4121459.tar.xz
org.eclipse.cdt-3453fa6fcd43800486c8d8c95e429f49d4121459.zip
Bug 347712 - Use shared AST in ExtractLocalVariableRefactoring.
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/StatementWriter.java3
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGenerator.java4
2 files changed, 6 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/StatementWriter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/StatementWriter.java
index 5cf3422399..a7c9580bec 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/StatementWriter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/StatementWriter.java
@@ -395,7 +395,8 @@ public class StatementWriter extends NodeWriter {
protected IASTStatement[] getNestedStatements(IASTCompoundStatement compoundStatement) {
return compoundStatement.getStatements();
}
-
+
+ // TODO(sprigogin): Rename second parameter
protected void writeBodyStatement(IASTStatement statement, boolean isDoStatement) {
if (statement instanceof IASTCompoundStatement) {
//TODO hsr existiert noch eine methode
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGenerator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGenerator.java
index eb35b998fb..f8a07a9b3e 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGenerator.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGenerator.java
@@ -590,6 +590,10 @@ public class ChangeGenerator extends ASTVisitor {
}
}
newNode.accept(writer);
+ // TODO(sprigogin): Temporary workaround for invalid handling of line breaks in StatementWriter
+ if (!writer.toString().endsWith("\n")) //$NON-NLS-1$
+ writer.newLine();
+
}
if (prevNode != null) {
IASTNode nextNode = getNextSiblingOrPreprocessorNode(prevNode);

Back to the top