Skip to content

Commit

Permalink
fix kcl lint err
Browse files Browse the repository at this point in the history
  • Loading branch information
He1pa committed Sep 13, 2023
1 parent b4db614 commit 3f22f55
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
19 changes: 10 additions & 9 deletions kclvm/sema/src/resolver/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,15 @@ impl<'ctx> Resolver<'ctx> {
kind.clone(),
);
let (start, end) = stmt.get_span_pos();

let name = match &import_stmt.asname {
Some(name) => name.clone(),
None => import_stmt.name.clone(),
};
scope.elems.insert(
import_stmt.path.to_string(),
name.clone(),
Rc::new(RefCell::new(ScopeObject {
name: import_stmt.path.to_string(),
name,
start: start.clone(),
end: end.clone(),
ty: Rc::new(ty.clone()),
Expand All @@ -160,18 +165,14 @@ impl<'ctx> Resolver<'ctx> {
name: import_stmt.name.clone(),
asname: import_stmt.asname.clone(),
}),
used: false,
used: true,
doc: None,
})),
);
let name = match &import_stmt.asname {
Some(name) => name.clone(),
None => import_stmt.name.clone(),
};
scope.elems.insert(
name.clone(),
import_stmt.path.to_string(),
Rc::new(RefCell::new(ScopeObject {
name,
name: import_stmt.path.to_string(),
start,
end,
ty: Rc::new(ty),
Expand Down
4 changes: 1 addition & 3 deletions kclvm/tools/src/LSP/src/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ use kclvm_compiler::pkgpath_without_prefix;
use kclvm_config::modfile::KCL_FILE_EXTENSION;

use kclvm_error::Position as KCLPos;
use kclvm_sema::builtin::{
get_system_module_members, STANDARD_SYSTEM_MODULES, STRING_MEMBER_FUNCTIONS,
};
use kclvm_sema::builtin::{get_system_module_members, STRING_MEMBER_FUNCTIONS};
use kclvm_sema::resolver::scope::{ProgramScope, ScopeObjectKind};
use lsp_types::CompletionItem;

Expand Down

0 comments on commit 3f22f55

Please sign in to comment.