aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/completion
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/completion')
-rw-r--r--crates/ra_ide/src/completion/completion_context.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs
index deaacda6c..5a0407fd7 100644
--- a/crates/ra_ide/src/completion/completion_context.rs
+++ b/crates/ra_ide/src/completion/completion_context.rs
@@ -1,5 +1,6 @@
1//! FIXME: write short doc here 1//! FIXME: write short doc here
2 2
3use ra_ide_db::RootDatabase;
3use ra_syntax::{ 4use ra_syntax::{
4 algo::{find_covering_element, find_node_at_offset}, 5 algo::{find_covering_element, find_node_at_offset},
5 ast, AstNode, Parse, SourceFile, 6 ast, AstNode, Parse, SourceFile,
@@ -8,13 +9,13 @@ use ra_syntax::{
8}; 9};
9use ra_text_edit::AtomTextEdit; 10use ra_text_edit::AtomTextEdit;
10 11
11use crate::{db, FilePosition}; 12use crate::FilePosition;
12 13
13/// `CompletionContext` is created early during completion to figure out, where 14/// `CompletionContext` is created early during completion to figure out, where
14/// exactly is the cursor, syntax-wise. 15/// exactly is the cursor, syntax-wise.
15#[derive(Debug)] 16#[derive(Debug)]
16pub(crate) struct CompletionContext<'a> { 17pub(crate) struct CompletionContext<'a> {
17 pub(super) db: &'a db::RootDatabase, 18 pub(super) db: &'a RootDatabase,
18 pub(super) analyzer: hir::SourceAnalyzer, 19 pub(super) analyzer: hir::SourceAnalyzer,
19 pub(super) offset: TextUnit, 20 pub(super) offset: TextUnit,
20 pub(super) token: SyntaxToken, 21 pub(super) token: SyntaxToken,
@@ -48,7 +49,7 @@ pub(crate) struct CompletionContext<'a> {
48 49
49impl<'a> CompletionContext<'a> { 50impl<'a> CompletionContext<'a> {
50 pub(super) fn new( 51 pub(super) fn new(
51 db: &'a db::RootDatabase, 52 db: &'a RootDatabase,
52 original_parse: &'a Parse<ast::SourceFile>, 53 original_parse: &'a Parse<ast::SourceFile>,
53 position: FilePosition, 54 position: FilePosition,
54 ) -> Option<CompletionContext<'a>> { 55 ) -> Option<CompletionContext<'a>> {