mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-21 11:44:59 +00:00
dev: cache expression information correctly (#736)
* dev: cache expression information correctly * rev
This commit is contained in:
parent
2c38695b6f
commit
1d49e110e2
18 changed files with 430 additions and 187 deletions
|
@ -114,13 +114,12 @@ impl StatefulRequest for CompletionRequest {
|
|||
let parent = cano_expr.parent()?;
|
||||
if matches!(parent.kind(), SyntaxKind::Named | SyntaxKind::Args) {
|
||||
let ty_chk = ctx.type_check(&source);
|
||||
if let Some(ty_chk) = ty_chk {
|
||||
let ty = ty_chk.type_of_span(cano_expr.span());
|
||||
log::debug!("check string ty: {ty:?}");
|
||||
if let Some(Ty::Builtin(BuiltinTy::Path(path_filter))) = ty {
|
||||
completion_result =
|
||||
complete_path(ctx, Some(cano_expr), &source, cursor, &path_filter);
|
||||
}
|
||||
|
||||
let ty = ty_chk.type_of_span(cano_expr.span());
|
||||
log::debug!("check string ty: {ty:?}");
|
||||
if let Some(Ty::Builtin(BuiltinTy::Path(path_filter))) = ty {
|
||||
completion_result =
|
||||
complete_path(ctx, Some(cano_expr), &source, cursor, &path_filter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue