Fix autocompletion after non-hashtag expression

This commit is contained in:
Laurenz 2023-04-04 18:18:10 +02:00
parent 4b0db52920
commit 8284db9000
2 changed files with 3 additions and 0 deletions

View File

@ -42,6 +42,7 @@ description: |
- Fixed crash when [`symbol`]($func/symbol) function is called without arguments
- Fixed access to label of certain content elements
- Fixed line number in error message for CSV parsing
- Fixed invalid autocompletion after certain markup elements
## March 28, 2023
- **Breaking:** Enumerations now require a space after their marker, that is,

View File

@ -317,6 +317,8 @@ fn complete_field_accesses(ctx: &mut CompletionContext) -> bool {
if ctx.leaf.range().end == ctx.cursor;
if let Some(prev) = ctx.leaf.prev_sibling();
if prev.is::<ast::Expr>();
if prev.parent_kind() != Some(SyntaxKind::Markup) ||
prev.prev_sibling_kind() == Some(SyntaxKind::Hashtag);
if let Some(value) = analyze_expr(ctx.world, &prev).into_iter().next();
then {
ctx.from = ctx.cursor;