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

[LFX] Enhancement: KCL IDE automatically updates the dependencies through kpm #998

Open
zong-zhe opened this issue Jan 24, 2024 · 10 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed lsp

Comments

@zong-zhe
Copy link
Contributor

zong-zhe commented Jan 24, 2024

Enhancement

When a KCL package is loaded using KCL IDE, the IDE automatically updates the dependencies of the current KCL package through the kcl mod command.

PreTest

@zong-zhe zong-zhe added enhancement New feature or request help wanted Extra attention is needed lsp labels Jan 24, 2024
@zong-zhe zong-zhe added this to the v0.8.0 Release milestone Jan 24, 2024
@Peefy Peefy added the good first issue Good for newcomers label Jan 24, 2024
@octonawish-akcodes
Copy link
Contributor

Can I some more context here? @zong-zhe @Peefy

@zong-zhe
Copy link
Contributor Author

Hi @octonawish-akcodes 😄

Let me add more details to this issue.

KCL IDE is the main interface for users to write KCL, and kpm is the package management tool for KCL, used for managing KCL's third-party libraries.

KCL IDE is developed based on LSP - https://microsoft.github.io/language-server-protocol/
@He1pa 😊 can provide more details about KCL IDE.

KCL IDE uses kpm commands to manage KCL packages. The main work of this issue is to make KCL IDE automatically update the current KCL package's third-party dependencies according to the kcl.mod file in the KCL package when loading the KCL package, so that a legal KCL package will not cause errors cased by the third-party dependencies has not been updated.

The command used by kpm to update the KCL package's third-party library is kcl mod update, more details

Sorry that there is no document about `kcl mod update` on the official website https://kcl-lang.io/docs/tools/cli/package-management/command-reference/init, which is our negligence. We have raised an issue https://github.com/kcl-lang/kcl-lang.io/issues/253 to track this issue.

We previously integrated a command kcl mod metadata to help the IDE find KCL third-party libraries during the compilation process. kcl mod updatecan be integrated with KCL IDE in a similar way

If any other questions, please let me know 😄 😄 😄

@octonawish-akcodes
Copy link
Contributor

Just a small query, how can I test my code?

@d4v1d03
Copy link
Contributor

d4v1d03 commented Jan 30, 2024

/assign

@d4v1d03
Copy link
Contributor

d4v1d03 commented Feb 1, 2024

Hey @zong-zhe, i got over the explaination you've given and have doubts regarding my conclusion, please correct me if i am wrong. So the fetch_metadata() function just gives us the output that fetch_mod_metadata() function returns after it passes the command 'kcl mod metadata'... from this, we store those third-party dependencies and iterate over each and verify if they need to be upgraded or not.

@d4v1d03
Copy link
Contributor

d4v1d03 commented Feb 1, 2024

I can try to figure this out on my own but can you please save my time by mentioning how do i check this "version of a third-party dependency".Thank you. 😊

@octonawish-akcodes
Copy link
Contributor

I believe you can see the versions of those third party dependencies in kcl.mod file.

@zong-zhe
Copy link
Contributor Author

zong-zhe commented Feb 5, 2024

Hey @zong-zhe, i got over the explaination you've given and have doubts regarding my conclusion, please correct me if i am wrong. So the fetch_metadata() function just gives us the output that fetch_mod_metadata() function returns after it passes the command 'kcl mod metadata'... from this, we store those third-party dependencies and iterate over each and verify if they need to be upgraded or not.

Hi @d4v1d03 😄
Good question ! 👍 Our design is that all functionalities related to package management are handled by kpm. The KCL IDE is only responsible for sending requests to kpm and obtaining the corresponding processing results. Therefore, the storage and validation of third-party dependencies is done in kpm.

kpm is here ! - https://github.com/kcl-lang/kpm

@zong-zhe
Copy link
Contributor Author

zong-zhe commented Feb 5, 2024

I can try to figure this out on my own but can you please save my time by mentioning how do i check this "version of a third-party dependency".Thank you. 😊

Hi @d4v1d03 , The Package Version Management is still in progress.
More details here: kcl-lang/kpm#246

@d4v1d03
Copy link
Contributor

d4v1d03 commented Feb 6, 2024

Ok @zong-zhe , thanks for the clarification. I will work on the pretest you mentioned over here. Are there any couple more to work on so i could get a good grasp of kpm.

@Peefy Peefy changed the title Enhancement: KCL IDE automatically updates the dependencies through kpm [LFX] Enhancement: KCL IDE automatically updates the dependencies through kpm Feb 22, 2024
@Peefy Peefy modified the milestones: v0.8.0 Release, v0.9.0 Release Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed lsp
Projects
Status: No status
Development

No branches or pull requests

4 participants