Package org.sonar.batch.highlighting

Examples of org.sonar.batch.highlighting.SyntaxHighlightingData


    }

    private void storeComponentData(ProjectScanContainer container) {
      ComponentDataCache componentDataCache = container.getComponentByType(ComponentDataCache.class);
      for (InputFile file : inputFiles.values()) {
        SyntaxHighlightingData highlighting = componentDataCache.getData(((DefaultInputFile) file).key(), SnapshotDataTypes.SYNTAX_HIGHLIGHTING);
        if (highlighting != null) {
          highlightingPerFile.put(file, highlighting);
        }
        SymbolData symbolTable = componentDataCache.getData(((DefaultInputFile) file).key(), SnapshotDataTypes.SYMBOL_HIGHLIGHTING);
        if (symbolTable != null) {
View Full Code Here


    /**
     * Get highlighting types at a given position in an inputfile
     * @param charIndex 0-based offset in file
     */
    public List<TypeOfText> highlightingTypeFor(InputFile file, int charIndex) {
      SyntaxHighlightingData syntaxHighlightingData = highlightingPerFile.get(file);
      if (syntaxHighlightingData == null) {
        return Collections.emptyList();
      }
      List<TypeOfText> result = new ArrayList<TypeOfText>();
      for (SyntaxHighlightingRule sortedRule : syntaxHighlightingData.syntaxHighlightingRuleSet()) {
        if (sortedRule.getStartPosition() <= charIndex && sortedRule.getEndPosition() > charIndex) {
          result.add(sortedRule.getTextType());
        }
      }
      return result;
View Full Code Here

TOP

Related Classes of org.sonar.batch.highlighting.SyntaxHighlightingData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.