public interface NewHighlighting
sensorContext.newHighlighting().onFile(inputFile)
.highlight(1, 10, 1, 15, KEYWORD)
.highlight(1, 16, 1, 18, STRING)
// Add more highlight if needed
.save();
| Modifier and Type | Method and Description |
|---|---|
NewHighlighting |
highlight(int startLine,
int startLineOffset,
int endLine,
int endLineOffset,
TypeOfText typeOfText)
Shortcut to avoid calling
InputFile.newRange(int, int, int, int) |
NewHighlighting |
highlight(int startOffset,
int endOffset,
TypeOfText typeOfText)
Deprecated.
since 5.6 Only supported to ease migration from old API. Please prefer other
highlight() methods. |
NewHighlighting |
highlight(TextRange range,
TypeOfText typeOfText)
Call this method to indicate the type of text in a range.
|
NewHighlighting |
onFile(InputFile inputFile)
The file the highlighting belongs to.
|
void |
save()
Call this method only once when your are done with defining highlighting of the file.
|
NewHighlighting onFile(InputFile inputFile)
@Deprecated NewHighlighting highlight(int startOffset, int endOffset, TypeOfText typeOfText)
highlight() methods.startOffset - Starting position in file for this type of text. Beginning of a file starts with offset '0'.endOffset - End position in file for this type of text.typeOfText - see TypeOfText values.NewHighlighting highlight(TextRange range, TypeOfText typeOfText)
range - Range of text to highlight. See for example InputFile.newRange(int, int, int, int).typeOfText - see TypeOfText values.NewHighlighting highlight(int startLine, int startLineOffset, int endLine, int endLineOffset, TypeOfText typeOfText)
InputFile.newRange(int, int, int, int)typeOfText - see TypeOfText values.void save()
IllegalStateException - if you have defined overlapping highlightingCopyright © 2009–2017 SonarSource. All rights reserved.