Lines 233-247
Link Here
|
233 |
return format2(kind, string, 0, string.length(), indentationLevel, lineSeparator, options); |
233 |
return format2(kind, string, 0, string.length(), indentationLevel, lineSeparator, options); |
234 |
} |
234 |
} |
235 |
|
235 |
|
236 |
public static TextEdit reFormat(int kind, String string, int offset, int length, int indentationLevel, String lineSeparator, Map options) { |
236 |
public static TextEdit reformat(int kind, String string, int offset, int length, int indentationLevel, String lineSeparator, Map options) { |
237 |
if (offset < 0 || length < 0 || offset + length > string.length()) { |
237 |
if (offset < 0 || length < 0 || offset + length > string.length()) { |
238 |
throw new IllegalArgumentException("offset or length outside of string. offset: " + offset + ", length: " + length + ", string size: " + string.length()); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ |
238 |
throw new IllegalArgumentException("offset or length outside of string. offset: " + offset + ", length: " + length + ", string size: " + string.length()); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ |
239 |
} |
239 |
} |
240 |
return ToolFactory.createCodeFormatter(options, ToolFactory.M_FORMAT_HONOR_NEVER_INDENT_COMMENT_OPTIONS).format(kind, string, offset, length, indentationLevel, lineSeparator); |
240 |
return ToolFactory.createCodeFormatter(options, ToolFactory.M_FORMAT_EXISTING).format(kind, string, offset, length, indentationLevel, lineSeparator); |
241 |
} |
241 |
} |
242 |
|
242 |
|
243 |
public static TextEdit reFormat(int kind, String string, int indentationLevel, String lineSeparator, Map options) { |
243 |
public static TextEdit reformat(int kind, String string, int indentationLevel, String lineSeparator, Map options) { |
244 |
return reFormat(kind, string, 0, string.length(), indentationLevel, lineSeparator, options); |
244 |
return reformat(kind, string, 0, string.length(), indentationLevel, lineSeparator, options); |
245 |
} |
245 |
} |
246 |
|
246 |
|
247 |
/** |
247 |
/** |