/**
* 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;