Skip to content

Instantly share code, notes, and snippets.

@ionoy
Created November 22, 2017 18:23
Show Gist options
  • Save ionoy/137d707003b57bf978ba84e2b9b44d23 to your computer and use it in GitHub Desktop.
Save ionoy/137d707003b57bf978ba84e2b9b44d23 to your computer and use it in GitHub Desktop.
[Export(typeof(IQuickInfoSourceProvider))]
[Name("Mouse processor")]
[ContentType(Strings.AmmyContentType)]
[TextViewRole(PredefinedTextViewRoles.Interactive)]
internal sealed class QuickInfoSourceProvider : IQuickInfoSourceProvider
{
[Import]
SVsServiceProvider serviceProvider;
public IQuickInfoSource TryCreateQuickInfoSource(ITextBuffer textBuffer)
{
ITextDocument textDocument;
textBuffer.Properties.TryGetProperty(typeof(ITextDocument), out textDocument);
Func<IQuickInfoSource> sc = delegate { return RuntimeLoader.GetObject<IQuickInfoSource>(textDocument.FilePath, t => t.Name == "QuickInfoSource", serviceProvider, textBuffer); };
return textBuffer.Properties.GetOrCreateSingletonProperty(sc);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment