helix 2023-05-03

A question to emacs users. How do you get defnc to render as a defn ? I made LSP aware of helix adding :lint-as {helix.core/defnc clojure.core/defn} , but emacs does not render the doc string in the right color.

Do you have CIDER connected + that namespace evaluated?

Yep, both.

Odd. That usually takes care of it for me.

Okay, do by chance have your docstrings and strings the same color?

Wait. I was wrong.

defnc seems to render correctly for me without CIDER.

Might you be using an outdated instance of clojure-mode?

If it helps, I’m not using LSP.

I am using clj-kondo, and have the same :lint-as declaration you do in .clj-kondo/config.edn.

Ah, I think LSP uses kondo, too. Thanks for the pointers, hope I can get it working too.

šŸ‘šŸ» 1

> same color No, different colors for each. defnc is jusing font-lock-keyword-face, and docstrings are using font-lock-string-face.

iirc there is a custom hook for defnc, which may provide the proper coloring

Usually clojure-lsp downloads for me automatically some kondo config files for the libs I'm using, this is what it downloads for helix: https://github.com/rafaeldelboni/clojuredocs-helix/blob/main/.clj-kondo/lilactown/helix/clj_kondo/lilactown/helix.clj#L29

> clojure-lsp downloads for me automatically some kondo Yes, for me too. Didn't notice the new .clj-kondo directory and I didnt reload the lsp after adding helix. After reloading, linting works without any customization.

šŸ†’ 2

But M-x describe-face still says font-lock-string-face for me. 🫠 It should be font-lock-doc-face. I've attached a minimal emacs conf that just installs LSP.

emacs -q -l docstring.el

> docstrings are using font-lock-string-face. @zane I did miss right away that you wrote -string-face. It's -string-face for me too, but it should be font-lock-doc-face. So everything seems consistent. Haven't had a look into clj-kondo yet, but it looks like passing the bare docstring in analyze-definition isn't enough for the full defn experience. https://github.com/lilactown/helix/blob/68c7d38113155603f1df47b9e0c22315ff576af4/resources/clj-kondo.exports/lilactown/helix/clj_kondo/lilactown/helix.clj#L47

šŸ‘šŸ» 1