helix

timrichardt 2023-05-03T17:13:17.736369Z

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.

zane 2023-05-03T17:23:29.382089Z

Do you have CIDER connected + that namespace evaluated?

timrichardt 2023-05-03T17:25:27.436539Z

Yep, both.

zane 2023-05-03T17:25:45.276089Z

Odd. That usually takes care of it for me.

timrichardt 2023-05-03T17:26:16.374199Z

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

zane 2023-05-03T17:28:24.032449Z

Wait. I was wrong.

zane 2023-05-03T17:28:44.361099Z

defnc seems to render correctly for me without CIDER.

zane 2023-05-03T17:29:57.484789Z

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

zane 2023-05-03T17:30:17.775309Z

If it helps, I’m not using LSP.

zane 2023-05-03T17:31:00.254539Z

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

timrichardt 2023-05-03T17:32:45.389849Z

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

šŸ‘šŸ» 1
zane 2023-05-03T17:33:47.491779Z

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

hifumi123 2023-05-03T18:34:56.702569Z

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

rafaeldelboni 2023-05-03T18:43:40.040049Z

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

timrichardt 2023-05-03T19:19:10.138029Z

> 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
timrichardt 2023-05-03T21:27:09.303709Z

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

timrichardt 2023-05-03T22:32:44.824399Z

> 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