@Override
  public boolean hasNonClosedLiteral(Editor editor, HighlighterIterator iterator, int offset) {
    final IElementType tokenType = iterator.getTokenType();
    if (GroovyTokenSets.STRING_LITERALS.contains(tokenType) ||
        tokenType == GroovyTokenTypes.mGSTRING_BEGIN ||
        tokenType == GroovyTokenTypes.mGSTRING_CONTENT) {
      final Document document = iterator.getDocument();
      if (document == null) return false;
      final String literal = document.getText().substring(iterator.getStart(), offset + 1);
      if ("'''".equals(literal) || "\"\"\"".equals(literal) || "'".equals(literal) || "\"".equals(literal)) {
        return true;
      }
    }

    return !(GroovyTokenSets.STRING_LITERALS.contains(tokenType) ||
             tokenType == GroovyTokenTypes.mGSTRING_CONTENT ||
             tokenType == GroovyTokenTypes.mGSTRING_END);
  }
@Override
  public boolean hasNonClosedLiteral(Editor editor, HighlighterIterator iterator, int offset)