X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/CodeFormatter.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/CodeFormatter.java index 7938516..e4ec3cf 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/CodeFormatter.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/CodeFormatter.java @@ -15,14 +15,22 @@ import java.io.StringReader; import java.util.Hashtable; import java.util.Locale; import java.util.Map; + import net.sourceforge.phpdt.core.ICodeFormatter; import net.sourceforge.phpdt.core.compiler.CharOperation; import net.sourceforge.phpdt.core.compiler.ITerminalSymbols; import net.sourceforge.phpdt.core.compiler.InvalidInputException; import net.sourceforge.phpdt.internal.compiler.ConfigurableOption; import net.sourceforge.phpdt.internal.compiler.parser.Scanner; +import net.sourceforge.phpdt.internal.corext.codemanipulation.StubUtility; +import net.sourceforge.phpdt.internal.corext.util.Strings; import net.sourceforge.phpdt.internal.formatter.impl.FormatterOptions; import net.sourceforge.phpdt.internal.formatter.impl.SplitLine; +import net.sourceforge.phpdt.internal.ui.preferences.CodeFormatterPreferencePage; + +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.formatter.IContentFormatterExtension; +import org.eclipse.jface.text.formatter.IFormattingContext; /** *

How to format a piece of code ?

* */ public class CodeFormatter implements ITerminalSymbols, ICodeFormatter { + // IContentFormatterExtension { public FormatterOptions options; /** * Represents a block in the constructions stack. @@ -132,16 +141,16 @@ public class CodeFormatter implements ITerminalSymbols, ICodeFormatter { , true /* whitespace */ , false /* nls */ , false /* assert */ - , true /* tokenizeStrings */ - ); // regular scanner for forming lines + , true, /* tokenizeStrings */ + null, null); // regular scanner for forming lines scanner.recordLineSeparator = true; // to remind of the position of the beginning of the line. splitScanner = new Scanner(true /* comment */ , true /* whitespace */ , false /* nls */ , false /* assert */ - , true /* tokenizeStrings */ - ); + , true, /* tokenizeStrings */ + null, null); // secondary scanner to split long lines formed by primary scanning // initialize current line buffer currentLineBuffer = new StringBuffer(); @@ -1277,7 +1286,7 @@ public class CodeFormatter implements ITerminalSymbols, ICodeFormatter { // || token == TokenNameFloatingPointLiteral || token == TokenNameDoubleLiteral // || token == TokenNameCharacterLiteral - || token == TokenNameStringLiteral; + || token == TokenNameStringDoubleQuote; return result; } /** @@ -2536,4 +2545,5 @@ public class CodeFormatter implements ITerminalSymbols, ICodeFormatter { public void setInitialIndentationLevel(int newIndentationLevel) { this.initialIndentationLevel = currentLineIndentationLevel = indentationLevel = newIndentationLevel; } + } \ No newline at end of file