Rename some keyword locations for consistency#4060
Conversation
|
I'm generally okay with doing this, but I just want to check — can you enumerate our rules for naming? Maybe we should explicitly write them down? Is it |
|
Yeah, you got that right basically. Some like
I don't really know what where to put docs about general rules, is there a place that would fit? I can write something if you want (although I don't think it would be relevant very often, should just look at rdoc) |
|
I think it's probably fine to leave it out of the docs, I hope this won't change again. Can you actually get rid of the node_ext stuff? In theory the next release is 2.0.0, people will have to update stuff anyway. Let's just make this a breaking change. |
Prism is generally good about their naming but these had some inconsistencies compared to others: * `InNode` was missing the `keyword` in the name * `MatchPredicateNode` `in` was named `operator` instead * `UnlessNode`/`UntilNode`/`WhenNode`/`WhileNode` has more than one keyword, with one generic `keyword_loc` * `UntilNode`/`WhileNode` named their `end` keyword `closing_loc` Left the old names around for compatibility
Is that worth it? It seems like the compatibility cost of keeping the old A few cases I’m worried about:
I looked at #3990, but I don’t see a strong motivation there for intentionally breaking the Ruby API unless we need to. Is there enough value in removing these aliases now, rather than keeping them around for compatibility? |
d589d30 to
3f1c26f
Compare
|
(just rebased) Yes, I would prefer to keep the old ones around as well. irb for example would need to be updated immediatly because it uses one of the impacted locations (and also doesn't pin the major) |
|
Okay, that's convincing. Can we use |
|
Let me check, I think I didn't because typechecking doesn't like that at all |
|
Ah, yeah. So I think rbs has support for them but the rbi compiler currently has all the aliases explicitly listed out Line 141 in d290a34 and I don't really know what to do about that. Currently it just falls through to the else which just raises. |
Prism is generally good about their naming but these had some inconsistencies compared to others:
InNodewas missing thekeywordin the nameMatchPredicateNodeinwas namedoperatorinsteadUnlessNode/UntilNode/WhenNode/WhileNodehas more than one keyword, with one generickeyword_locUntilNode/WhileNodenamed theirendkeywordclosing_locLeft the old names around for compatibility