Question

Is there a way to make the intellisense show the parameter names of the target's parameters while typing?
if I just get some popup explaing/showing what name and type of the parameters, that would be easier to write, instead of typing "SomeClass.SomeMethod(" or write the parameters on the SomeMethod and then replace the "(" with a "," and erasing the other one to get the intellisense to show what parameters are required.

Is this possible to do, redirect the intellisense summary to that of the target parameter?

class SomeTest
{
    public void Update()
    {
        // get intellisense to show a popup explaining what the parameters of the SomeMethod are
        Create(SomeClass.SomeMethod, 2, 0);
    }

    /// <summary>
    /// Make this show the summary of the "target" parameter
    /// </summary>
    /// <typeparam name="T1">Show first parameter type & name of target</typeparam>
    /// <typeparam name="T2">Show second parameter type & name of target</typeparam>
    /// <param name="target"></param>
    /// <param name="param1">parameter comments here</param>
    /// <param name="param2">and here</param>
    public static void Create<T1, T2>(Action<T1, T2> target, T1 param1, T2 param2)
    {

    }
}

class SomeClass
{
    /// <summary>
    /// This is text, that the intellisense shows in a popup while you write the parameters.
    /// </summary>
    /// <param name="ThisName">Also this when writing this specific parameter</param>
    /// <param name="OtherName">And this</param>
    public static void SomeMethod(int ThisName, int OtherName)
    {

    }
}
Was it helpful?

Solution

Unfortunately this is not really possible. Intellisense is a tool to help you write correct code given the current position of the cursor and surrounding text (in particular text before the cursor). It has no understanding that the parameters of SomeMethod are related to parameters of the Create method. It is instead going to show you information for Create because that is the method you are calling.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top