Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-assists/src/lib.rs')
-rw-r--r--crates/ide-assists/src/lib.rs17
1 files changed, 12 insertions, 5 deletions
diff --git a/crates/ide-assists/src/lib.rs b/crates/ide-assists/src/lib.rs
index 4682c04732..0b5dae6bc4 100644
--- a/crates/ide-assists/src/lib.rs
+++ b/crates/ide-assists/src/lib.rs
@@ -67,8 +67,8 @@ mod tests;
pub mod utils;
use hir::Semantics;
-use ide_db::{EditionedFileId, RootDatabase};
-use syntax::{Edition, TextRange};
+use ide_db::RootDatabase;
+use syntax::TextRange;
pub(crate) use crate::assist_context::{AssistContext, Assists};
@@ -88,9 +88,7 @@ pub fn assists(
range: ide_db::FileRange,
) -> Vec<Assist> {
let sema = Semantics::new(db);
- let file_id = sema
- .attach_first_edition(range.file_id)
- .unwrap_or_else(|| EditionedFileId::new(db, range.file_id, Edition::CURRENT));
+ let file_id = sema.attach_first_edition(range.file_id);
let ctx = AssistContext::new(sema, config, hir::FileRange { file_id, range: range.range });
let mut acc = Assists::new(&ctx, resolve);
handlers::all().iter().for_each(|handler| {
@@ -119,6 +117,7 @@ mod handlers {
mod change_visibility;
mod convert_bool_then;
mod convert_bool_to_enum;
+ mod convert_char_literal;
mod convert_closure_to_fn;
mod convert_comment_block;
mod convert_comment_from_or_to_doc;
@@ -131,6 +130,7 @@ mod handlers {
mod convert_match_to_let_else;
mod convert_named_struct_to_tuple_struct;
mod convert_nested_function_to_closure;
+ mod convert_range_for_to_while;
mod convert_to_guarded_return;
mod convert_tuple_return_type_to_struct;
mod convert_tuple_struct_to_named_struct;
@@ -153,6 +153,7 @@ mod handlers {
mod flip_comma;
mod flip_or_pattern;
mod flip_trait_bound;
+ mod generate_blanket_trait_impl;
mod generate_constant;
mod generate_default_from_enum_variant;
mod generate_default_from_new;
@@ -200,6 +201,7 @@ mod handlers {
mod qualify_path;
mod raw_string;
mod remove_dbg;
+ mod remove_else_branches;
mod remove_mut;
mod remove_parentheses;
mod remove_underscore;
@@ -253,6 +255,7 @@ mod handlers {
convert_bool_then::convert_bool_then_to_if,
convert_bool_then::convert_if_to_bool_then,
convert_bool_to_enum::convert_bool_to_enum,
+ convert_char_literal::convert_char_literal,
convert_closure_to_fn::convert_closure_to_fn,
convert_comment_block::convert_comment_block,
convert_comment_from_or_to_doc::convert_comment_from_or_to_doc,
@@ -266,6 +269,7 @@ mod handlers {
convert_match_to_let_else::convert_match_to_let_else,
convert_named_struct_to_tuple_struct::convert_named_struct_to_tuple_struct,
convert_nested_function_to_closure::convert_nested_function_to_closure,
+ convert_range_for_to_while::convert_range_for_to_while,
convert_to_guarded_return::convert_to_guarded_return,
convert_tuple_return_type_to_struct::convert_tuple_return_type_to_struct,
convert_tuple_struct_to_named_struct::convert_tuple_struct_to_named_struct,
@@ -283,6 +287,7 @@ mod handlers {
extract_type_alias::extract_type_alias,
fix_visibility::fix_visibility,
flip_binexpr::flip_binexpr,
+ flip_binexpr::flip_range_expr,
flip_comma::flip_comma,
flip_or_pattern::flip_or_pattern,
flip_trait_bound::flip_trait_bound,
@@ -308,6 +313,7 @@ mod handlers {
generate_new::generate_new,
generate_trait_from_impl::generate_trait_from_impl,
generate_single_field_struct_from::generate_single_field_struct_from,
+ generate_blanket_trait_impl::generate_blanket_trait_impl,
inline_call::inline_call,
inline_call::inline_into_callers,
inline_const_as_literal::inline_const_as_literal,
@@ -340,6 +346,7 @@ mod handlers {
raw_string::remove_hash,
remove_dbg::remove_dbg,
remove_mut::remove_mut,
+ remove_else_branches::remove_else_branches,
remove_parentheses::remove_parentheses,
remove_underscore::remove_underscore,
remove_unused_imports::remove_unused_imports,