Ejemplo n.º 1
0
        public void Invoke(CancellationToken cancellationToken)
        {
            // Count the use of the tag
            HugTags.I.Count(Item);

            // Surround the selection with the tags
            TrackingSpan.TextBuffer.Replace(TrackingSpan.GetSpan(Snapshot), Tagged);
        }
Ejemplo n.º 2
0
        public bool Contains(Snapshot snapshot, TrackingSpan span)
        {
            if (this.isBuiltIn)
            {
                return(true);
            }

            return(this.Contains(snapshot, span?.GetSpan(snapshot)));
        }
Ejemplo n.º 3
0
        internal void Advance(ITextVersion toVersion)
        {
            if (TrackingSpan != null)
            {
                TrackingSpan.GetSpan(toVersion);
            }

            foreach (var child in Children)
            {
                child.Advance(toVersion);
            }
        }
            internal void CheckNewIdentifier(StateMachine stateMachine, ITextSnapshot snapshot)
            {
                AssertIsForeground();

                _newIdentifierBindsTask = _isRenamableIdentifierTask.SafeContinueWithFromAsync(
                    async t => t.Result != TriggerIdentifierKind.NotRenamable &&
                    TriggerIdentifierKind.RenamableReference ==
                    await DetermineIfRenamableIdentifierAsync(
                        TrackingSpan.GetSpan(snapshot),
                        initialCheck: false).ConfigureAwait(false),
                    _cancellationToken,
                    TaskContinuationOptions.OnlyOnRanToCompletion,
                    TaskScheduler.Default);

                QueueUpdateToStateMachine(stateMachine, _newIdentifierBindsTask);
            }
Ejemplo n.º 5
0
        public GLSLSignature(Definition definition, TrackingSpan trackingSpan, Snapshot snapshot, ITextView textView, ISignatureHelpSession session)
        {
            GLSL.Text.Span span = trackingSpan.GetSpan(snapshot);

            this.ApplicableToSpan = snapshot.CreateTrackingSpan(GLSL.Text.Span.Create(span.Start, span.End - 1)).ToITrackingSpan();
            this.Content          = definition.ToString();
            this.Documentation    = definition.Documentation;
            this.Parameters       = new ReadOnlyCollection <IParameter>(definition.GetParameters(this));
            this.textView         = textView;
            this.session          = session;

            this.textView.TextBuffer.Changed    += this.TextBufferChanged;
            this.textView.Caret.PositionChanged += this.CaretPositionChanged;

            this.session.Dismissed += this.OnDismissed;

            this.ComputeCurrentParamter(this.textView.TextBuffer.CurrentSnapshot);
        }
Ejemplo n.º 6
0
 public SyntaxNode GetNodeContainingSpan(Snapshot snapshot, TrackingSpan span)
 {
     return(this.GetNodeContainingSpan(snapshot, span.GetSpan(snapshot)));
 }