Giter VIP home page Giter VIP logo

editorconfiglanguage's Introduction

EditorConfig

Build status

Download this extension from the VS Marketplace or get the CI build.


The EditorConfig Project helps developers define and maintain consistent coding styles between different editors and IDEs.

Visual Studio 2017 natively supports .editorconfig files, but it doesn't give language support for editing those files. This extension provides that

For Visual Studio version 2010 to 2015, get the EditorConfig extension instead.

See the change log for changes and road map.

Need help getting started with commands? Check out Microsoft's Reference Guide for details and examples of coding styles available

Features

Create .editorconfig Files

To make it really easy to add a .editorconfig file, you can now right-click any folder, project, solution folder and hit Add -> .editorconfig File

Classification

Syntax Highlighting

Full colorization of the full .editorconfig syntax.

Classification

C# and .NET Style Analyzers

Visual Studio 2017 lets you add C# and .NET specific rules to the .editorconfig file. In addition to enabling various rules, a severity is also added to control how Visual Studio is going to handle these rules.

C# and .NET style analyzers

Each severity is clearly marked by an icon to make it easy to identify.

Intellisense

The extension provides Intellisense for both keywords and values.

Classification

Classification

Code Snippets

Various code snippets have been added to make it easier to work with .editorconfig files.

To insert a snippet, right-click inside the editor or hit Ctrl+K,Ctrl+X.

Snippets

This will show a list of available snippets to insert.

Snippets

Validation

Error squiggles are shown for invalid values.

Classification

Properties that are being overridden by a duplicate property in the same section is easy to identify.

Validate duplicates

If a parent document contains the exact same property and value in a section with the same globbing pattern, a suggestion shows up to remove it.

Validate parent

See the complete list of error codes.

To suppress any error in the .editorconfig document, use the light bulb feature:

Suppress error

That will add a special comment at the top of the file to let the validator know what error messages to suppress.

Suppress Comment

Another way to suppress the error is by right-clicking the error in the Error List.

Suppress from Error list

Hover Tooltips

Hover the mouse over any keyword to see a full description.

Classification

Light Bulbs

Sorting properties, deleting sections, and adding missing rules is easy with the commands being shown as light bulbs in the editor margin.

Light bulbs

Code Formatting

Typing Ctrl+K,D will invoke Visual Studio's Format Document command. By default that will align all the equal (=) delimeters and add 1 space character around both equal- and colon characters. This behavior is configurable in the settings (see below).

Code formatting

Navigational Drop Downs

Dropdown menus at the top of the editor makes it easy to navigate the document.

Navigational drop downs

Inheritance Visualizer

A project can have multiple .editorconfig files and the rules in each cascades from the top-most and down. It is based on folder structure.

The inheritance visualizer is located at the bottom right corner of the editor window and makes it easy to see this relationship.

Inheritance visualizer

You can navigate to the immediate parent document by hitting F12. You can change the shortcut under Tools -> Options -> Environment -> Keyboard and find the command called EditorConfig.NavigateToParent.

Note, the inheritance visualizer is only visible when the current file isn't the root of the hierarchys or by specifying the root = true property.

Settings

Change the behavior of the editor from Tools -> Options or simply by right-clicking in the editor.

Open EditorConfig settings

Settings

Contribute

Check out the contribution guidelines if you want to contribute to this project.

For cloning and building this project yourself, make sure to install the Extensibility Tools 2015 extension for Visual Studio which enables some features used by this project.

References to available formatting/code options directly from Roslyn codebase

License

Apache 2.0

editorconfiglanguage's People

Contributors

advanium avatar allisonchou avatar binaryn3xus avatar dee-see avatar giggio avatar jmarolf avatar madskristensen avatar natemcmaster avatar pawchen avatar rik-smeets avatar sharwell avatar tdavisjr avatar thefanatr avatar tonyhallett avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.