This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-19
Channels
- # adventofcode (36)
- # asami (3)
- # babashka (22)
- # beginners (65)
- # calva (5)
- # clj-kondo (1)
- # cljs-dev (3)
- # clojure-europe (1)
- # clojurescript (3)
- # conjure (1)
- # core-async (6)
- # datomic (3)
- # emacs (4)
- # introduce-yourself (3)
- # juxt (11)
- # lsp (64)
- # malli (10)
- # missionary (11)
- # music (1)
- # off-topic (2)
- # pathom (1)
- # practicalli (1)
- # reagent (6)
- # reitit (3)
- # releases (3)
- # xtdb (9)
I managed to get clojure-lsp to hang again. This time I accidentally introduced a circular dependency between deps.edn files. Maybe clojure-lsp shouldn’t get stuck in that situation and just warn about the circular dependency?
What was the exactly cyclic dependency you added? A local root that points to the same parent or something?
the thread-*-all action doesn’t do anything for me in vscode with calva. is there some trick to get it working? i’m on 2021.12.01-12.28.16 and tried it with:
(:a (:b {}))
ah ok, thanks. i’m guessing theres a ticket already for that?
ah nice!
in the end we reverted because of other issues and found a way to "fix" it on clojure-lsp side
it’s fine, just wanted to let them know, but if you are fixing it anyway i’m happy:)
ah its all of them again, didn’t try any others yet today apparently
Why are the lsp breadcrumb file names underlined in red? (see picture)
I think i understand. Ill probably just disable tthe file path info, i rarely need that context when i'm in the file
Yeah, I implemented the lsp-mode breadcrumb but I need to confess that I don't use it anymore :p
How would i lint a clojure macro as clojure defn.
the current project structure
/.clj-kondo/config.edn -> {:lint-as my-macro/foo defn}
this is the currently the lsp project level (how do i check which workspace i'm using to make sure i'ts not "some-dir" which has a nother clj-kondo config.
/some-dir/.clj-kondo/config -> other lint-as rules
/some-dir/foo.cljs -> where marco is underlined as red.
yes. I didn't copy it correctly to the comment. It's :lint-as {my-macro/foo defn}
will it support nested clj-kondo configs?
interesting. thanks. I wonder why we have this strucute then, maybe something else is using those lint-as rules.
Not sure how hard would be to implement that since we do lint the whole project at start and would need to check if there is kondo config in each linted subdir
now i just have some-dir as the lsp project and some-dir/.clj-kondo/config with my macro correctly specified, but its still underlined as red. Is there a way to ask lsp what rules it's using to resolve symbols/text to see if my clj-kondo config file is in that list? Output of logs
[Trace - 01:37:28 PM] Sending request 'textDocument/codeAction - (22)'.
Params: {
"textDocument": {
"uri": "file:///home/drewverlee/archmedx/kyber/server/src/pathom/resolvers/curriculum/learners.cljs"
},
"range": {
"start": {
"line": 10,
"character": 13
},
"end": {
"line": 10,
"character": 13
}
},
"context": {
"diagnostics": [
{
"tags": [],
"message": "Unresolved symbol: readiness",
"source": "clj-kondo",
"code": "unresolved-symbol",
"severity": 1,
"range": {
"end": {
"character": 25,
"line": 10
},
"start": {
"character": 16,
"line": 10
}
}
}
]
}
}
No, you change kondo config and just make any changes to the file that will be linted with the new config
Is LSP concerned about anything in the workspace structure like a deps.edn file or .clj-kondo/config.edn ? i'm guessing it does look at the kondo file, but i wouldn't assume it cares about the deps/lein project config file.
It scans the deps.edn/project.clj for source-paths discovery only, nothing related with lint/kondo
whats the outcome if your workspace root doesn't have a deps.edn or project.clj?
it can't help with autocomplete on those deps?
Because the project is split across a browser client and a server. They put the .clj-kondo at the root that shared both and the deps in the root/client/deps.edn root/server/deps.edn And then had clj-kondo at multiple levels root/server/.clj-kondo/config root/.clj-kondo/config So for the moment, what i have done is to copied the shared clj-kondo into the 2 projects. Both of which will be separate LSP workspace: root/client/deps.edn + clj-kondo root/server/deps.edn +clj-kondo
Please open an issue about the nested kondo support so we can discuss better how to implement and make lsp support that
That sounds like a good idea. It might be that our project should make a change to. I'm currently too overloaded to think on it further 🙂
@U0DJ4T5U1 what is the reason you have one root clj-kondo and multiple projects?
thanks, ill take a look. :config-paths is an option of clj-kondo right @U04V15CAJ? that wouldn't cover lsp handling a root directory that didn't have a clojure deps file or lein project.clj file. the clj-kondo file was likely intended to be shared between the browser client and the server code. I think CI tooling is using it for both of them.
yes. my suggestion is to have always a .clj-kondo
directory in each project and use :config-paths
to refer to a shared config from each project
:config-paths ["../../shared-kondo-config"]
the first ..
is for going up into the project too, and the second ..
is for going to the parent directory of the projectThat makes sense, thanks for the pointers!