提交 d18aa159 编写于 作者: R Ravi Chande 提交者: GitHub

Merge pull request #19296 from rchande/revertquickinfo

Revert "Merge pull request #10993 from rchande/quickinfosession"
......@@ -77,26 +77,14 @@ internal override void OnModelUpdated(Model modelOpt)
}
else
{
var quickInfoItem = modelOpt.Item;
// We want the span to actually only go up to the caret. So get the expected span
// and then update its end point accordingly.
ITrackingSpan trackingSpan;
QuickInfoItem item = null;
var triggerSpan = modelOpt.GetCurrentSpanInSnapshot(quickInfoItem.TextSpan, this.SubjectBuffer.CurrentSnapshot);
var trackingSpan = triggerSpan.CreateTrackingSpan(SpanTrackingMode.EdgeInclusive);
// Whether or not we have an item to show, we need to start the session.
// If the user Edit.QuickInfo's on a squiggle, they want to see the
// error text even if there's no symbol quickinfo.
if (modelOpt.Item != null)
{
item = modelOpt.Item;
var triggerSpan = modelOpt.GetCurrentSpanInSnapshot(item.TextSpan, this.SubjectBuffer.CurrentSnapshot);
trackingSpan = triggerSpan.CreateTrackingSpan(SpanTrackingMode.EdgeInclusive);
}
else
{
var caret = this.TextView.GetCaretPoint(this.SubjectBuffer).Value;
trackingSpan = caret.Snapshot.CreateTrackingSpan(caret.Position, 0, SpanTrackingMode.EdgeInclusive, TrackingFidelityMode.Forward);
}
sessionOpt.PresenterSession.PresentItem(trackingSpan, item, modelOpt.TrackMouse);
sessionOpt.PresenterSession.PresentItem(trackingSpan, quickInfoItem, modelOpt.TrackMouse);
}
}
......@@ -170,7 +158,7 @@ public IList<IQuickInfoProvider> GetProviders()
}
}
return new Model(snapshot.Version, null, null, trackMouse);
return null;
}
}
catch (Exception e) when (FatalError.ReportUnlessCanceled(e))
......
......@@ -20,6 +20,8 @@ internal class Model
IQuickInfoProvider provider,
bool trackMouse)
{
Contract.ThrowIfNull(item);
this.TextVersion = textVersion;
this.Item = item;
this.Provider = provider;
......
......@@ -100,12 +100,6 @@ private void OnEditorSessionDismissed()
internal void AugmentQuickInfoSession(IList<object> quickInfoContent, out ITrackingSpan applicableToSpan)
{
if (_item == null)
{
applicableToSpan = null;
return;
}
applicableToSpan = _triggerSpan;
quickInfoContent.Add(_item.Content.Create());
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册