New Method command doens't work properly #59

Closed
jacob-carlborg opened this Issue Nov 21, 2013 · 10 comments

Comments

Projects
None yet
2 participants
@jacob-carlborg

There are a couple of issues with the New Method command.

  1. Doesn't work for class methods. Typing self.foo and invoke the command results in:

    self.def foo (args)
    
    end
  2. The command behaves strangely when removing (args) and then starts typing. Steps to reproduce:

    1. Type "foo"
    2. Invoke the command
    3. Press backspace to remove (args)
    4. Type "bar"

    The result is this:

    def foo   ((ar))r)) 
    end

    And there are now three cursors.

  3. The command doesn't work if a method ends with ? or !. Typing foo! and invoking the command results in this:

    foodef !(args)
    
    end
@jacob-carlborg

This comment has been minimized.

Show comment
Hide comment
@jacob-carlborg

jacob-carlborg Nov 21, 2013

All of these problems where present in TM1 as well, except for the second one.

All of these problems where present in TM1 as well, except for the second one.

@infininight

This comment has been minimized.

Show comment
Hide comment
@infininight

infininight Nov 21, 2013

Member

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.

Member

infininight commented Nov 21, 2013

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.

@jacob-carlborg

This comment has been minimized.

Show comment
Hide comment
@jacob-carlborg

jacob-carlborg Nov 21, 2013

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.

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.

@infininight

This comment has been minimized.

Show comment
Hide comment
@infininight

infininight Nov 25, 2013

Member

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!

Member

infininight commented Nov 25, 2013

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!

@jacob-carlborg

This comment has been minimized.

Show comment
Hide comment
@jacob-carlborg

jacob-carlborg Nov 26, 2013

It works, thanks. Although, I forgot about one case, when a method ends with =.

It works, thanks. Although, I forgot about one case, when a method ends with =.

@infininight

This comment has been minimized.

Show comment
Hide comment
@infininight

infininight Nov 28, 2013

Member

Can you provide an example of this usage? I used the match from the grammar so it should have caught everything the grammar does.

Member

infininight commented Nov 28, 2013

Can you provide an example of this usage? I used the match from the grammar so it should have caught everything the grammar does.

@jacob-carlborg

This comment has been minimized.

Show comment
Hide comment
@jacob-carlborg

jacob-carlborg Nov 28, 2013

Type foo= then invoke the action. This is the result:

def foo(args)

end

Type foo= then invoke the action. This is the result:

def foo(args)

end
@jacob-carlborg

This comment has been minimized.

Show comment
Hide comment
@jacob-carlborg

jacob-carlborg Nov 28, 2013

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.

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.

infininight added a commit that referenced this issue Feb 25, 2014

@infininight

This comment has been minimized.

Show comment
Hide comment
@infininight

infininight Feb 25, 2014

Member

@jacob-carlborg The fix I just made should fix the lingering issue.

Member

infininight commented Feb 25, 2014

@jacob-carlborg The fix I just made should fix the lingering issue.

@jacob-carlborg

This comment has been minimized.

Show comment
Hide comment
@jacob-carlborg

jacob-carlborg Feb 25, 2014

Great, thanks 😃.

Great, thanks 😃.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment