Announcing Puppet for Visual Studio Code!

We are pleased to announce the technical preview release of the official Visual Studio Code Puppet extension! What started out as a side project done during James Pogran and Glenn Sarti's spare time, has turned into a full-featured official Puppet extension.

The extension supports the following platforms:

  • Microsoft Windows
  • MacOS
  • Linux

How can I install the Puppet VSCode extension?

You can install the Puppet VSCode extension either from the Extensions tab in your VSCode editor, through the Visual Studio Code Extension gallery, or manually after downloading the extension.

You can find more detailed instructions on installation on the readme.

What can I do with the Puppet VSCode extension?

With the Puppet VSCode extension you can edit any Puppet manifest file (ending with a .pp or a .epp) and receive instant syntax validation and highlighting as you type. This also works with metadata.json files. No need to save the file to initiate a puppet-lint run, and errors and warnings are automatically added to the Problems pane as they are discovered.

Intellisense supports autocompleting module names, classes, parameters and other symbols as you type. This works by introspecting code both in your manifest and the available modules and classes, providing more than just simple word matching.

Hovering over any type, resource or parameter provides context specific help that comes directly from the Puppet modules or your code as it's written.

Hover goes one step further in resolving facts as you hover over their declarations. See the values as they are on the system directly in the editor, without having to run Facter in a separate window!

The Puppet VSCode extension integrates with the new Puppet Development Kit, providing command palette invocation of all PDK commands. You can also initiate PDK commands through the editor menu or the right-click menu. In the next version of the extension, we will enable using the PDK instead of requiring a Puppet agent install.

A common task when starting out writing modules is to use puppet resource to get a quick template generated that you can specialize to your environment. You can run puppet resource directly from VSCode using the command palette and it will paste the generated Puppet code into the editor window.

You can preview the Puppet node graph of a manifest while you edit your Puppet code. The extension will generate an image in a side pane that you can view while looking at your code.

What does technical preview mean?

We use the Puppet VSCode extension internally here at Puppet, but we’re still figuring out the best workflows and what features to include, so some things may change as we receive feedback. When we are at a point where we're confident on the workflow we'll move to a 1.0 release.

What's next?

We're working on a few new things, the largest of which is an integrated Puppet debugger where you can set breakpoints inside a Puppet run and inspect the catalog. This is still a work in progress, and we’ll share details in the near future.

Let us know what you think!

You can submit suggestions or bug reports at our GitHub repo. We look forward to hearing your feedback about the extension and what new features you think up!

James Pogran is a senior software engineer at Puppet.

Glenn Sarti is a senior software engineer at Puppet.

Learn more

  • Get the Puppet VSCode Extension here
  • Provide feedback to the Puppet VSCode Extension here
  • Read a deep dive into how the extension works at Glenn's blog
  • For more information about the PDK read this blog post
Puppet sites use proprietary and third-party cookies. By using our sites, you agree to our cookie policy.