@Override
public void computeSuggestions(HintsProvider.HintsManager manager, RuleContext context, List<Hint> hints, int caretOffset) {
HtmlParserResult result = (HtmlParserResult) context.parserResult;
Node root = result.root(SyntaxAnalyzerResult.FILTERED_CODE_NAMESPACE);
Snapshot snapshot = result.getSnapshot();
int embeddedCaretOffset = snapshot.getEmbeddedOffset(caretOffset);
Element found = ElementUtils.findByPhysicalRange(root, embeddedCaretOffset, false);
if (found != null) {
switch (found.type()) {
case OPEN_TAG:
case CLOSE_TAG:
Named named = (Named) found;
String elementName = named.name().toString();
Configuration conf = Configuration.get(snapshot.getSource().getFileObject());
if (conf.getTagsNames().contains(elementName)) {
hints.add(new CustomElementHint(elementName, context, new OffsetRange(snapshot.getOriginalOffset(found.from()), snapshot.getOriginalOffset(found.to()))));
}
}
}
}