Package com.google.javascript.jscomp
Interface SourceExcerptProvider
- All Known Implementing Classes:
AbstractCompiler
,Compiler
,SimpleSourceExcerptProvider
public interface SourceExcerptProvider
A source excerpt provider is responsible for building source code excerpt
of specific locations, such as a specific line or a region around a
given line number.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
A excerpt formatter is responsible of formatting source excerpts.static enum
Source excerpt variety. -
Method Summary
Modifier and TypeMethodDescriptiongetSourceLine
(String sourceName, int lineNumber) Get the line indicated by the line number.getSourceRegion
(String sourceName, int lineNumber) Get a region around the indicated line number.
-
Method Details
-
getSourceLine
Get the line indicated by the line number. This call will return only the specific line.- Parameters:
lineNumber
- the line number, 1 being the first line of the file- Returns:
- the line indicated, or
null
if it does not exist
-
getSourceRegion
Get a region around the indicated line number. The exact definition of a region is implementation specific, but it must contain the line indicated by the line number. A region must not start or end by a carriage return.- Parameters:
lineNumber
- the line number, 1 being the first line of the file- Returns:
- the region around the line number indicated, or
null if it does not exist
-