congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
HighlighterIterator.getEnd
Code IndexAdd Tabnine to your IDE (free)

How to use
getEnd
method
in
com.intellij.openapi.editor.highlighter.HighlighterIterator

Best Java code snippets using com.intellij.openapi.editor.highlighter.HighlighterIterator.getEnd (Showing top 10 results out of 315)

origin: KronicDeth/intellij-elixir

/**
 *
 * @param highlighterIterator
 * @param offset the current offset in the file of the {@code highlighterIterator}
 * @return {@code true} if {@link HighlighterIterator#getTokenType()} is one of {@link #CLOSING_QUOTES} and
 *   {@code offset} is {@link HighlighterIterator#getStart()}
 */
@Override
public boolean isClosingQuote(HighlighterIterator highlighterIterator, int offset) {
  boolean isClosingQuote = false;
  if (CLOSING_QUOTES.contains(highlighterIterator.getTokenType())) {
    int start = highlighterIterator.getStart();
    int end = highlighterIterator.getEnd();
    isClosingQuote = end - start >= 1 && offset == end - 1;
  }
  return isClosingQuote;
}
origin: KronicDeth/intellij-elixir

@Nullable
@Override
public CharSequence getClosingQuote(HighlighterIterator highlighterIterator, int offset) {
  CharSequence closingQuote = null;
  if (highlighterIterator.getStart() > 0) {
    highlighterIterator.retreat();
    try {
      IElementType tokenType = highlighterIterator.getTokenType();
      if (CLOSING_QUOTE_BY_OPENING_QUOTE.get(tokenType) != null) {
        Document document = highlighterIterator.getDocument();
        if (document != null) {
          String promoter = document.getText(
              new TextRange(highlighterIterator.getStart(), highlighterIterator.getEnd())
          );
          String terminator = StackFrame.TERMINATOR_BY_PROMOTER.get(promoter);
          if (terminator != null) {
            if (terminator.length() >= 3) {
              closingQuote = "\n" + terminator;
            } else {
              closingQuote = terminator;
            }
          }
        }
      }
    } finally {
      highlighterIterator.advance();
    }
  }
  return closingQuote;
}
origin: halirutan/Mathematica-IntelliJ-Plugin

/**
 * Should return true if the current offset is the closing quote of the string. Unfortunately, I'm not quite sure
 * anymore why I had to make the calculations but I remember that something with the removal of an empty string did
 * not work.
 *
 * @param iterator
 *     the iterator to move through the token stream. Here, only used to get the current token type
 * @param offset
 *     current character offset
 * @return true, if the current offset is a closing quote
 */
@Override
public boolean isClosingQuote(HighlighterIterator iterator, int offset) {
 final IElementType tokenType = iterator.getTokenType();
 if (tokenType.equals(STRING_LITERAL_END)) {
  int start = iterator.getStart();
  int end = iterator.getEnd();
  return end - start >= 1 && offset == end - 1;
 }
 return false;
}
origin: halirutan/Mathematica-IntelliJ-Plugin

@Nullable
private IElementType getNonWhitespaceElementType(final HighlighterIterator iterator, int curLineStart, final int prevLineStartOffset) {
 while (!iterator.atEnd() && iterator.getEnd() >= curLineStart && iterator.getStart() >= prevLineStartOffset) {
  final IElementType tokenType = iterator.getTokenType();
  if (!MathematicaElementTypes.WHITE_SPACE_OR_COMMENTS.contains(tokenType)) {
   return tokenType;
  }
  iterator.retreat();
 }
 return null;
}
origin: halirutan/Mathematica-IntelliJ-Plugin

@Nullable
private IElementType getNonWhitespaceElementType(final HighlighterIterator iterator, int curLineStart, final int prevLineStartOffset) {
 while (!iterator.atEnd() && iterator.getEnd() >= curLineStart && iterator.getStart() >= prevLineStartOffset) {
  final IElementType tokenType = iterator.getTokenType();
  if (!MathematicaElementTypes.WHITE_SPACE_OR_COMMENTS.contains(tokenType)) {
   return tokenType;
  }
  iterator.retreat();
 }
 return null;
}
origin: Camelcade/Perl5-IDEA

 return false;
else if (level == 0 && highlighterIterator.getEnd() > offset) {
 return true;
origin: qeesung/HighlightBracketPair

public Brace(IElementType elementType, HighlighterIterator iterator) {
  this.elementType = elementType;
  this.offset = iterator.getStart();
  Document document = iterator.getDocument();
  this.text = document.getText(new TextRange(iterator.getStart(),
      iterator.getEnd()));
}
origin: Camelcade/Perl5-IDEA

 StringUtil.containsLineBreak(documentChars.subSequence(currentOffset, highlighterIterator.getEnd()))) {
return Result.Continue;
origin: Camelcade/Perl5-IDEA

  PerlEditorUtil.moveToPreviousMeaningfulToken(highlighter.createIterator(currentOffset - 1));
 if (!preQuoteIterator.atEnd() && QUOTE_OPEN_ANY.contains(preQuoteIterator.getTokenType())) {
  startOffsetToDelete = preQuoteIterator.getEnd();
  caretModel.moveToOffset(preQuoteIterator.getEnd());
 POST_HANDLER.set(editor, () -> true);
editor.getDocument().deleteString(startOffsetToDelete, iterator.getEnd());
origin: qeesung/HighlightBracketPair

public BracePair findClosetBracePairInStringSymbols(int offset) {
  if (offset < 0 || this.fileText == null || this.fileText.length() == 0)
    return EMPTY_BRACE_PAIR;
  EditorHighlighter editorHighlighter = ((EditorEx) editor).getHighlighter();
  HighlighterIterator iterator = editorHighlighter.createIterator(offset);
  IElementType type = iterator.getTokenType();
  boolean isBlockCaret = this.isBlockCaret();
  if (!BraceMatchingUtilAdapter.isStringToken(type))
    return EMPTY_BRACE_PAIR;
  int leftOffset = iterator.getStart();
  int rightOffset = iterator.getEnd() - 1;
  if (!isBlockCaret && leftOffset == offset)
    return EMPTY_BRACE_PAIR;
  return new BracePair.BracePairBuilder().
      leftType(DOUBLE_QUOTE).
      rightType(DOUBLE_QUOTE).
      leftOffset(leftOffset).
      rightOffset(rightOffset).build();
}
com.intellij.openapi.editor.highlighterHighlighterIteratorgetEnd

Popular methods of HighlighterIterator

  • atEnd
  • getTokenType
  • advance
  • retreat
  • getStart
  • getDocument
  • getTextAttributes

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setScale (BigDecimal)
  • getSystemService (Context)
  • getSharedPreferences (Context)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now