summaryrefslogtreecommitdiff
path: root/crates/typst-ide
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-10-09 16:04:10 +0200
committerLaurenz <laurmaedje@gmail.com>2023-10-09 16:04:10 +0200
commitf474639ebe6f1bc7d5ab398ae1df16af48c77708 (patch)
treead16b345498bfe75cef96af4fa38efc058795a25 /crates/typst-ide
parent7b61d722ddcd609e7bb51a454b27dd883f620357 (diff)
Hashtag -> Hash
Diffstat (limited to 'crates/typst-ide')
-rw-r--r--crates/typst-ide/src/complete.rs12
-rw-r--r--crates/typst-ide/src/tooltip.rs2
2 files changed, 7 insertions, 7 deletions
diff --git a/crates/typst-ide/src/complete.rs b/crates/typst-ide/src/complete.rs
index bb17dd37..5da22f45 100644
--- a/crates/typst-ide/src/complete.rs
+++ b/crates/typst-ide/src/complete.rs
@@ -97,7 +97,7 @@ fn complete_markup(ctx: &mut CompletionContext) -> bool {
}
// Start of an interpolated identifier: "#|".
- if ctx.leaf.kind() == SyntaxKind::Hashtag {
+ if ctx.leaf.kind() == SyntaxKind::Hash {
ctx.from = ctx.cursor;
code_completions(ctx, true);
return true;
@@ -268,7 +268,7 @@ fn complete_math(ctx: &mut CompletionContext) -> bool {
}
// Start of an interpolated identifier: "#|".
- if ctx.leaf.kind() == SyntaxKind::Hashtag {
+ if ctx.leaf.kind() == SyntaxKind::Hash {
ctx.from = ctx.cursor;
code_completions(ctx, true);
return true;
@@ -326,7 +326,7 @@ fn complete_field_accesses(ctx: &mut CompletionContext) -> bool {
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);
+ prev.prev_sibling_kind() == Some(SyntaxKind::Hash);
if let Some(value) = analyze_expr(ctx.world, &prev).into_iter().next();
then {
ctx.from = ctx.cursor;
@@ -796,8 +796,8 @@ fn complete_code(ctx: &mut CompletionContext) -> bool {
/// Add completions for expression snippets.
#[rustfmt::skip]
-fn code_completions(ctx: &mut CompletionContext, hashtag: bool) {
- ctx.scope_completions(true, |value| !hashtag || {
+fn code_completions(ctx: &mut CompletionContext, hash: bool) {
+ ctx.scope_completions(true, |value| !hash || {
matches!(value, Value::Symbol(_) | Value::Func(_) | Value::Type(_) | Value::Module(_))
});
@@ -933,7 +933,7 @@ fn code_completions(ctx: &mut CompletionContext, hashtag: bool) {
"Creates a mapping from names to value.",
);
- if !hashtag {
+ if !hash {
ctx.snippet_completion(
"function",
"(${params}) => ${output}",
diff --git a/crates/typst-ide/src/tooltip.rs b/crates/typst-ide/src/tooltip.rs
index 37f32e22..9629462b 100644
--- a/crates/typst-ide/src/tooltip.rs
+++ b/crates/typst-ide/src/tooltip.rs
@@ -49,7 +49,7 @@ fn expr_tooltip(world: &dyn World, leaf: &LinkedNode) -> Option<Tooltip> {
}
let expr = ancestor.cast::<ast::Expr>()?;
- if !expr.hashtag() && !matches!(expr, ast::Expr::MathIdent(_)) {
+ if !expr.hash() && !matches!(expr, ast::Expr::MathIdent(_)) {
return None;
}