mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-03 17:58:17 +00:00
feat: identify identifier-like text as ident in math mode (#1138)
This commit is contained in:
parent
34fe823ab7
commit
fcb9fec712
1 changed files with 7 additions and 0 deletions
|
@ -676,6 +676,13 @@ pub fn classify_syntax(node: LinkedNode, cursor: usize) -> Option<SyntaxClass<'_
|
|||
}
|
||||
}
|
||||
|
||||
if matches!(node.kind(), SyntaxKind::Text) {
|
||||
let mode = interpret_mode_at(Some(&node));
|
||||
if matches!(mode, InterpretMode::Math) && is_ident_like(&node) {
|
||||
return Some(SyntaxClass::VarAccess(VarClass::Ident(node)));
|
||||
}
|
||||
}
|
||||
|
||||
// Move to the first ancestor that is an expression.
|
||||
let ancestor = first_ancestor_expr(node)?;
|
||||
crate::log_debug_ct!("first_ancestor_expr: {ancestor:?}");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue