diff --git a/docs/source/development/debugging.md b/docs/source/development/debugging.md index 3e09b0befd..55dae6abf3 100644 --- a/docs/source/development/debugging.md +++ b/docs/source/development/debugging.md @@ -5,6 +5,6 @@ Our debugging documentation has moved. Please see our existing guides: ``` * [Debugging a Kedro project within a notebook or IPython shell](../notebooks_and_ipython/kedro_and_notebooks.md#debugging-a-kedro-project-within-a-notebook) for information on how to debug using the `%load_node` line magic and an interactive debugger. -* [Debugging in VS Code](./set_up_vscode.md#debugging) for information on how to set up VS Code's built-in debugger. +* [Debugging in VS Code](./../visual_studio_code_extension/set_up_vscode.md#debugging) for information on how to set up VS Code's built-in debugger. * [Debugging in PyCharm](./set_up_pycharm.md#debugging) for information on using PyCharm's debugging tool. * [Debugging in the CLI with Kedro Hooks](../hooks/common_use_cases.md#use-hooks-to-debug-your-pipeline) for information on how to automatically launch an interactive debugger in the CLI when an error occurs in your pipeline run. diff --git a/docs/source/development/index.md b/docs/source/development/index.md index ccdeeecbfc..a72bd61be1 100644 --- a/docs/source/development/index.md +++ b/docs/source/development/index.md @@ -3,7 +3,6 @@ ```{toctree} :maxdepth: 1 -set_up_vscode set_up_pycharm commands_reference debugging diff --git a/docs/source/get_started/install.md b/docs/source/get_started/install.md index fe75decda2..b26b318469 100644 --- a/docs/source/get_started/install.md +++ b/docs/source/get_started/install.md @@ -83,7 +83,7 @@ conda deactivate ### Optional: Integrate Kedro in VS Code with the official extension Working in an IDE can be a great productivity boost. -For VS Code Users: Checkout [Set up Visual Studio Code](../development/set_up_vscode.md) and [Kedro VS Code Extension](../development/set_up_vscode.md#kedro-vs-code-extension) +For VS Code Users: Checkout [Set up Visual Studio Code](../visual_studio_code_extension/set_up_vscode.md) and [Kedro VS Code Extension](../visual_studio_code_extension/set_up_vscode.md#kedro-vs-code-extension) For PyCharm Users: Checkout [Set up PyCharm](../development/set_up_pycharm.md) ## How to install Kedro using `pip` diff --git a/docs/source/index.rst b/docs/source/index.rst index 4e4578f18f..501028cf8e 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -102,6 +102,12 @@ Welcome to Kedro's award-winning documentation! development/index.md deployment/index.md +.. toctree:: + :maxdepth: 2 + :caption: Kedro VS Code Extension + + visual_studio_code_extension/set_up_vscode.md + .. toctree:: :maxdepth: 2 :caption: Contribute to Kedro diff --git a/docs/source/meta/images/vscode_set_custom_path_using_command_palette.gif b/docs/source/meta/images/vscode_set_custom_path_using_command_palette.gif new file mode 100644 index 0000000000..0c55294cf4 Binary files /dev/null and b/docs/source/meta/images/vscode_set_custom_path_using_command_palette.gif differ diff --git a/docs/source/meta/images/vscode_set_custom_path_using_settings_ui.gif b/docs/source/meta/images/vscode_set_custom_path_using_settings_ui.gif new file mode 100644 index 0000000000..1b5d238473 Binary files /dev/null and b/docs/source/meta/images/vscode_set_custom_path_using_settings_ui.gif differ diff --git a/docs/source/development/set_up_vscode.md b/docs/source/visual_studio_code_extension/set_up_vscode.md similarity index 78% rename from docs/source/development/set_up_vscode.md rename to docs/source/visual_studio_code_extension/set_up_vscode.md index 3429b31faa..9242d2be32 100644 --- a/docs/source/development/set_up_vscode.md +++ b/docs/source/visual_studio_code_extension/set_up_vscode.md @@ -99,6 +99,79 @@ To start a build, go to **Terminal > Run Build Task...** or press `Cmd + Shift + ![](../meta/images/vscode_run.png) +## Setting a custom Kedro project path + +Starting with Kedro VS Code extension version 0.3.0, you can now specify a custom path to your Kedro project. This is useful when: + +- Your Kedro project is not at the root of your workspace +- You want to work with a Kedro project that is outside your current workspace +- You have multiple Kedro projects and want to switch between them + + +### Ways to set a custom path for Kedro project: + +#### Using the command palette + +1. Open the Command Palette by pressing `Cmd + Shift + P` (macOS) or `Ctrl + Shift + P` (Windows/Linux) +2. Type `Kedro: Set Project Path` and select it +3. Enter the absolute path to your Kedro project (for example, `/Users/username/projects/my-kedro-project`) + +![Setting Kedro project path through Command Palette](../meta/images/vscode_set_custom_path_using_command_palette.gif) + +#### Using the VSCode settings UI + +1. Open VS Code settings by pressing `Cmd + ,` (macOS) or `Ctrl + ,` (Windows/Linux) +2. Search for `kedro` in the settings search bar +3. Find the `Kedro: Project Path` setting +4. Enter the absolute path to your Kedro project in the field + +![Setting Kedro project path through Settings](../meta/images/vscode_set_custom_path_using_settings_ui.gif) + +### Multi-root workspace integration + +If the Kedro project path you specify is not part of your current workspace, the extension will automatically add it to your workspace as part of a multi-root workspace. This allows you to: + +- See the project files in the Explorer +- Navigate the project structure +- Use all Kedro extension features with the specified project + +### Example directory structure + +If your Kedro project is nested within other folders, setting a custom project path can help the extension locate it. For example: + +``` +root +│ file001.txt +│ +└───folder1 +│ │ file011.txt +│ │ file012.txt +│ │ +│ └───kedroProject <-- Set this path +│ │ pyproject.toml +│ │ README.md +│ │ ... +│ +└───folder2 + │ file020.txt + │ file021.txt +``` + +In this case, you would set the Kedro project path to the absolute path of the `kedroProject` directory, such as `/Users/username/root/folder1/kedroProject`. + +### Switching between multiple projects + +If you work with multiple Kedro projects, you can switch between them by updating the project path setting. The extension will automatically detect the change and reconfigure itself to work with the newly specified project. + +### Troubleshooting + +If the extension doesn't recognise your Kedro project after setting a custom path: + +1. Ensure the path points to a valid Kedro project (containing `pyproject.toml` with Kedro dependencies) +2. Check that the path is an absolute path, not a relative one +3. Reload VS Code if the changes don’t take effect. + + ## Debugging To debug, you _may_ need to create an `.env` file in your project root. Add the full path to the `./src/` folder to the *PYTHONPATH* environment variable in the `.env` file: