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

Implements js2r-kill #25

Merged
merged 8 commits into from
Sep 3, 2014
Merged

Conversation

NicolasPetton
Copy link
Collaborator

Probably not ready to be merged. Expect rough edge-cases :)

When the buffer has parse errors, fallback to `kill-line`
@NicolasPetton
Copy link
Collaborator Author

There are still some rough edge cases like the following:

function foo(bar|, baz) {...

If I kill, I would expect to have:

function foo(bar) {...

The question is if it's worth the effort (we have the same issue with if statements, for statements, etc). My guess is yes :)

@NicolasPetton
Copy link
Collaborator Author

I think it's in a decent shape now.

At the end I went with the following strategies:

  • if we are in a comment node, just kill the line
  • if we are in a "balanced" JS node (array, object, string), use the AST to kill
  • else fallback to list manipulation
  • on error, kill the line

@magnars
Copy link
Collaborator

magnars commented Sep 3, 2014

Excellent work! Thank you. This is something I've been wanting for a while. I can finally go back to coding javascript now. ;-)

magnars added a commit that referenced this pull request Sep 3, 2014
@magnars magnars merged commit 9c74dd2 into js-emacs:master Sep 3, 2014
@NicolasPetton
Copy link
Collaborator Author

thanks! I want raise-expression now. It's the other killer feature of paredit that I also want everywhere else :)

@NicolasPetton NicolasPetton deleted the js2r-paredit-kill branch September 3, 2014 09:20
@magnars
Copy link
Collaborator

magnars commented Sep 3, 2014

Sounds great. :) I think your work on this feature was excellent, and I'm really appreciating the thorough tests you've added. So, I've added you as a collaborator to the project. Welcome to the team!

@NicolasPetton
Copy link
Collaborator Author

Thanks!

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.

None yet

2 participants