/// <summary> /// Creates a Quick Info provider for the specified context. /// </summary> /// <param name = "textBuffer">The text buffer for which to create a provider.</param> /// <returns> /// A valid <see cref = "T:Microsoft.VisualStudio.Language.Intellisense.IQuickInfoSource" /> instance, or null if none could be created. /// </returns> public override IQuickInfoSource TryCreateQuickInfoSource(ITextBuffer textBuffer) { ITagAggregator <TokenClassificationTag <PSToken> > tagAggregator = TagAggregatorFactory.CreateTagAggregator <TokenClassificationTag <PSToken> >(textBuffer); return(new QuickInfoTokenSource(textBuffer, tagAggregator, this)); }
/// <summary> /// Creates a Quick Info provider for the specified context. /// </summary> /// <param name = "textBuffer">The text buffer for which to create a provider.</param> /// <returns> /// A valid <see cref = "T:Microsoft.VisualStudio.Language.Intellisense.IQuickInfoSource" /> instance, or null if none could be created. /// </returns> public override IQuickInfoSource TryCreateQuickInfoSource(ITextBuffer textBuffer) { return(new QuickInfoErrorSource <PSToken>(textBuffer, TagAggregatorFactory.CreateTagAggregator <ErrorTokenTag <PSToken> >( textBuffer), this)); }
public IOutliningManager GetOutliningManager(ITextView textView) { if (textView == null) { throw new ArgumentNullException("textView"); } if (!textView.Roles.Contains(PredefinedTextViewRoles.Structured)) { return(null); } return(textView.Properties.GetOrCreateSingletonProperty(delegate { var tagAggregator = TagAggregatorFactory.CreateTagAggregator <IOutliningRegionTag>(textView.TextBuffer); var manager = new OutliningManager(textView.TextBuffer, tagAggregator, EditorOptionsFactoryService.GlobalOptions); textView.Closed += delegate { manager.Dispose(); }; return manager; })); }