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

Add clojure-ts-mode support #215

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Andre0991
Copy link

@Andre0991 Andre0991 commented Nov 20, 2023

Add support to clojure-ts-mode 0.

  • Whenever the code used to reference clojure-mode, I changed it to be aware of clojure-ts-mode as well.
  • I've tested this branch for a few hours and everything seems working fine. However, I can keep testing it for more time, no rush to merge this. Also, note that I don't use the completions features.
  • checkdoc has a few warnings that already existed before this PR.
  • I used byte-compile-file and got no errors or warnings.

Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):

  • The commits are consistent with our contribution guidelines
  • The new code is not generating bytecode or M-x checkdoc warnings
  • You've updated the changelog (if adding/changing user-visible functionality)
  • You've updated the readme (if adding/changing user-visible functionality)

Thanks!

@Andre0991 Andre0991 force-pushed the support-clojure-ts-mode branch 3 times, most recently from 0463f1f to 12e9c9d Compare November 20, 2023 19:03
Add support to `clojure-ts-mode`, a Clojure major mode that uses
tree-sitter. For more details on `clojure-ts-mode`, consult its
repository [0].

[0]: https://github.com/clojure-emacs/clojure-ts-mode.
@Andre0991 Andre0991 marked this pull request as ready for review November 20, 2023 19:14
inf-clojure.el Outdated Show resolved Hide resolved
@bbatsov
Copy link
Member

bbatsov commented Nov 28, 2023

I think it may be prudent to allow the user to specify which mode they prefer if both are present, as the REPL font-locking is also hardcoded to clojure-mode right now.

@bbatsov
Copy link
Member

bbatsov commented Nov 28, 2023

You might also want to check for inspiration a similar PR for CIDER clojure-emacs/cider#3461

@Andre0991
Copy link
Author

 > I think it may be prudent to allow the user to specify which mode they prefer if both are present, as the REPL font-locking is also hardcoded to clojure-mode right now.

Hi Batsov.
Just to make sure I understand your suggestion, it is about choosing which functions to depending on whether the buffer uses clojure-mode or clojure-ts-mode, right?

For example, if the buffer uses clojure-ts-mode, then inf-clojure should use clojure-ts-find-ns rather than clojure-find-ns. This holds for all clojure-mode functions used by inf-clojure.

Makes sense?

@bbatsov
Copy link
Member

bbatsov commented Dec 14, 2023

If all of the functions exist in clojure-ts-mode - sure. I'm guessing in some cases something might not exist in clojure-ts-mode yet, so you'll have to stick to the clojure-mode function in that case. I was thinking of some defcustom like inf-clojure-preferred-clojure-mode that controls which mode to use internally that can do so inference by default. (e.g. prefer clojure-ts-mode if present)

I hope this makes sense.

@Andre0991
Copy link
Author

Cool, I'll implement it.

@bbatsov
Copy link
Member

bbatsov commented Feb 11, 2024

@Andre0991 Any updates?

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