Fix code generation for suggestion preview (#6054)

Fix a stupid typo introduced in #5770. It affected the code generated by CB while previewing suggestions.
This commit is contained in:
Ilya Bogdanov 2023-03-23 10:34:21 +04:00 committed by GitHub
parent ca0779c46b
commit de008eb2c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -652,7 +652,7 @@ impl Searcher {
debug!("Previewing suggestion: \"{picked_suggestion:?}\".");
self.clear_temporary_imports();
let has_this = self.this_var().is_none();
let has_this = self.this_var().is_some();
let preview_change =
self.data.borrow().input.after_inserting_suggestion(&picked_suggestion, has_this)?;
let preview_ast = self.ide.parser().parse_line_ast(preview_change.new_input).ok();