Visual Studio IntelliCode Infers C# Coding Conventions
Written by Kay Ewbank   
Wednesday, 18 July 2018

The Visual Studio IntelliCode Extension has been updated to add 'coding convention inference' for C#.  In other words, the extension can look at your existing coding conventions and create a configuration file that best matches the way your code looks.

Once generated, the configuration file will help you maintain consistency in your team’s codebase. IntelliCode works out what to put in the .editorconfig file by scanning code files in your selected projects to create the best matching set of conventions.

 

vsedcode

 

The way this works is that you select the solution, project, or folder level folder where you want the conventions to apply, and choose to add an EditorConfig file. Once created, the EditorConfig files apply enforcement hierarchically to all files below it in the filesystem. If you have subfolders or projects that have different conventions, you can create a new EditorConfig for those subfolders or projects to override the conventions from the higher level.

Once in place, any code that doesn't conform to the style used by the majority of the code is highlighted in the error list in the Messages severity.  This can be altered so they show as warnings or errors. Formatting violations do not show up in the error list.

Visual Studio IntelliCode was announced as an experimental extension for Visual Studio 2017 earlier this year. The extension is designed to improve developer productivity with features like contextual IntelliSense, inference and enforcement for code styles, and focused reviews for your pull requests.

The current version of IntelliCode is based on an Azure machine learning model that offers better code completion and automatic code formatting to match your usual style. It also looks at your code to suggest NET related APIs that are likely to be the most relevant for you given the line of code you’re writing. 

Visual Studio

More Information

Visual Studio IntelliCode Extension

Related Articles

Visual Studio 2019 Will Include IntelliCode

Visual Studio 2017 Released

Visual Studio 2017 15.7 Fully C++17 Compliant

Visual Studio Live Share For Collaboration

Visual Studio For Mac Launched

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Azure Container Apps Dynamic Sessions Generally Available
02/12/2024

Dynamic Session support has been added to Azure Container Apps. Azure Container Apps is a serverless platform for running containerized applications, and dynamic sessions is designed to provide fast a [ ... ]



Remembering Grace Hopper On Her 114th Anniversary
09/12/2024

Today sees the start of Computer Science Education Week and  the 2024 Hour of Code. These educational event are timed to coincide with Grace Hopper's birthday on January 9th, 1906 due to her conc [ ... ]


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Wednesday, 18 July 2018 )