mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-28 04:09:05 +00:00
chore(els): improve completion
This commit is contained in:
parent
d1ee28db78
commit
7e9cef9c07
8 changed files with 225 additions and 190 deletions
|
@ -38,10 +38,11 @@ impl<Checker: BuildRunnable> Server<Checker> {
|
|||
.filter(|warn| warn.core.main_message.ends_with("is not used"))
|
||||
.collect::<Vec<_>>();
|
||||
for warn in warns {
|
||||
let Some(range) = util::loc_to_range(warn.core.loc) else {
|
||||
let uri = util::normalize_url(Url::from_file_path(warn.input.full_path()).unwrap());
|
||||
let Some(token) = self.file_cache.get_token(&uri, util::loc_to_pos(warn.core.loc).unwrap())? else {
|
||||
continue;
|
||||
};
|
||||
match visitor.get_min_expr(range) {
|
||||
match visitor.get_min_expr(&token) {
|
||||
Some(Expr::Def(def)) => {
|
||||
let Some(mut range) = util::loc_to_range(def.loc()) else {
|
||||
Self::send_log("range not found")?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue