@Override
 public HighlightingBuilder newHighlighting() {
   if (analysisMode.isIssues()) {
     return NO_OP_BUILDER;
   }
   DefaultHighlighting defaultHighlighting = new DefaultHighlighting(sensorStorage);
   defaultHighlighting.onFile(inputFile);
   return new DefaultHighlightingBuilder(defaultHighlighting);
 }
Exemplo n.º 2
0
 @Override
 public void store(DefaultHighlighting highlighting) {
   String fileKey = highlighting.inputFile().key();
   // Emulate duplicate storage check
   if (highlightingByComponent.containsKey(fileKey)) {
     throw new UnsupportedOperationException(
         "Trying to save highlighting twice for the same file is not supported: "
             + highlighting.inputFile().relativePath());
   }
   highlightingByComponent.put(fileKey, highlighting);
 }
 @Override
 public HighlightingBuilder highlight(
     int startLine, int startLineOffset, int endLine, int endLineOffset, String typeOfText) {
   TypeOfText type = TypeOfText.forCssClass(typeOfText);
   defaultHighlighting.highlight(startLine, startLineOffset, endLine, endLineOffset, type);
   return this;
 }
 @Override
 public void done() {
   defaultHighlighting.save();
 }