inf-clojure icon indicating copy to clipboard operation
inf-clojure copied to clipboard

Add clojure-ts-mode support

Open Andre0991 opened this issue 2 years ago • 6 comments

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):

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

Thanks!

Andre0991 avatar Nov 20 '23 18:11 Andre0991

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 avatar Nov 28 '23 16:11 bbatsov

You might also want to check for inspiration a similar PR for CIDER https://github.com/clojure-emacs/cider/pull/3461

bbatsov avatar Nov 28 '23 16:11 bbatsov

 > 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?

Andre0991 avatar Dec 02 '23 16:12 Andre0991

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.

bbatsov avatar Dec 14 '23 08:12 bbatsov

Cool, I'll implement it.

Andre0991 avatar Dec 14 '23 13:12 Andre0991

@Andre0991 Any updates?

bbatsov avatar Feb 11 '24 10:02 bbatsov