Closed jcpsantiago closed 2 years ago
The current context patterns probably doesn't include something that matches for clojure. I don't use clojure myself, can you share some code that you would expect to work?
(defn onair-flights
[flight-data]
(let [ks (into []
(keep (fn [[k v]]
(when (and (= (:onground v) 0)
(> (:altitude v) 150)
(seq (:start v)
(seq (:end v))
(seq (:flight v)))
k))
flight-data))]
(if (empty? ks)
(do (timbre/info "No flights in the air, returning empty map.") {})
(do (timbre/info "Returning" (count ks) "flights found in the air")
(select-keys flight-data ks)))))
None of the above shows any context highlighting, but it's valid, working Clojure code.
Try to add lit$
to the indent_blankline_context_patterns
. Does that give you the expected result?
Yes, that works thanks! Could you explain/point me to the docs explaining what lit$
is?
Context works by comparing the treesitter tree against the list of lua patterns in indent_blankline_context_patterns
.
You can see how the treesitter tree looks like with :TSPlayground
.
For example, here is the one for clojure
lit$
just matches everything that ends with lit
.
The default patterns should cover most languages, I'll add the one for clojure as well.
ah I see! thanks for the explanation 👍
I'm using Neovim (this is my config https://github.com/jcpsantiago/nvim-fennel-lsp-conjure-as-clojure-ide) and blankline works for all the languages I've tested it with (R, Fennel, JS, Python) but not with Clojure. I have
all
parsers installed.In Clojure, with https://github.com/jcpsantiago/nvim-fennel-lsp-conjure-as-clojure-ide/blob/3fef0f52e0512069cd505738c2cb2aba14bb73cc/.config/nvim/fnl/config/plugin/blankline.fnl#L4 :
I see the vertical lines, but the context is not highlighted, which rather works in the other languages I cited above.
This could be an issue with https://github.com/sogaiu/tree-sitter-clojure, but wanted to check here first how I could debug it further to understand the source.