예제 #1
0
        private IEnumerable <ISignature> HandleComma(VsText.ITextSnapshot snapshot, ProbeAppSettings appSettings)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            var fileStore = CodeModel.FileStore.GetOrCreateForTextBuffer(_textBuffer);

            if (fileStore != null)
            {
                var fileName = VsTextUtil.TryGetDocumentFileName(_textBuffer);
                var model    = fileStore.GetMostRecentModel(appSettings, fileName, snapshot, "Signature help after ','");
                var modelPos = (new VsText.SnapshotPoint(snapshot, _triggerPos)).TranslateTo(model.Snapshot, VsText.PointTrackingMode.Negative).Position;

                var argsToken = model.File.FindDownward <ArgsToken>().Where(t => t.Span.Start < modelPos && (t.Span.End > modelPos || !t.IsTerminated)).LastOrDefault();
                if (argsToken != null && argsToken.Signature != null)
                {
                    var modelSpan        = new VsText.SnapshotSpan(model.Snapshot, argsToken.Span.ToVsTextSpan());
                    var snapshotSpan     = modelSpan.TranslateTo(snapshot, VsText.SpanTrackingMode.EdgeInclusive);
                    var applicableToSpan = snapshot.CreateTrackingSpan(snapshotSpan.Span, VsText.SpanTrackingMode.EdgeInclusive, 0);
                    yield return(CreateSignature(_textBuffer, argsToken.Signature, applicableToSpan));

                    foreach (var sig in argsToken.SignatureAlternatives)
                    {
                        yield return(CreateSignature(_textBuffer, sig, applicableToSpan));
                    }
                }
            }
        }
예제 #2
0
        protected override IList <ClassificationSpan> DoGetClassificationSpans(Microsoft.VisualStudio.Text.SnapshotSpan span)
        {
            var result = base.DoGetClassificationSpans(span);

            if (ShouldOverrideOutputWindowTextClassification &&
                (result == null || result.Count == 0))
            {
                var c = ClassificationTypeRegistryService.GetClassificationType(OutputWindowTextClassificationOverride);

                result.Add(new ClassificationSpan(new SnapshotSpan(span.Start, span.Length), c));
            }

            return(result);
        }
예제 #3
0
            public override SourceText WithChanges(IEnumerable <Microsoft.CodeAnalysis.Text.TextChange> changes)
            {
                if (!changes.Any())
                {
                    return(this);
                }

                var span          = new Microsoft.VisualStudio.Text.SnapshotSpan(buffer, 0, buffer.Length);
                var changedBuffer = PlatformCatalog.Instance.TextBufferFactoryService.CreateTextBuffer(span, buffer.ContentType);

                using (var edit = changedBuffer.CreateEdit()) {
                    foreach (var change in changes)
                    {
                        edit.Replace(new Microsoft.VisualStudio.Text.Span(change.Span.Start, change.Span.Length), change.NewText);
                    }
                    edit.Apply();
                }
                return(new ChangedSourceText(changedBuffer.CurrentSnapshot, Encoding, container));
            }
예제 #4
0
 public bool IntersectsBufferSpan(Microsoft.VisualStudio.Text.SnapshotSpan bufferSpan)
 {
     throw new System.NotImplementedException();
 }
예제 #5
0
 public System.Collections.ObjectModel.Collection <Microsoft.VisualStudio.Text.Formatting.ITextViewLine> GetTextViewLinesIntersectingSpan(Microsoft.VisualStudio.Text.SnapshotSpan bufferSpan)
 {
     throw new System.NotImplementedException();
 }
예제 #6
0
 public System.Collections.ObjectModel.Collection <Microsoft.VisualStudio.Text.Formatting.TextBounds> GetNormalizedTextBounds(Microsoft.VisualStudio.Text.SnapshotSpan bufferSpan)
 {
     throw new System.NotImplementedException();
 }
예제 #7
0
 public System.Windows.Media.Geometry GetTextMarkerGeometry(Microsoft.VisualStudio.Text.SnapshotSpan bufferSpan)
 {
     throw new System.NotImplementedException();
 }
예제 #8
0
 public System.Windows.Media.Geometry GetTextMarkerGeometry(Microsoft.VisualStudio.Text.SnapshotSpan bufferSpan, bool clipToViewport, System.Windows.Thickness padding)
 {
     throw new System.NotImplementedException();
 }