Skip to content

Commit

Permalink
update with lsp ast cache
Browse files Browse the repository at this point in the history
Signed-off-by: he1pa <[email protected]>
  • Loading branch information
He1pa committed Sep 18, 2024
1 parent f01a265 commit 8581bbf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kclvm/parser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ pub type KCLModuleCache = Arc<RwLock<ModuleCache>>;
#[derive(Default, Debug)]
pub struct ModuleCache {
pub ast_cache: IndexMap<String, ast::Module>,
pub asts: ASTCache,
/// Invalid modules and new code, equivalent to paths and k_code_list. The difference is that paths is in the main package.
pub invalidate_module: HashMap<String, Option<String>>,
}
Expand Down Expand Up @@ -341,7 +342,11 @@ impl Loader {

fn _load_main(&mut self) -> Result<LoadProgramResult> {
// for test:
// let asts = ASTCache::default();

// let asts = match &self.module_cache {
// Some(c) => c.read().unwrap().asts.clone(),
// None => ASTCache::default(),
// };
// return parse_kcl_program(
// self.sess.clone(),
// self.paths.clone(),
Expand Down

0 comments on commit 8581bbf

Please sign in to comment.