use of com.intellij.util.text.SingleCharSequence in project intellij-community by JetBrains.
the class LexerEditorHighlighter method getAttributesForPreviousAndTypedChars.
@NotNull
public List<TextAttributes> getAttributesForPreviousAndTypedChars(@NotNull Document document, int offset, char c) {
final CharSequence text = document.getImmutableCharSequence();
final CharSequence newText = new MergingCharSequence(new MergingCharSequence(text.subSequence(0, offset), new SingleCharSequence(c)), text.subSequence(offset, text.length()));
final List<IElementType> tokenTypes = getTokenType(newText, offset);
return Arrays.asList(getAttributes(tokenTypes.get(0)).clone(), getAttributes(tokenTypes.get(1)).clone());
}
Aggregations