From 512710c7cc32d8437973d7f3dadb060b3fb5a3b8 Mon Sep 17 00:00:00 2001 From: Yuhui Fu <75050508+fuyh20@users.noreply.github.com> Date: Wed, 26 Jun 2024 06:24:33 +0800 Subject: [PATCH] Adds extensions to VSCode `python.analysis.extraPaths` settings (#526) This MR adds the path of the isaac lab extensions to vscode `python.analysis.extraPaths` to execute intelligent prompt in vscode properly. Fixes #463 - Bug fix (non-breaking change which fixes an issue) In .vscode/tools/setup_vscode.py ![f9429980-bf0b-4e28-917b-10c0eccc92ce](https://github.com/isaac-sim/IsaacLab/assets/75050508/18cf4868-28be-4907-ae6e-be287ff946b1) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] I have run all the tests with `./isaaclab.sh --test` and they pass - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [ ] I have added my name to the `CONTRIBUTORS.md` or my name already exists there --- .vscode/tools/setup_vscode.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.vscode/tools/setup_vscode.py b/.vscode/tools/setup_vscode.py index 1e682059ce..eee1f7450e 100644 --- a/.vscode/tools/setup_vscode.py +++ b/.vscode/tools/setup_vscode.py @@ -61,6 +61,11 @@ def overwrite_python_analysis_extra_paths(isaaclab_settings: str) -> str: path_names = settings.split(",") path_names = [path_name.strip().strip('"') for path_name in path_names] path_names = ['"${workspaceFolder}/_isaac_sim/' + path_name + '"' for path_name in path_names if len(path_name) > 0] + + # add the path names that are in the Isaac Lab extensions directory + isaaclab_extensions = os.listdir(os.path.join(ISAACLAB_DIR, "source", "extensions")) + path_names.extend(['"${workspaceFolder}/source/extensions/' + ext + '"' for ext in isaaclab_extensions]) + # combine them into a single string path_names = ",\n\t\t".expandtabs(4).join(path_names)