/Insights

IntelliCode Making IntelliSense In Visual Studio

IntelliCode provides AI-assisted IntelliSense for predictive correction across multiple code languages in Visual Studio and Visual Studio Code.

“IntelliSense” is a general term for multiple code editing features that are powered by a language service providing intelligent code completions based on language semantics and source code analysis. If the service detects logical code completions, IntelliSense displays a members list (variables, methods, etc.) that pops up and filters accordingly as you type.

IntelliCode sources Github’s open source projects that have earned over 100 stars. It employs existing code context and patterns to form a dynamic list that helps developers adapt to team styles and patterns. The more code you provide that illustrates your usage patterns, the more concise your team model’s recommendations will be.

IntelliSense Language Service

IntelliCode-generated models

An IntelliCode model is a set of rules that enable the prediction of useful information via code analysis. Your code type and usage metadata are then summarized, extracted, and securely uploaded to IntelliCode. It uses machine learning algorithms to train a model for your code, then returns the model to your computer to generate recommendations by merging:

  • The base model for the language you’re using (trained on thousands of public GitHub repositories).
  • Any team models you’ve trained.
  • Any team models associated with the Git repository you’re working in.
  • Any team models added to your profile from sharing links from others.

The supported languages for AI-assisted IntelliSense completions are:

  • C#, C++, XAML, JavaScript, TypeScript, and Visual Basic for Visual Studio
  • Java, JavaScript, TypeScript, Python, and SQL for Visual Studio Code

IntelliCode team completions “train” codebase models into a shareable repository that auto-updates when tasks are added to a Continuous Integration (CI) build pipeline. This enables Visual Studio to:

  • Analyze your code locally.
  • Extract a summary file with metadata on your code types and their usages.
  • Upload the summary file to IntelliCode and securely train a completions model tailored to your code.
  • Share your completions model (automatically) amongst team members with access to your repo.

IntelliSense Javascript
IntelliSense Javascript

There exist two types of team completion models:

  • Repository-associated - users authorized to clone and edit the repository are granted automatic access to the model. Codebase must be under Git source control and pushed to a remote.
  • User-associated - tied to personal identity and shared with others through a sharing link. Only available for C#.

Once training has been completed, you can view your summary and the new model tailored to your code. You can then author new code using the classes/types specific to your repository - the starred suggestions will tend to be the most visible.

Some IntelliSense features

  • Parameter Info - provides information about the number, names, and types of parameters required by a method, attribute generic type parameter (in C#), or template (in C++). When functions and parameters are annotated with XML Documentation comments, they display as Parameter Info. The compiler-generated XML file can be distributed alongside your .NET assembly so Visual Studio can use IntelliSense to show quick information regarding types and members.
  • Quick Info -displays the complete declaration for any identifier in your code. However, if a function is overloaded, IntelliSense may not display information for all forms of the overload.
  • Complete Word - completes a variable, command, or function name after you have entered enough characters to disambiguate the term.
  • IntelliSense Icons - convey added meaning with icon modifiers:

IntelliSense Iconography
IntelliSense Iconography

Source

Keep your IntelliCode completions fresh with our GitHub Action for Team Completions


Trusted Tech Team: A Microsoft Gold Partner

To receive more details about IntelliCode and IntelliSense for Visual Studio and Visual Studio Code, contact a Trusted Tech Team member for a free consultation. Our Licensing Engineers are here to help you get the most out of your software subscriptions, while providing the lowest possible costs on the market.

...

Subscribe to the Trusted Tech Team Blog

Get the latest posts delivered right to your inbox

Kahlil Crawford

Kahlil Crawford

Trusted Tech Team // Content Strategist

Read More