File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
parser/src/grammar/expressions Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -6268,6 +6268,28 @@ fn main() {
62686268
62696269fn $0fun_name(s: &Foo) {
62706270 *print!("{}{}", s, s);
6271+ }"# ,
6272+ ) ;
6273+ }
6274+
6275+ #[ test]
6276+ fn parameter_is_added_used_in_eq_expression_in_macro ( ) {
6277+ check_assist (
6278+ extract_function,
6279+ r#"
6280+ //- minicore: fmt
6281+ fn foo() {
6282+ let v = 123;
6283+ $0print!("{v:?}{}", v == 123);$0
6284+ }"# ,
6285+ r#"
6286+ fn foo() {
6287+ let v = 123;
6288+ fun_name(v);
6289+ }
6290+
6291+ fn $0fun_name(v: i32) {
6292+ print!("{v:?}{}", v == 123);
62716293}"# ,
62726294 ) ;
62736295 }
Original file line number Diff line number Diff line change @@ -283,7 +283,7 @@ fn builtin_expr(p: &mut Parser<'_>) -> Option<CompletedMarker> {
283283 if p. eat ( T ! [ , ] ) {
284284 while !p. at ( EOF ) && !p. at ( T ! [ ')' ] ) {
285285 let m = p. start ( ) ;
286- if p. at ( IDENT ) && p. nth_at ( 1 , T ! [ =] ) {
286+ if p. at ( IDENT ) && p. nth_at ( 1 , T ! [ =] ) && !p . nth_at ( 2 , T ! [ = ] ) {
287287 name ( p) ;
288288 p. bump ( T ! [ =] ) ;
289289 }
You can’t perform that action at this time.
0 commit comments