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 at Converge 360.

comments powered by Disqus

Featured

  • Hands On: New VS Code Insiders Build Creates Web Page from Image in Seconds

    New Vision support with GitHub Copilot in the latest Visual Studio Code Insiders build takes a user-supplied mockup image and creates a web page from it in seconds, handling all the HTML and CSS.

  • Naive Bayes Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the naive Bayes regression technique, where the goal is to predict a single numeric value. Compared to other machine learning regression techniques, naive Bayes regression is usually less accurate, but is simple, easy to implement and customize, works on both large and small datasets, is highly interpretable, and doesn't require tuning any hyperparameters.

  • VS Code Copilot Previews New GPT-4o AI Code Completion Model

    The 4o upgrade includes additional training on more than 275,000 high-quality public repositories in over 30 popular programming languages, said Microsoft-owned GitHub, which created the original "AI pair programmer" years ago.

  • Microsoft's Rust Embrace Continues with Azure SDK Beta

    "Rust's strong type system and ownership model help prevent common programming errors such as null pointer dereferencing and buffer overflows, leading to more secure and stable code."

  • Xcode IDE from Microsoft Archrival Apple Gets Copilot AI

    Just after expanding the reach of its Copilot AI coding assistant to the open-source Eclipse IDE, Microsoft showcased how it's going even further, providing details about a preview version for the Xcode IDE from archrival Apple.

Subscribe on YouTube

Upcoming Training Events