mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
make it work from macro
This commit is contained in:
parent
fb47a65ab2
commit
8cca6242f8
1 changed files with 3 additions and 3 deletions
|
@ -30,7 +30,7 @@ use crate::{
|
||||||
// enum Action { Move { distance: u32 }, Stop }
|
// enum Action { Move { distance: u32 }, Stop }
|
||||||
//
|
//
|
||||||
// fn handle(action: Action) {
|
// fn handle(action: Action) {
|
||||||
// match action {
|
// match action {
|
||||||
// $0Action::Move { distance } => todo!(),
|
// $0Action::Move { distance } => todo!(),
|
||||||
// Action::Stop => todo!(),
|
// Action::Stop => todo!(),
|
||||||
// }
|
// }
|
||||||
|
@ -41,8 +41,8 @@ pub(crate) fn add_missing_match_arms(acc: &mut Assists, ctx: &AssistContext) ->
|
||||||
let match_arm_list = match_expr.match_arm_list()?;
|
let match_arm_list = match_expr.match_arm_list()?;
|
||||||
|
|
||||||
let available_range = TextRange::new(
|
let available_range = TextRange::new(
|
||||||
match_expr.syntax().text_range().start(),
|
ctx.sema.original_range(match_expr.syntax()).range.start(),
|
||||||
match_arm_list.syntax().text_range().start(),
|
ctx.sema.original_range(match_arm_list.syntax()).range.start(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let cursor_in_range = available_range.contains_range(ctx.frange.range);
|
let cursor_in_range = available_range.contains_range(ctx.frange.range);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue