adding action to action list - Introduce Variable when function name is highlighted

Hi, I started using rider, and i noticed that I don't get "Introduce variable" action in the action list when the cursor is on a function name, but the option is available if the cursor is on the parentheses of the function.

I want to have the action "Introduce variable" when on the function name in the function call, can this be done in the settings? pretty confident that intellij idea and pycharm and visual studio all have the option to introduce local variable that way.

 

5 comments
Comment actions Permalink

Hello, could you please provide a project sample that we could test it on our side? You can share it here or directly on our tracker. Thank you in advance!

0
Comment actions Permalink

Sure, I don't see file upload option, but can easily share sample code.

I created a quick console application as a sample,

project properties image attached.

 

Program.cs

using System;
using ConsoleApp1;


Test.getFunc();

Console.WriteLine("Hello, World!");

 

Test.cs

using System;
using System.Collections.Generic;

namespace ConsoleApp1
{
public class Test
{
public static List<String> getFunc()
{
List<String> list = new List<string>();
return list;

}
}
}

 

0
Comment actions Permalink

Could you please clarify what Rider version are you using? I can't seem to face the same issue as you.

0
Comment actions Permalink

  2021.2.2

you are getting what i am getting, the option to 'iterate via foreach' which is fine, but you are not getting the option of 'introduce variable' which i am used to getting in both intellij idea and visual studio.

for example,

to go from

Test.getFunc();

to 

List<String> list = Test.getFunc();

 

0
Comment actions Permalink

Looks like the following ticket describes exactly what you are facing: RSRP-287509. Feel free to upvote it in order to bring increased awareness to the issue. 

0

Please sign in to leave a comment.