Add clojure-ts-mode support
Add support to clojure-ts-mode 0.
- Whenever the code used to reference
clojure-mode, I changed it to be aware ofclojure-ts-modeas 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.
checkdochas a few warnings that already existed before this PR.- I used
byte-compile-fileand 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 checkdocwarnings - [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!
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.
You might also want to check for inspiration a similar PR for CIDER https://github.com/clojure-emacs/cider/pull/3461
> 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?
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.
Cool, I'll implement it.
@Andre0991 Any updates?