The Chef Infra Extension for Visual Studio Code offers rich language support for Chef Infra DSL and snippets when using Visual Studio Code.
- Chef Infra Recipe DSL
- Chef Infra built-in Resources
- Chef Infra Custom Resources
- Enabled by default (disable by adding
{ "rubocop.enable": false }
in user/workspace settings) and activated when the first Ruby file is loaded. - The entire repo will be linted when files are saved.
- If you have Chef Workstation installed, linting should "just work" on Windows, macOS and Linux. Cookstyle will be used by default.
- If you do not have Chef Workstation but do have Rubocop installed, you can set the executable path by setting
{ "rubocop.path": "c:\\path\\to\\rubocop.bat"}
in user/workspace settings). - To override the config file used by Rubocop/Cookstyle, use the
{ "rubocop.configFile": "path/to/config.yml" }
in user/workspace settings.
- Please review the Resource snippets for a complete list.
- Please review the Metadata snippets for a complete list.
- Please review the DSL snippets for a complete list.
- You will need to install Visual Studio Code
1.0
or higher. - From the command palette
Ctrl-Shift-P
(Windows, Linux) orCmd-Shift-P
(OSX) selectInstall Extension
, chooseChef
and reload Visual Studio Code.
Contributions are welcomed, please file issues and pull requests via the project homepage.
This project contains development launch settings. A recent Node.js LTS build is required.
npm install
npm install -g typescript
npm install -g vsce
To produce a local .vsix for testing:
vsce package
Executing prepublish script 'npm run vscode:prepublish'...
> [email protected] vscode:prepublish /Users/tsmith/dev/work/vscode-chef
> tsc -p ./
DONE Packaged: /Users/tsmith/dev/work/vscode-chef/chef-1.4.0.vsix (15 files, 39.32KB)
To test the extension locally.
code --install-extension C:\projects\chef\vscode-chef\chef-1.4.0.vsix
To release requires a PAT token for the relevant publisher on the Visual Studio Marketplace.
vsce publish
Executing prepublish script 'npm run vscode:prepublish'...
> [email protected] vscode:prepublish /Users/tsmith/dev/work/vscode-chef
> tsc -p ./
Publishing [email protected]...
DONE Published [email protected]
Your extension will live at https://marketplace.visualstudio.com/items?itemName=chef-software.chef (might take a few minutes for it to show up).
This extension was written by Stuart Preston ([email protected])
This extension is licensed under an Apache 2 license.
(c) 2015-2019 Chef Software, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.