private bool OnClosingParenthesisTyped()

in Backend/Core/ForTea.Core/Services/TypingAssist/T4TypingAssist.cs [338:355]


    private bool OnClosingParenthesisTyped([NotNull] ITypingContext context)
    {
      var textControl = context.TextControl;
      if (!IsInAttributeValue(textControl)) return false;

      // Get the token type after caret
      var lexer = GetCachingLexer(textControl);
      int offset = textControl.Selection.OneDocRangeWithCaret().GetMinOffset();
      if (lexer == null || offset <= 0 || !lexer.FindTokenAt(offset)) return false;
      var tokenType = lexer.TokenType;

      // If it's not a parenthesis, we don't care, so let the IDE handle it
      if (tokenType != T4TokenNodeTypes.RIGHT_PARENTHESIS) return false;

      // If it is, over-type it
      textControl.Caret.MoveTo(offset + 1, CaretVisualPlacement.DontScrollIfVisible);
      return true;
    }