summaryrefslogtreecommitdiff
path: root/src/ide/complete.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-01-23 15:03:10 +0100
committerLaurenz <laurmaedje@gmail.com>2023-01-23 15:23:52 +0100
commit4653ffebb43d733a3cff873d0903c7d00aaeb499 (patch)
tree6a97b2e6a6903b3198547d6f3d0a7e3d2eb023cd /src/ide/complete.rs
parent84c6c8b0e6b17996a603ec88b7490107154f38f3 (diff)
Math module
Diffstat (limited to 'src/ide/complete.rs')
-rw-r--r--src/ide/complete.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ide/complete.rs b/src/ide/complete.rs
index f0808b21..5b044746 100644
--- a/src/ide/complete.rs
+++ b/src/ide/complete.rs
@@ -4,7 +4,6 @@ use if_chain::if_chain;
use super::{plain_docs_sentence, summarize_font_family};
use crate::model::{CastInfo, Scope, Value};
-use crate::syntax::ast::AstNode;
use crate::syntax::{ast, LinkedNode, Source, SyntaxKind};
use crate::util::{format_eco, EcoString};
use crate::World;
@@ -118,8 +117,8 @@ fn complete_params(ctx: &mut CompletionContext) -> bool {
if let Some(grand) = parent.parent();
if let Some(expr) = grand.cast::<ast::Expr>();
let set = matches!(expr, ast::Expr::Set(_));
- if let Some(callee) = match expr {
- ast::Expr::FuncCall(call) => call.callee().as_untyped().cast(),
+ if let Some(ast::Expr::Ident(callee)) = match expr {
+ ast::Expr::FuncCall(call) => Some(call.callee()),
ast::Expr::Set(set) => Some(set.target()),
_ => None,
};
@@ -377,7 +376,7 @@ impl<'a> CompletionContext<'a> {
let leaf = LinkedNode::new(source.root()).leaf_at(cursor)?;
Some(Self {
world,
- scope: &world.library().scope,
+ scope: &world.library().global.scope(),
before: &text[..cursor],
after: &text[cursor..],
leaf,