Supporting rebinding by name (F5 Key) with own concepts

Hi folks,

 

I just made a concept MethodCall which references a Java InstanceMethod. My MethodCall concept also contains argument expressions. 

Now: When using F5, of course, not the correct Reference (according to arg types) to InstanceMethod is taken, in case multiple methods exist. 

How can I resolve that issue? Is there a way to make my MethodCall concept aware of "num/type of arguments" when rebinding a InstanceMethod via name (F5 Key)? 

Any hint appreciated,

Daniel

 

1
3 comments

Take a look at MethodCallsFixer class in MPS, that's how it's implemented for Base Language.

As an alternative you could try creating a checking rule to detect wrong methods with a quick fix to point the reference to the proper method that is set to apply automatically.

0

Hi Sergej,

 

just using CRTL-N did not lead me to MethodCallsFixer. I m using MPS 3.3.5 .. 

 

Did this identifier change over the versions? 

 

Thanks for your hint,

Daniel

0

Please sign in to leave a comment.