Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So in Visual Studio 2010 and later, the extensibility APIs you want to at are under the Microsoft.VisualStudio.Languages.IntelliSense namespace. At a high level, you want to MEF export a <code>ICompletionSourceProvider</code> which will provide the items you need. There are two good blog posts <a href="http://blog.robertgreyling.com/2010/05/sparksense-getting-started-wheres.html">here</a> and <a href="http://www.hill30.com/MikeFeingoldBlog/index.php/2009/09/05/django-editor-in-vs-2010-part-7-code-completion-source/">here</a> that demonstrate the basic technique.</p> <p>There are two problems that you'll run into if you wanted to make your screenshot be a reality. (This is why I asked for the scenario, as my advice here would change.) First, this method doesn't legally let you append to an existing completion set, but rather provide a new one. In the UI this appears as two tabs, like the Common/All tabs in the Visual Basic editor. This is a limitation of the current API. You could try to modify one of the existing completion sets in your <code>AugmentCompletionSource</code> but I have no idea if that'd work. It's definitely unsupported, in any case.</p> <p>Second, it's really hard to know when and where to recommend things. In your example, you said "the IntelliSense for <code>string</code>". Sadly, there aren't any APIs (currently) in VS that let you know what the thing before the dot is. You could do some simple heuristics or try implementing some parser that is Good Enough™ for your scenario, but you'll have to accept for now that you won't have perfect results.</p> <p>The <a href="http://msdn.microsoft.com/en-us/roslyn">Roslyn</a> project aims to fix the second issue, so you may find it useful to explore a bit further. Since we expect that lots of people will want to extend completion, we're also thinking about offering other extensibility APIs so you don't have to roll a <code>ICompletionSourceProvider</code> from scratch, but such APIs are not in the current CTP.</p> <p>[Disclaimer: I'm a member of the Roslyn team who works on IntelliSense.]</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload