public final class SnippetFormatter extends Object
SourceLocation.
The snippet is just for human consumption and doesn't necessarily correspond to
any unit of Soy syntax.| Constructor and Description |
|---|
SnippetFormatter(com.google.common.collect.ImmutableMap<String,SoyFileSupplier> filePathsToSuppliers) |
| Modifier and Type | Method and Description |
|---|---|
com.google.common.base.Optional<String> |
getSnippet(SourceLocation sourceLocation)
Returns a snippet of source code surrounding the given
SourceLocation,
or Optional.absent() if source code is unavailable. |
public SnippetFormatter(com.google.common.collect.ImmutableMap<String,SoyFileSupplier> filePathsToSuppliers)
public com.google.common.base.Optional<String> getSnippet(SourceLocation sourceLocation) throws IOException
SourceLocation,
or Optional.absent() if source code is unavailable. (This happens, for example,
when anyone uses SourceLocation.UNKNOWN, which is why no one should use it.)IOException