Skip to content

Commit

Permalink
chore: enhance metadata fetch perf (#930)
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy authored Nov 29, 2023
1 parent 1d7ae69 commit 714622b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion kclvm/driver/src/kpm_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ impl Metadata {
/// [`fetch_metadata`] returns the KCL module metadata.
#[inline]
pub fn fetch_metadata(manifest_path: PathBuf) -> Result<Metadata> {
fetch_mod_metadata(manifest_path.clone()).or(fetch_kpm_metadata(manifest_path))
use std::result::Result::Ok;
match fetch_mod_metadata(manifest_path.clone()) {
Ok(result) => Ok(result),
Err(_) => fetch_kpm_metadata(manifest_path),
}
}

/// [`fetch_kpm_metadata`] will call `kpm metadata` to obtain the metadata.
Expand Down
4 changes: 2 additions & 2 deletions kclvm/tools/src/LSP/src/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,12 @@ fn completion_import_builtin_pkg(program: &Program, pos: &KCLPos) -> IndexSet<KC

/// Complete schema name
///
/// ```no_run
/// ```no_check
/// #[cfg(not(test))]
/// p = P<cursor>
/// ```
/// complete to
/// ```no_run
/// ```no_check
/// #[cfg(not(test))]
/// p = Person(param1, param2){}<cursor>
/// ```
Expand Down
Empty file.

0 comments on commit 714622b

Please sign in to comment.