This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-07
Channels
- # announcements (12)
- # autochrome-github (4)
- # babashka (27)
- # babashka-sci-dev (2)
- # beginners (80)
- # calva (34)
- # cider (8)
- # clj-kondo (77)
- # clojars (34)
- # clojure (50)
- # clojure-europe (35)
- # clojure-nl (4)
- # clojure-uk (5)
- # clojured (2)
- # clojurescript (26)
- # core-async (4)
- # cursive (4)
- # datahike (4)
- # datomic (40)
- # emacs (7)
- # etaoin (1)
- # fulcro (12)
- # google-cloud (143)
- # hyperfiddle (1)
- # integrant (2)
- # jobs (1)
- # malli (15)
- # membrane (17)
- # off-topic (38)
- # pathom (1)
- # reagent (4)
- # releases (2)
- # remote-jobs (2)
- # sci (1)
- # shadow-cljs (10)
- # spacemacs (7)
- # tools-deps (5)
- # vim (6)
- # xtdb (37)
Hello guys. My keywords color changed, they were blue. Other colors changes as well. I know there is a setting for the colors but I cant find it.
They are now tokenized as clojure keyword constants. Some themes don't have a rule for keyword constants. You use the editor.tokenColorCustomizations
setting and target them with the scope ["constant.keyword.clojure"]
. Example:
"editor.tokenColorCustomizations": {
"[Default Dark+]": {
"textMateRules": [
{
"scope": [
"constant.keyword.clojure"
],
"settings": {
"foreground": "#6fbfff"
}
}
]
}
},
I use the default dark theme. I will try your example. Thanks ❤️
I guessed you were using the default dark theme, hence the example. 😃 I can recommend the theme Github Dark Default, btw. It's very complete and nice.
I like dark+, which is also a default theme but handles more token types
This is dark+, which doesn't handle as many tokens as GitHub theme, afaik. :face_with_cowboy_hat:
mine does handle keywords and stuff. githubs purple is too much for me 😛
Yeah mine looks the same. It’s default as well but I’ve tried a few and either their main color is too bright (the github theme, night owl …) or they don’t have enough tokens defined. Dark+ has been the best which is actually nice for a default theme.
I think that the glitchy behaviour of Dark+ sometimes having highlighted keywords and sometimes not, is that it is clojure-lsp applying semantic tokens. And when clojure-lsp stops working, as it often does in my work project, then no highlight for me. Whereas Githubs theme has support for the keyword constants at the textmate scope level.
Another issue I noticed is that unused symbols don't get marked differently. That was not the case till recently. I tried the github default dark, its the same there
That's probably unrelated to the theme. It is clojure-lsp that is figuring out what is unused (or rather clj-kondo). It could be the same root cause as what makes keyword not highlight correctly though. If you have more projects, you can check if it is the same in all of them or just some.
The behavior is the same. You mentioned clj-kondo and I checked if I have anything in the problems tab on the terminal. It was empty, there are usually a lot of problems. This makes me think that clj-kondo has stopped working. If memory serves me right it should come bundled with calva. Is there a way to turn it on manually?
The linting is part of clojure-lsp, which uses clj-kondo. I think the clj-kondo version is tied to the clojure-lsp version, maybe @UKFSJSM38 can confirm. If so you can try specify an older release of clojure-lsp and see if that helps. Also check in #lsp for advice.
Sounds like a format error. In emacs, the following code formats well
(-> (get-in [:body :result])
Long/decode
(as-> x
(cond
(> x (nth @height 1))
(swap! height (fn [[_ end]] [end (inc x)])))))))
but in Calva, it becomes
(-> (get-in [:body :result])
Long/decode
(as-> x
(cond
(> x (nth @height 1))
(swap! height (fn [[_ end]] [end (inc x)])))))))
I also get the same format as @UGC0NEP4Y, but I thought that is the correct way to format it, where args are on the same indent level
Ah, could be that I was testing with a customized setting. Maybe we should start with checking cljfmt defaults. 😀
Indeed. cljfmt default fromats as->
using hanging indents: https://github.com/weavejester/cljfmt/blob/master/cljfmt/resources/cljfmt/indents/clojure.clj#L4
Not sure how to achieve the formatting you ask for there, @UGC0NEP4Y, since it is using three spaces for as->
, but to follow the community style guide better you can use [[:inner 0]]
, which will give you two space indents.
> I also get the same format as @UGC0NEP4Y, but I thought that is the correct way to format it, where args are on the same indent level The format of as-> inside (->) ignores the implicit parameter injected by ->.
Does emacs use cljfmt as well? This feels like a problem that has to be handled there
Yeah. I’ve posted the issue there: https://github.com/weavejester/cljfmt/issues/248