There are a couple of issues with the New Method command.
Doesn't work for class methods. Typing self.foo and invoke the command results in:
self.def foo (args)
The command behaves strangely when removing (args) and then starts typing. Steps to reproduce:
The result is this:
def foo ((ar))r))
And there are now three cursors.
The command doesn't work if a method ends with ? or !. Typing foo! and invoking the command results in this:
All of these problems where present in TM1 as well, except for the second one.
The second issue is unfortunate but just a symptom of how the snippet is formed and not easily fixable. Since you can type the whole method name before invoking the command it shouldn't happen too often.
One and three I've got a fix worked up for, going to test it a bit more to make sure there aren't any issues. Should have it committed tomorrow.
It happens to me all the time because of the third issue. But if that's being fixed it will be less of an issue.
Allow all forms of method names in New Method (⇧↩)
Before we just used the current word which doesn't match all possible method names (self.foo or foo! for instance). Now uses the current_word library to allow any possible method name with the expression taken from the grammar. Fixes #59.
Just deployed this change, your bundle should update in a few hours.
Please test out this change with any issues that you had as I totally rewrote the logic in the command, thanks!
It works, thanks. Although, I forgot about one case, when a method ends with =.
Can you provide an example of this usage? I used the match from the grammar so it should have caught everything the grammar does.
Type foo= then invoke the action. This is the result:
I don't know if this helps but. When I type foo= the equal sign is highlighted, but the neither the question mark or the exclamation mark gets highlighted. Perhaps the grammar is treating them differently.
Allow for method names that end in =
Further fixes #59.
@jacob-carlborg The fix I just made should fix the lingering issue.
Great, thanks .