News

Puppet Previews VS Code Extension

There's now a Visual Studio Code extension -- in technical preview -- for Puppet, the software configuration management tool that automates the delivery and operation of applications and facilitates enterprise DevOps practices.

New in the Visual Studio Code Marketplace is the open source "Puppet Language Support for Visual Studio Code," promising full support for the tool's declarative language.

"We wanted to add Puppet language support to the editor so that we could give a more immersive experience for people writing Puppet manifests and modules," said a deep-dive blog post penned by Puppet software engineer Glenn Sarti, who worked on the extension with James Pogran. "For the initial work we concentrated on the client side Extension and Language Server."

Running on Windows, macOS and Linux, the team's initial work provides:

  • Syntax highlighting
  • Code snippets
  • Linting
  • IntelliSense for resources, parameters and more
  • Validation of metadata.json files
  • Import from puppet resource directly into manifests
  • Node graph preview
  • Puppet Development Kit integration

"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," Puppet said in a blog post yesterday. "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."

The IntelliSense automatically completes the typing of module names, classes, parameters and other symbols, adding hovering functionality that quickly provides context-specific help directly from Puppet modules or previously written code.

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

Using Puppet in VS Code
[Click on image for larger, animated GIF.] Using Puppet in VS Code (source: Puppet).

Developers can also leverage integration with the Puppet Development Kit (PDK), which lets them invoke all PDK commands in multiple ways. For example, the blog post said, "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."

Although the Puppet team is using the VS Code extension in its internal development, it's being published as a technical preview in order to solicit developer feedback, specifically concerning best-practice workflows, feature requests and bug reports. "Some things may change as we receive feedback," the team said. "When we are at a point where we're confident on the workflow we'll move to a 1.0 release."

One feature planned for such a future release is an integrated debugger, allowing developers to set breakpoints inside Puppet code and inspect the catalog. "This is still a work in progress, and we'll share details in the near future," Puppet said.

The open source project's source code is available on GitHub.

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube