Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
Signed-off-by: he1pa <[email protected]>
  • Loading branch information
He1pa committed Aug 29, 2024
1 parent 328405a commit 91eccf4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

[dependencies]
k8s = { oci = "oci://ghcr.io/kcl-lang/k8s", tag = "1.28" }

Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ version = "0.0.4"

[dependencies]
konfig = { git = "https://github.com/awesome-kusion/konfig.git", tag = "v0.0.1" }

9 changes: 2 additions & 7 deletions kclvm/tools/src/LSP/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crossbeam_channel::after;
use crossbeam_channel::select;
use indexmap::IndexSet;
use kclvm_ast::MAIN_PKG;
use kclvm_driver::lookup_compile_workspace;
use kclvm_driver::toolchain;
use kclvm_driver::toolchain::Metadata;
use kclvm_driver::WorkSpaceKind;
Expand Down Expand Up @@ -78,7 +79,6 @@ use crate::app::main_loop;
use crate::compile::Params;
use crate::goto_def::goto_def;
use crate::hover::hover;
use crate::state::KCLEntryCache;
use crate::state::KCLGlobalStateCache;
use crate::state::KCLVfs;
use crate::to_lsp::kcl_diag_to_lsp_diags_by_file;
Expand Down Expand Up @@ -155,7 +155,7 @@ pub(crate) fn compile_test_file_and_metadata(

let file = test_file.to_str().unwrap().to_string();

let entry_cache = KCLEntryCache::default();
let metadata = lookup_compile_workspace(&toolchain::default(), &file, true).2;
let (diags, compile_res) = compile_with_params(Params {
file: Some(file.clone()),
module_cache: Some(KCLModuleCache::default()),
Expand All @@ -165,11 +165,6 @@ pub(crate) fn compile_test_file_and_metadata(
});
let (program, gs) = compile_res.unwrap();

let metadata = entry_cache
.read()
.get(&file)
.and_then(|metadata| metadata.0 .2.clone());

(file, program, diags, gs, metadata)
}

Expand Down

0 comments on commit 91eccf4

Please sign in to comment.