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); }
public bool Contains(Snapshot snapshot, TrackingSpan span) { if (this.isBuiltIn) { return(true); } return(this.Contains(snapshot, span?.GetSpan(snapshot))); }
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); }
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); }
public SyntaxNode GetNodeContainingSpan(Snapshot snapshot, TrackingSpan span) { return(this.GetNodeContainingSpan(snapshot, span.GetSpan(snapshot))); }