Skip to content

Introduce commands to convert collection type #92

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

Merged
merged 1 commit into from
May 10, 2025

Conversation

rrudakov
Copy link
Contributor

@rrudakov rrudakov commented May 9, 2025

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 our contribution guidelines.
  • You've added tests (if possible) to cover your change(s). Bugfix, indentation, and font-lock tests are extremely important!
  • You've run M-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!

@rrudakov rrudakov force-pushed the feature/convert-collection branch from 1bba6ea to abfda1f Compare May 9, 2025 18:51
@bbatsov
Copy link
Member

bbatsov commented May 10, 2025

Overall the PR looks good. Might also be useful to add some cycle collection command that's a bit smarter and handles the most common cases:

  • list to quoted list
  • vector to map

@rrudakov
Copy link
Contributor Author

Overall the PR looks good. Might also be useful to add some cycle collection command that's a bit smarter and handles the most common cases:

  • list to quoted list
  • vector to map

Good idea. Maybe you could also suggest default keybinding for those commands?

@rrudakov
Copy link
Contributor Author

Overall the PR looks good. Might also be useful to add some cycle collection command that's a bit smarter and handles the most common cases:

  • list to quoted list
  • vector to map

On a second thought, I'm not sure about that :) You can convert list to quoted list by using clojure-ts-convert-collection-to-quoted-list and you can convert vector to map using clojure-ts-convert-collection-to-map, so the proposed functions will just duplicate the existing ones.

@rrudakov rrudakov force-pushed the feature/convert-collection branch from abfda1f to 155cb18 Compare May 10, 2025 06:16
@bbatsov
Copy link
Member

bbatsov commented May 10, 2025

Yeah, I get this, but in my experience it’s quite uncommon to convert between most literal types. I meant this more in the sense of making it easier for the end users - by remembering less commands. Anyways, not very important right now.

@bbatsov bbatsov merged commit edf0d32 into clojure-emacs:main May 10, 2025
3 checks passed
@rrudakov rrudakov deleted the feature/convert-collection branch May 10, 2025 11:57
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