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
Please sign in to leave a comment.
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.
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
Looks like it was called MethodDeclarationsFixer back then. https://github.com/JetBrains/MPS/blob/MPS3.3/plugins/mpsjava/platform/source_gen/jetbrains/mps/ide/java/platform/highlighters/MethodDeclarationsFixer.java