Stuart Preston is an incredibly valued member of the Chef community and has been a key contributor in making an awesome experience using Chef along with the Microsoft product line. Stuart’s most recent addition to the Chef ecosystem is an extension for Visual Studio Code for developing your Chef code. The extension adds the ability to continually lint your code using Rubocop and autocomplete many of the resources found in core Chef.
Note: This post originally appeared on stuartpreston.net
Announcing: Chef Extension for Visual Studio Code
At Microsoft’s Connect() conference today, Visual Studio Code now supports extensions and has been open-sourced!
Over the past couple of weeks I have been working hard behind the scenes to build a Chef Extension for Visual Studio Code to make cookbook development an awesome experience on Windows, OS X and Linux.
The extension currently supports:
Syntax/keyword highlighting –
Visual Studio Code will now recognise and colourise Chef DSL (including Chef Provisioning DSL). You can select from a number of different colour themes also available on the Marketplace.
Rubocop linting –
The quickest way to identify issues in your code is to use a linting tool like Rubocop to perform static code analysis as you go. The Chef extension is preconfigured to automatically run Rubocop against your whole repo every time you save.
Snippet support –
The extension includes autocomplete code snippets for all resources built into the Chef Client.
Here’s a demo of some of the new capabilities:
If you are working with Chef and you haven’t used Visual Studio Code before, I recommend you try it out. Downloads are available for Windows, OS X and Linux from https://code.visualstudio.com. Once you have installed it you can download the Chef Extension directly from within the application’s Command Palette.
At Pendrica we are committed to open source, and making more awesome for the Chef community. We believe that Infrastructure developers using Chef should have the same rich feature set and extended user experience as our counterparts in application development. We hope you enjoy using the extension which is open-sourced on our GitHub page at https://github.com/pendrica/vscode-chef