News

Visual Studio's AI-Assisted IntelliCode Now Infers and Enforces Coding Conventions

Visual Studio's AI-assisted IntelliCode is getting smarter: It now infers coding conventions by scanning existing code, and lets you know when new code violates those conventions.

IntelliCode was introduced in preview at Microsoft's Build conference in May, putting artificial intelligence to work to improve the existing IntelliSense that provides code completion tips.

It comes in a Visual Studio Marketplace extension and leverages machine learning to provide several benefits, including contextual IntelliSense, inference and enforcement for code styles and focused reviews for pull requests.

On the code style enforcement front, Microsoft just updated the extension with more intelligence, providing coding convention inference for C# code.

An .editorconfig File Generated by IntelliCode
[Click on image for larger view.] An .editorconfig File Generated by IntelliCode (source: Microsoft).

"With this update, the IntelliCode extension can now generate an .editorconfig file on-demand that best matches the coding conventions used in your codebase; no more long discussions with your team about the best convention to use!" Microsoft said in a post this week. "Once generated, this file will help you maintain consistency in your team’s codebase. Fixing up formatting issues is quick and easy with the Quick Action lightbulb menu (Ctrl+. or Alt+Enter) or with the new configurable Format Document (Ctrl+K, D) in Visual Studio 2017 version 15.8 Preview 3 and higher."

Developers can trigger generation of the .editorconfig file in a couple of different ways and direct what code files are enforced by placing it in the project directory structure to work with files "below" it. So it can be applied to the whole project or subfolders if developers want to apply different coding conventions to different projects.

Coders also have leeway in how seriously style violations are enforced. The default is "message" severity, though that can be upgraded to "warning" or "error."

While the tool works only with C# code now, support for more programming languages is on tap. Mark Wilson-Thomas, senior program manager, Visual Studio IDE Team, said as that support and more scenarios are added to the tool, Microsoft will announce a limited preview of IntelliCode.

As of this writing, the preview extension has been installed more than 52,000 times, earning a 4.7 (0-5 scale) from 20 developers who provided reviews.

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

  • Copilot Workspace Does Web App in Minutes, No Coding Required

    Here's a taste of our no-coding future, thanks to Copilot AI.

  • Microsoft Previews Mads Kristensen Keynote at Orlando Dev Conference

    Microsoft today previewed a keynote presentation by Visual Studio guru Mads Kristensen at an upcoming developer/IT pro event where he will be joined by other company dev luminaries such as Jon Galloway, Rachel Kang, and James Montemagno.

  • Syncfusion Open Sources 14 Controls for .NET MAUI

    Third-party .NET-centric dev UI tooling specialist Syncfusion this week announced the open sourcing of 14 controls for .NET MAUI, the evolution of Xamarin.Forms that adds support for building desktop apps.

  • Kubernetes for Developers

    "Kubernetes has a lot of 'moving parts' so can be intimidating at first," says Dan Wahlin, a principal cloud developer advocate at Microsoft who promises to explain everything at a developer conference next month in Orlando.

Subscribe on YouTube