public bool TryCreateContext(ITextView textView, SnapshotPoint openingPoint, char openingBrace, char closingBrace, out IBraceCompletionContext context) {
     if (IsValidBraceCompletionContext(openingPoint)) {
         context = new BraceCompletionContext();
         return true;
     } else {
         context = null;
         return false;
     }
 }
            private bool TryGetBraceCompletionContext(out BraceCompletionContext context, CancellationToken cancellationToken)
            {
                var document = SubjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();

                if (document == null)
                {
                    context = default;
                    return(false);
                }

                context = GetBraceCompletionContext(ParsedDocument.CreateSynchronously(document, cancellationToken));
                return(true);
            }
 public bool TryCreateContext(ITextView textView, SnapshotPoint openingPoint, char openingBrace, char closingBrace, out IBraceCompletionContext context)
 {
     if (IsValidBraceCompletionContext(EditorServices.GetBufferInfo(openingPoint.Snapshot.TextBuffer), openingPoint))
     {
         context = new BraceCompletionContext();
         return(true);
     }
     else
     {
         context = null;
         return(false);
     }
 }
 public override Task <bool> AllowOverTypeAsync(
     BraceCompletionContext context,
     CancellationToken cancellationToken
     ) => AllowOverTypeWithValidClosingTokenAsync(context, cancellationToken);
Beispiel #5
0
 public override bool AllowOverType(BraceCompletionContext context, CancellationToken cancellationToken)
 => AllowOverTypeInUserCodeWithValidClosingToken(context, cancellationToken);
 public override bool AllowOverType(BraceCompletionContext braceCompletionContext, CancellationToken cancellationToken)
 => AllowOverTypeWithValidClosingToken(braceCompletionContext);