public class AdHocFormatter
extends java.lang.Object
String.indexOf(int)
-based formatter that inserts newlines
after semicolons and maintains indentations based on curly brace symbols it meets. The quality
of work is quite poor: it doesn't recognize string literals or comments and will format their
internals as well.
(Technical details: in JavaScript one cannot detect RegExp syntax without doing a full parsing; since RegExp syntax allows quotes among other symbols, one cannot also detect string literals; consequently there's no way one can detect comments. That's why all this syntax elements remain unrecognized.)
Constructor and Description |
---|
AdHocFormatter() |
Modifier and Type | Method and Description |
---|---|
static TextEdit |
format(java.lang.String source,
java.lang.String header) |
Copyright (c) IBM Corp. and others 2000, 2016. All Rights Reserved.