|
2 | 2 | title: Visual Studio Code
|
3 | 3 | ---
|
4 | 4 |
|
| 5 | +## Devbox Extension |
| 6 | +___ |
| 7 | + |
| 8 | +Devbox has an accompanying [VSCode extension](vscode:extension/jetpack-io.devbox) that makes the experience of integrating your devbox environment in VSCode much simpler. |
| 9 | + |
| 10 | +### Syncing VSCode with Devbox shell |
| 11 | +Follow the steps below to have VSCode's environment be in sync with Devbox shell: |
| 12 | + |
| 13 | +1. [Install](vscode:extension/jetpack-io.devbox) Devbox's VSCode extension |
| 14 | +2. Open a project that has a devbox.json file in VSCode |
| 15 | +3. Open command palette in VSCode (cmd+shift+p) and type: `Devbox: Reopen in Devbox shell environment` |
| 16 | +4. Press Enter and wait for VSCode to reload. |
| 17 | +5. The newly opened VSCode is now integrated with the environment defined your devbox.json. You can test it by checking if packages defined in devbox.json are available in VSCode integrated terminal. |
| 18 | + |
| 19 | +Keep in mind that if you make changes to your devbox.json, you need to re-run Step 3 to make VSCode pick up the new changes. |
| 20 | + |
| 21 | +**NOTE:** This integration feature requires Devbox CLI v0.5.5 and above installed and in PATH. This feature is in beta. Please report any bugs/issues in [Github](https://github.com/jetpack-io/devbox) or our [Discord](https://discord.gg/Rr5KPJq7). |
| 22 | + |
| 23 | +**NOTE2:** This feature is not yet available for Windows and WSL. |
| 24 | + |
| 25 | +### Automatic Devbox shell in VSCode Terminal |
| 26 | + |
| 27 | +Devbox extension runs `devbox shell` automatically every time VSCode's integrated terminal is opened, **if the workspace opened in VSCode has a devbox.json file**. |
| 28 | + |
| 29 | +This setting can be turned off in VSCode's settings. Simply search for `devbox.autoShellOnTerminal` in settings or add the following to VSCode's settings.json: |
| 30 | +```json |
| 31 | +"devbox.autoShellOnTerminal": false |
| 32 | +``` |
| 33 | +Note that running `devbox shell` is not necessary if VSCode is reopened in Devbox shell environment via the steps described in [Syncing VSCode with Devbox shell](#syncing-vscode-with-devbox-shell) |
| 34 | + |
| 35 | +## Direnv Extension |
| 36 | +___ |
| 37 | +Direnv is an open source environment management tool that allows setting unique environment variables per directory in your file system. For more details on how to set it and integrate it with Devbox visit [our Direnv setup guide](ide_configuration/direnv/). |
| 38 | + |
| 39 | +Once Direnv is installed and setup with Devbox, its [VSCode extension](vscode:extension/mkhl.direnv) can also be used to integrate the environment defined in your devbox.json to VSCode. To do that follow the steps below: |
| 40 | + |
| 41 | +1. Install Direnv ([link to guide](https://direnv.net/#basic-installation)) |
| 42 | +2. Setup Devbox shell with Direnv ([link to guide](ide_configuration/direnv/#setting-up-devbox-shell-and-direnv)) |
| 43 | +3. Install Direnv's [VSCode extension](vscode:extension/mkhl.direnv) |
| 44 | +4. Open your Devbox project in VSCode. Direnv extension should show a prompt notification to reload your environment. |
| 45 | +5. Click on reload. |
| 46 | + |
5 | 47 |
|
6 |
| -## Java |
| 48 | +## Manual Setup |
7 | 49 | ___
|
8 |
| -VS Code is a popular editor that supports many different programming languages. This guide covers how to configure VS Code to work with a devbox Java environment. |
| 50 | +VS Code is a popular editor that supports many different programming languages. This section covers how to configure VS Code to work with a devbox Java environment as an example. |
9 | 51 |
|
10 | 52 | ### Setting up Run and Debugger
|
11 | 53 | To create a devbox shell make sure to have devbox installed. If you don't have devbox installed follow the installation guide first. Then follow the steps below:
|
|
0 commit comments