Class DefaultGssSourceMapGenerator
java.lang.Object
com.google.common.css.compiler.passes.DefaultGssSourceMapGenerator
- All Implemented Interfaces:
GssSourceMapGenerator
Class to collect and generate source map(v3) for Gss compiler. It is intended to be used by
CodePrinter.
Source Map Revision 3 Proposal: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?usp=sharing
- See Also:
-
SourceMapGeneratorV3
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultGssSourceMapGenerator(JobDescription.SourceMapDetailLevel sourceMapDetailLevel) Constructor to get source map class to use. -
Method Summary
Modifier and TypeMethodDescriptionvoidappendOutputTo(Appendable out, String name) Appends the generated source map toout.voidendSourceMapping(CssNode node, int endLine, int endCharIndex) Finishes the source mapping for the given node at the current position.voidsetSourceRoot(String path) Sets the prefix to be added to the beginning of each source path as debuggers expect (prefix + sourceName) to be a URL for loading the source code.voidstartSourceMapping(CssNode node, int startLine, int startCharIndex) Starts the source mapping for the given node at the current position.
-
Constructor Details
-
DefaultGssSourceMapGenerator
Constructor to get source map class to use.- Parameters:
sourceMapDetailLevel- used to control the output details of source map
-
-
Method Details
-
appendOutputTo
Appends the generated source map toout.- Specified by:
appendOutputToin interfaceGssSourceMapGenerator- Parameters:
out- anAppendableobject to append the output onname- filename to be written inside the source map (not the filename where writes to)- Throws:
IOException- See Also:
-
SourceMapGeneratorV3.appendTo(java.lang.Appendable, java.lang.String)
-
startSourceMapping
Starts the source mapping for the given node at the current position. This is intended to be called before the node is written to the buffer.- Specified by:
startSourceMappingin interfaceGssSourceMapGenerator- Parameters:
node- theCssNodeto be processedstartLine- the first character's line number once it starts writing outputstartCharIndex- the first character's character index once it starts writing output
-
endSourceMapping
Finishes the source mapping for the given node at the current position. This is intended to be called immediately after the whole node is written to the buffer.- Specified by:
endSourceMappingin interfaceGssSourceMapGenerator- Parameters:
node- theCssNodeto be processedendLine- the last character's line number when it ends writing outputendCharIndex- the last character's character index when it ends writing output
-
setSourceRoot
Sets the prefix to be added to the beginning of each source path as debuggers expect (prefix + sourceName) to be a URL for loading the source code.- Specified by:
setSourceRootin interfaceGssSourceMapGenerator- Parameters:
path- The URL prefix to save in the sourcemap file
-