Open changsun20 opened 3 months ago
Good Job! @changsun20 Thanks for the proposal. ❤️
cc @zong-zhe @He1pa Could you help review it?
Manage operations for different tasks. Resolve the information contained in the edited configuration files, compare it with the dependencies in current environment, and check if further operations are needed.
- Trigger installation event, and run kcl mod add command.
- Trigger update event, and run kcl mod update command.
what means of installation and update event
? It is user action of add/update dependencies in kcl.mod, or event in language server state? If so, kcl mod update
would be more appropriate
Hi @changsun20 😄
You can also add some design details, including:
API design: Watch System should be called to KCL LSP as a tripartite library, giving an API or abstract interface.
The contents of the Watch System should be divided into some subtasks, and the corresponding time point should be clearly defined. If it cannot be divided, the time point of the overall task can be given.
The Watch System and the integration of kpm and IDE are all the work, and the integration should be considered together with the watch system when planning the time schedule.
what means of installation and update
event
? It is user action of add/update dependencies in kcl.mod, or event in language server state? If so,kcl mod update
would be more appropriate
Well, I think my initial thought was user action of add/update. So yes you are write, the language here is not precise enough.
API design: Watch System should be called to KCL LSP as a tripartite library, giving an API or abstract interface.
The contents of the Watch System should be divided into some subtasks, and the corresponding time point should be clearly defined. If it cannot be divided, the time point of the overall task can be given.
The Watch System and the integration of kpm and IDE are all the work, and the integration should be considered together with the watch system when planning the time schedule.
Sure, I'll handle these updates ASAP.
Overview
The KCL dependency watch system is a component designed to monitor and manage dependencies within KCL projects. It is inspired by the efficiency and user-friendliness of tools like Cargo for Rust, aiming to provide a seamless development experience by handling real-time dependency updates and integration with the KCL language server.
Note: This issue serves as a work-in-progress outline for the design and implementation of the watch system.
Previous issues and discussions
Design Goals
Core Components
1. Watcher
2. File Type and Change Detector
3. Handler Registry
kcl mod add
command.kcl mod update
command..json
and.yaml
files in the future.4. Configuration Manager (optional for users, in order to lower the cost of releases)
Example Workflow: Dependency Update on Configuration Change
kcl.mod
file in the project, and start monitoring for changes.kcl.mod
to add/update a dependency.kcl.mod
file and compare it with the packages in working environment, which turned out that the dependency has not been installed yet. It then triggers another add/update event, and runskcl mod add/update xxx
command.Challenges
kcl.mod
to manage dependencies effectively.Proposed Solutions
kcl.mod
to ensure accurate dependency management.