Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Introduceclojure-ts-add-arity refactoring command#93

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
bbatsov merged 1 commit intoclojure-emacs:mainfromrrudakov:feature/add-arity
May 11, 2025

Conversation

@rrudakov
Copy link
Contributor

Before submitting a PR mark the checkboxes for the items you've done (if you
think a checkbox does not apply, then leave it unchecked):

  • The commits are consistent with ourcontribution guidelines.
  • You've added tests (if possible) to cover your change(s). Bugfix, indentation, and font-lock tests are extremely important!
  • You've runM-x checkdoc and fixed any warnings in the code you've written.
  • You've updated the changelog (if adding/changing user-visible functionality).
  • You've updated the readme (if adding/changing user-visible functionality).

Thanks!

(defunclojure-ts-add-arity ()
"Add an arity to a function."
(interactive)
(if-let* ((sym-regex (rx bol
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm guessing you can extract some private function checking whether the form at point is function-like. I assume that would be useful for other things down the road.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I've done a small refactoring in this PR and extracted some helper functions, such asclojure-ts--search-list-form-at-point orclojure-ts--list-node-sym-text orclojure-ts--parent-until (which I wish was part oftreesit.el). This particular regexp and the following query is very unlikely going to be used anywhere else, it's too specific. If I extracted it to a function I would have to give it a name that indicates that it returns a node that represents a construct to which an arity could be added. We can always extract it if we need it in other place.

bbatsov reacted with thumbs up emoji
@rrudakovrrudakov requested a review frombbatsovMay 11, 2025 06:29
@bbatsovbbatsov merged commita1fdc69 intoclojure-emacs:mainMay 11, 2025
3 checks passed
@rrudakovrrudakov deleted the feature/add-arity branchMay 11, 2025 07:16
@rrudakov
Copy link
ContributorAuthor

Thanks for quick review!

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

Reviewers

@bbatsovbbatsovAwaiting requested review from bbatsov

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@rrudakov@bbatsov

[8]ページ先頭

©2009-2025 Movatter.jp