Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update and enhance Kedro VSCode extension documentation #4538

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/development/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
1 change: 0 additions & 1 deletion docs/source/development/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
```{toctree}
:maxdepth: 1

set_up_vscode
set_up_pycharm
commands_reference
debugging
Expand Down
2 changes: 1 addition & 1 deletion docs/source/get_started/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
6 changes: 6 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,79 @@
![](../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

Check warning on line 108 in docs/source/visual_studio_code_extension/set_up_vscode.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/source/visual_studio_code_extension/set_up_vscode.md#L108

[Kedro.toowordy] 'multiple' is too wordy
Raw output
{"message": "[Kedro.toowordy] 'multiple' is too wordy", "location": {"path": "docs/source/visual_studio_code_extension/set_up_vscode.md", "range": {"start": {"line": 108, "column": 12}}}, "severity": "WARNING"}
Comment on lines +106 to +108
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯



### Ways to set a custom path for Kedro project:

#### Using the command palette
Comment on lines +111 to +113
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe

Suggested change
### Ways to set a custom path for Kedro project:
#### Using the command palette
### Set up a custom path using the command palette

(and same with the other H4 below)


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

Check warning on line 121 in docs/source/visual_studio_code_extension/set_up_vscode.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/source/visual_studio_code_extension/set_up_vscode.md#L121

[Kedro.headings] 'Using the VSCode settings UI' should use sentence-style capitalization.
Raw output
{"message": "[Kedro.headings] 'Using the VSCode settings UI' should use sentence-style capitalization.", "location": {"path": "docs/source/visual_studio_code_extension/set_up_vscode.md", "range": {"start": {"line": 121, "column": 6}}}, "severity": "WARNING"}

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

Check warning on line 162 in docs/source/visual_studio_code_extension/set_up_vscode.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/source/visual_studio_code_extension/set_up_vscode.md#L162

[Kedro.toowordy] 'multiple' is too wordy
Raw output
{"message": "[Kedro.toowordy] 'multiple' is too wordy", "location": {"path": "docs/source/visual_studio_code_extension/set_up_vscode.md", "range": {"start": {"line": 162, "column": 23}}}, "severity": "WARNING"}

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.

Check warning on line 164 in docs/source/visual_studio_code_extension/set_up_vscode.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/source/visual_studio_code_extension/set_up_vscode.md#L164

[Kedro.toowordy] 'multiple' is too wordy
Raw output
{"message": "[Kedro.toowordy] 'multiple' is too wordy", "location": {"path": "docs/source/visual_studio_code_extension/set_up_vscode.md", "range": {"start": {"line": 164, "column": 18}}}, "severity": "WARNING"}

### 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will there be any quick way to check the extension has picked up the new project path ? Like some kind of logger or console output which can help users confirm of the change ?



## 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:
Expand Down