Ⅰ. 插件描述
Puppet Visual Studio Code ExtensionⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'lingua-pupuli/puppet-vscode'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'lingua-pupuli/puppet-vscode'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'lingua-pupuli/puppet-vscode'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/lingua-pupuli/puppet-vscode
Ⅳ. 文档说明
# Puppet Extension for Visual Studio Code
Puppet VSCode Website
We are proud to announce the new Puppet VSCode website https://puppet-vscode.github.io/! This website contains all of the documenation previously held in this README, simplified and organinzed. There is also new content that shows off all the current features in greater detail, as well as new ways to use the Puppet VSCode Extension with other technologies like the Microsoft Remote Development Extension Pack. This README retains some quick information on how to get started and where to get help if things go wrong.
Table of Contents
- Quick Start
- Features
- Requirements
- Platform Support
- Installing the Extension
- Configuration
- Reporting Problems
- Maintainers
- Telemetry
- License
Quick start
For a more detailed walkthrough see the official documentation
- Step 1: Install a supported version of the Puppet Development Kit on your system (see Requirements for more information).
- Step 2: Install the Puppet extension for Visual Studio Code.
- Step 3: Open or create a Puppet manifest file (a file with a
.ppor.eppextension or namedPuppetfile) and start automating!
Features
A Visual Studio Code extension that provides rich support for the Puppet language, including features such as syntax highlighting, linting, debugging, IntelliSense and more.
This extension provides full Puppet Language support for Visual Studio Code.
- Syntax highlighting
- IntelliSense for resources, parameters and more
- Outline View
- Breadcrumbs
- Go to Symbol
- Open Symbol by Name
- Linting
- Live Workspace Intellisense
- Code snippets
- Go to Definition of functions, types and classes
- Validation of
metadata.jsonfiles - Import from
puppet resourcedirectly into manifests - Node graph preview
- Puppet Development Kit integration
- (Experimental) Local debugging of Puppet manifests
- DEPRECATED Docker Language Server support
It is currently in technical preview, so that we can gather bug reports and find out what new features to add.
Supported Puppet Versions
The Puppet Extension for VSCode works with Puppet 4 or higher. Some features will be slower or not work on Puppet 4, and are noted in the section for that feature. See open source Puppet and Puppet Enterprise lifecycle pages for version support details.
Requirements
You will need to have the Puppet Development Kit (PDK) or Puppet Agent installed in order to fully use this extension.
Note: When using PDK, version 1.5.0 or higher is required.
You can find instructions and installation links here:
PDK
Puppet-Agent
Platform support
- Microsoft Windows
- MacOSX
- Linux
Installing the Extension
You can install the official release of the Puppet extension by following the steps in the Visual Studio Code documentation. In the Extensions pane, search for "puppet-vscode" extension and install it there. You will get notified automatically about any future extension updates!

You can also install the extension without access to the internet by following these instructions
Experience a Problem?
Puppet Agent Install
A commonly encountered problem is not having the PDK or Puppet Agent installed on the computer you are running VSCode on. As noted in the Requirements section, you will need to have the PDK or Puppet Agent installed in order to fully use this extension, as the extension uses the Puppet binaries and the Ruby language bundled into the PDK or agent install in order to function.
If you are receiving an error right after opening a Puppet file saying that a Puppet Agent install could not be found, ensure that Puppet is installed on the system. The VSCode extension attempts to find a valid Puppet install if a path is not configured in puppet.installDirectory in User Settings, so if Puppet is installed but not in a default path please check that your setting points to the correct path.
Reloading the Puppet VSCode extension
If you haven't see the Problems Pane update in awhile, or hover and intellisense doesn't seem to showing up, and you might not know what to do. Sometimes the Puppet extension can experience problems which cause the language server to crash or not respond. The extension has a way of logging the crash, but there is something you can do to get right back to working: reload the Puppet Language Server.
You can reload the Puppet Lanuguage Server by opening the command palette and starting to type Reload. A list of commands will appear, select Reload Window. This will reload the Visual Studio Code window without closing down the enitre edtior, and without losing any work currently open in the editor.
Reporting Problems
If you're having trouble with the Puppet extension, please follow these instructions
to file an issue on our GitHub repository:
1. File an issue on our Issues Page
Make sure to fill in the information that is requested in the issue template as it
will help us investigate the problem more quickly.
2. Capture verbose logs and send them to us
If you're having an issue with crashing or other erratic behavior, add the following
line to your User Settings in Visual Studio Code:
"puppet.editorService.loglevel": "debug",
"puppet.editorService.debugFilePath": "C:\\Some\\file\\path.txt"Restart Visual Studio Code and try to reproduce the problem, then examine the log. If the issue persists please open an issue and add both the content of the Output pane as well as the content in the log file. Please inspect the log and be sure to redact any information you would not want posted publicly.
Maintainers
Telemetry
This extension collects telemetry data to help us build a better experience for writing manifest and modules with Puppet and VS Code. We only collect data on which commands are executed. We do not collect any information about files, paths, etc. The extension respects the telemetry.enableTelemetry setting which you can learn more about in our FAQ.
License
This extension is licensed under the Apache-2.0 License.