IDE Hint for reflection method parameters

Answered

I have a function that might be called like this

this.InvokeFn("MyFunction", param1, param2);

Internally, this function is finding a function named "MyFunction" on "this" that takes two parameters. I can define this "MyFunction" but the IDE says it isn't used. I don't suppose there is a way to tell the IDE what this function is doing to provide better hints? I note that the Unity plugin does this for the Invoke calls that are part of the Unity API

1 comment
Comment actions Permalink

Hello, currently there's no way to specify that an argument of an arbitrary method is actually a reference to some symbol in your code.

Is there any particular reason not to use `InvokeFn(nameof(MyFunction), param1, param2);`?

0

Please sign in to leave a comment.