@@ -67,14 +67,13 @@ pub(crate) struct CompletionContext<'a> {
67
67
pub ( super ) krate : Option < hir:: Crate > ,
68
68
pub ( super ) expected_name : Option < NameOrNameRef > ,
69
69
pub ( super ) expected_type : Option < Type > ,
70
- pub ( super ) name_ref_syntax : Option < ast:: NameRef > ,
71
-
72
- pub ( super ) use_item_syntax : Option < ast:: Use > ,
73
70
74
71
/// The parent function of the cursor position if it exists.
75
72
pub ( super ) function_def : Option < ast:: Fn > ,
76
73
/// The parent impl of the cursor position if it exists.
77
74
pub ( super ) impl_def : Option < ast:: Impl > ,
75
+ pub ( super ) name_ref_syntax : Option < ast:: NameRef > ,
76
+ pub ( super ) use_item_syntax : Option < ast:: Use > ,
78
77
79
78
// potentially set if we are completing a lifetime
80
79
pub ( super ) lifetime_syntax : Option < ast:: Lifetime > ,
@@ -89,13 +88,12 @@ pub(crate) struct CompletionContext<'a> {
89
88
pub ( super ) completion_location : Option < ImmediateLocation > ,
90
89
pub ( super ) prev_sibling : Option < ImmediatePrevSibling > ,
91
90
pub ( super ) attribute_under_caret : Option < ast:: Attr > ,
91
+ pub ( super ) previous_token : Option < SyntaxToken > ,
92
92
93
93
pub ( super ) path_context : Option < PathCompletionContext > ,
94
- /// FIXME: `ActiveParameter` is string-based, which is very very wrong
95
94
pub ( super ) active_parameter : Option < ActiveParameter > ,
96
95
pub ( super ) locals : Vec < ( String , Local ) > ,
97
96
98
- pub ( super ) previous_token : Option < SyntaxToken > ,
99
97
pub ( super ) in_loop_body : bool ,
100
98
pub ( super ) incomplete_let : bool ,
101
99
@@ -143,28 +141,28 @@ impl<'a> CompletionContext<'a> {
143
141
original_token,
144
142
token,
145
143
krate,
146
- lifetime_allowed : false ,
147
144
expected_name : None ,
148
145
expected_type : None ,
146
+ function_def : None ,
147
+ impl_def : None ,
149
148
name_ref_syntax : None ,
149
+ use_item_syntax : None ,
150
150
lifetime_syntax : None ,
151
151
lifetime_param_syntax : None ,
152
- function_def : None ,
153
- use_item_syntax : None ,
154
- impl_def : None ,
155
- active_parameter : ActiveParameter :: at ( db, position) ,
152
+ lifetime_allowed : false ,
156
153
is_label_ref : false ,
157
- is_param : false ,
158
154
is_pat_or_const : None ,
159
- path_context : None ,
160
- previous_token : None ,
161
- in_loop_body : false ,
155
+ is_param : false ,
162
156
completion_location : None ,
163
157
prev_sibling : None ,
164
- no_completion_required : false ,
165
- incomplete_let : false ,
166
158
attribute_under_caret : None ,
159
+ previous_token : None ,
160
+ path_context : None ,
161
+ active_parameter : ActiveParameter :: at ( db, position) ,
167
162
locals,
163
+ in_loop_body : false ,
164
+ incomplete_let : false ,
165
+ no_completion_required : false ,
168
166
} ;
169
167
170
168
let mut original_file = original_file. syntax ( ) . clone ( ) ;
0 commit comments