Case Sensitivity

I am working on a DSL for users that are used to case insensitive names. MPS is by default case sensitive. I have taken a look at the Scope classes, but as far as I can see there is no option in MPS to make names case insensitive.  

Is this correct,  or is there a way to make a language case insensitive ?
5 comments
Yes, that's correct. Completion in MPS is not Case-sensitive. Probably it make sense to add corresponding option.
0
Tnx, that is clear. The only solution that I see then is to create my own scope providers which will be case insensitive. Thus means copying the existing Scope classes and replace the all the "equals"  with  "equalsIgnoreCase" calls.
It is a pity that all fields in the existing Scope classes (like SimpleRoleScope) are private.  If they had been protected I could have subclassed them and only overwrite the methods that need changes.  As it is now I have to completely copy them. It might be good to make any fields of this kind of framework classes protected to open up the possibility of subclassing them.
0
Please file corresponding request so we will consider making them protected.
0

As far as I can understand, overriding "resolve" and "getAvailableElements" does nothing in terms of default substitute actions.

For instance, if I have a variable name in UPPER case, then default substitution won't happen if I type "upper" in lower case. resolve/getAvailableElements do not help there as substitute menu is built by mere call to `getAvailableElements(null)`.

I wonder if there is an option for "automatic substitution" to operate in case-insensitive mode. That is I want to type in whatever case (typically it is lower case), and I want it to substitute automatically in case there's just one option.

It looks like MPS does case-insensitive search in the autocomplete menu, however the default substitute action is case-sensitive. Am I missing something?

0

I've created https://youtrack.jetbrains.com/issue/MPS-25125 for "case insensitive mode" for "default substitution"

0

Please sign in to leave a comment.