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

Support settings of custom project path in Kedro Extension #162

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jitu5
Copy link
Contributor

@jitu5 jitu5 commented Dec 11, 2024

Description

Resolves #19

This pull request introduces a new feature to allow setting a custom path to the Kedro project root directory through the configuration. The changes span multiple files to integrate this new feature into the existing system.

How to set Kedro project path

  • In VSCode open command palette by pressing Cmd + Shift + P
  • Type Kedro: Set Project Path
  • Paste your absolute path to Kedro project

or

  • open VScode setting by pressing cmd + ,
  • Search kedro
  • Set Kedro: Set Project Path field with your absolute path to Kedro project

Note

If the user-supplied Kedro project path's folder is not part of the currently open workspace in VSCode, the extension will add it to the workspace explorer as part of a multi-root workspace, alongside any existing folders.

User flow

Screenshot 2024-12-04 at 1 20 02 p m

Development notes

Refactor extension.ts:

  • src/extension.ts: Refactored extension.ts by taking out runServer.ts and registerCommandsAndEvents.ts from it.

Enhancements to Kedro Project Path Handling:

  • bundled/tool/lsp_server.py: Updated methods to utilize kedroProjectPath from workspace settings if available, enhancing flexibility in project path configuration. [1] [2] [3]
  • package.json: Added configuration for kedro.kedroProjectPath and a new command kedro.kedroProjectPath for setting the Kedro project path. [1] [2]

Command and Event Registration:

Utility and Helper Functions:

Configuration and Settings:

QA notes

Keep your Kedro project in below folder structure

root
│   file001.txt    
│
└───folder1
│   │   file011.txt
│   │   file012.txt
│   │
│   └───kedroProject
│       │   pyproject.toml
│       │   README.md
│       │   ...
│   
└───folder2
    │   file021.txt
    │   file022.txt

Copy your absolute path to Kedro project, /Users/Jitendra_Gundaniya/root/folder1/kedroProject

Checklist

  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress

Signed-off-by: Jitendra Gundaniya <[email protected]>
@jitu5 jitu5 self-assigned this Dec 11, 2024
@jitu5 jitu5 added Python Pull requests that update Python code javascript Pull requests that update Javascript code labels Dec 11, 2024
@SajidAlamQB
Copy link
Contributor

Hey @jitu5, I've tested this manually and it seems to work, when I use the new command and open viz it displays the kedro project but it doesn't open its workspace.

@jitu5 jitu5 requested review from SajidAlamQB and noklam December 13, 2024 09:41
@jitu5
Copy link
Contributor Author

jitu5 commented Dec 13, 2024

If the user-supplied Kedro project path's folder is not part of the currently open workspace in VSCode, the extension will add it to the workspace explorer as part of a multi-root workspace, alongside any existing folders.

@SajidAlamQB If the user-supplied Kedro project path's folder is not part of the currently open workspace in VSCode, the extension will add it to the workspace explorer as part of a multi-root workspace, alongside any existing folders. Please re test it and let me know.

@SajidAlamQB
Copy link
Contributor

Please re test it and let me know.

Hey @jitu5 I've tested this manually and its working well. If understood does it now create a new workspace with the existing and selected projects.

@jitu5
Copy link
Contributor Author

jitu5 commented Dec 16, 2024

Please re test it and let me know.

Hey @jitu5 I've tested this manually and its working well. If understood does it now create a new workspace with the existing and selected projects.

@SajidAlamQB Yes it create a new workspace with existing and selected project.

@jitu5 jitu5 marked this pull request as ready for review December 17, 2024 09:46
Copy link
Contributor

@SajidAlamQB SajidAlamQB left a comment

Choose a reason for hiding this comment

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

Hey Jitendra, thanks for this, I've tested it out manually and it all seems to work, I understand what you mean sometimes we need to reload window for it to fully initialise. Is there a way to trigger this after successful use of setting custom project? Otherwise we can document this clearly for users.

Signed-off-by: Jitendra Gundaniya <[email protected]>
@jitu5
Copy link
Contributor Author

jitu5 commented Dec 18, 2024

Hey Jitendra, thanks for this, I've tested it out manually and it all seems to work, I understand what you mean sometimes we need to reload window for it to fully initialise. Is there a way to trigger this after successful use of setting custom project? Otherwise we can document this clearly for users.

@SajidAlamQB I fixed this issue, now no need to use reload window after setting custom Kedro project. could you please test it again. thanks.

Signed-off-by: Jitendra Gundaniya <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code Python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support settings of custom project path
2 participants