1# Pigweed Extension for Visual Studio Code 2 3Work more effectively with [Pigweed](https://pigweed.dev) projects in Visual 4Studio Code! 5 6## Usage 7 8Right now, all functionality is exposed through [tasks](https://code.visualstudio.com/docs/editor/tasks), 9so your first step will be to open the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) 10and select `Tasks: Run Task`. 11 12### Sync your IDE to your project 13 14Running the `Pigweed: Sync IDE` task is the equivalent of running the 15[`pw ide sync`](https://pigweed.dev/pw_ide/#sync) CLI command. 16 17### Manage C++ target toolchains 18 19For more information, see [this page](https://pigweed.dev/docs/editors.html#c-c) 20in the Pigweed docs. 21 22Running the `Pigweed: Set C++ Target Toolchain` will display a list of available 23target toolchains. Simply select one, and `clangd` will be configured to use it. 24 25### Manage the Python virtual environment 26 27Usually, `Pigweed: Sync IDE` will automatically configure Visual Studio Code to 28use the correct Pigweed Python virtual environment. But if you need to change 29this manually, you can do so with `Pigweed: Set Python Virtual Environment`. 30 31### Launch Pigweed activated terminals 32 33Run `Pigweed: Launch Activated Terminal`, or 34`Pigweed: Bootstrap Activated Terminal` if you need to bootstrap first. 35 36### Other tasks 37 38- `Pigweed: Format` == `pw format --fix` 39- `Pigweed: Presubmit` == `pw presubmit` 40 41### Found a bug? 42 43Run `Pigweed: File Bug` to let us know! 44 45## Configuration 46 47This extension provides the following configuration options: 48 49- `pigweed.enforceExtensionRecommendations`: If set to `true`, recommendations 50 in your project's `extensions.json` will be enforced. Recommended extensions 51 will need to be installed, and non-recommended extensions will need to be 52 disabled in the project's workspace. 53 54## Developing 55 56If you want to contribute to this extension, here's how you can get started: 57 58- Ensure that you have `npm` installed globally; this doesn't use the 59 distribution provided by Pigweed yet. 60 61- Open the `pigweed/pw_ide/ts/pigweed-vscode` directory directly in Visual 62 Studio Code. 63 64- Run `npm install` to add all dependencies. 65 66- Run "Run Extension" in the "Run and Debug" sidebar, or simply hit F5. A new 67 Visual Studio Code window will open with the extension installed. 68 69- Make changes. The build will update automatically. Click the little green 70 circle-with-an-arrow icon at the top of your development window to update 71 the extension development host with the new build. 72 73- Run tests: `npm run test` 74 75### Building 76 77- Install the build tool: `npm install -g @vscode/vsce` 78 79- Run `pw ide vscode --build-extension` 80