Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix endless methods #2

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

qaisjp
Copy link
Collaborator

@qaisjp qaisjp commented Aug 15, 2024

One of the tests are currently failing:

  formatter tests
    ✔ adds "end" to an if block
    ✔ adds an "end" to an assignment method
    ✔ doesn't add end if it exists already
    ✔ doesn't add end when there's already one on the same line - if foo; end$
    ✔ doesn't add end when there's already one on the same line - if foo; end;$
    ✔ doesn't add end when there's already one on the same line - if foo; end ; foo()$
    1) doesn't add end for endless methods — def foo =$
    ✔ doesn't add end for endless methods — def foo = $
    ✔ doesn't add end for endless methods — def foo = bar$
    ✔ support nested blocks, add end
    ✔ support nested blocks, does not add end
    ✔ does not add end with a return if statement
    ✔ does not add end to a random statement even a portion of a trigger keyword is in it
  12 passing (68ms)
  1 failing
  1) formatter tests
       doesn't add end for endless methods — def foo =$:

  AssertionError [ERR_ASSERTION]:
  	at Context.<anonymous> (out/test/extension.test.js:81:20)

1 test failed.

I also think the regex doesn’t work well when the cursor is in the middle of the line, and not at EOL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants