Class EclipseJavascriptFormatterWrapper
java.lang.Object
de.funfried.netbeans.plugins.external.formatter.javascript.eclipse.EclipseJavascriptFormatterWrapper
Wrapper class to the Eclipse formatter implementation.
- Author:
- bahlef
-
Method Summary
-
Method Details
-
format
@CheckForNull public String format(String formatterFile, String formatterProfile, String code, String lineFeed, Pair<Integer, Integer> changedElement) throws ConfigReadException, ProfileNotFoundException, CannotLoadConfigurationException, FormattingFailedExceptionFormats the givencode
with the given configurations and returns the formatted code.- Parameters:
formatterFile
- the path to the formatter configuration fileformatterProfile
- the name of the formatter configuration profilecode
- the unformatted codelineFeed
- the line feed to use for formattingchangedElement
- an optional range as aPair
object defining the offsets which should be formatted- Returns:
- the formatted code
- Throws:
ConfigReadException
- if there is an issue parsing the formatter configurationProfileNotFoundException
- if the givenprofile
could not be foundCannotLoadConfigurationException
- if there is any issue accessing or reading the formatter configurationFormattingFailedException
- if the external formatter failed to format the given code
-