summaryrefslogtreecommitdiff
path: root/src/ide/complete.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ide/complete.rs')
-rw-r--r--src/ide/complete.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ide/complete.rs b/src/ide/complete.rs
index 30b98fc8..a24eb7e2 100644
--- a/src/ide/complete.rs
+++ b/src/ide/complete.rs
@@ -23,7 +23,8 @@ pub fn autocomplete(
) -> Option<(usize, Vec<Completion>)> {
let mut ctx = CompletionContext::new(world, source, cursor, explicit)?;
- let _ = complete_field_accesses(&mut ctx)
+ let _ = complete_comments(&mut ctx)
+ || complete_field_accesses(&mut ctx)
|| complete_imports(&mut ctx)
|| complete_rules(&mut ctx)
|| complete_params(&mut ctx)
@@ -67,6 +68,11 @@ pub enum CompletionKind {
Symbol(char),
}
+/// Complete in comments. Or rather, don't!
+fn complete_comments(ctx: &mut CompletionContext) -> bool {
+ matches!(ctx.leaf.kind(), SyntaxKind::LineComment | SyntaxKind::BlockComment)
+}
+
/// Complete in markup mode.
fn complete_markup(ctx: &mut CompletionContext) -> bool {
// Bail if we aren't even in markup.