Thank you for the support β€οΈ
I'm getting:
Could not find artifact com.datomic:dev-local:jar:0.9.225 in central (<https://repo1.maven.org/maven2/>)
when add that datomic depsWhat is the dep config you have?
Oh, missed the bit at the top. You do have to sign up for it after all: https://cognitect.com/dev-tools
But still just an email sign-up
{:deps {org.clojure/clojure {:mvn/version "1.10.2"}}
:paths ["src" "resource"]
:aliases {:dev {:extra-paths ["dev"]
:extra-deps {com.datomic/dev-local {:mvn/version "0.9.225"}
org.clojure/tools.namespace {:mvn/version "1.1.0"}}}}}
oh
But once it gets used it does get added to .m2/repository
Do I need to download the dep manually?
Follow the link
Ok, I managed to run the clj command right now
It works properly π
That's datomic.client.api. That one works for me
We're talking about com.datomic/dev-local
I have that deps already, what is the namespace so?
[datomic.dev-local :as dev-local]
?yeah
Alright, finally I could reproduce it
for datomic.dev-local
, the completions indeed don't work, I'll investigate
I know I'm brand new to Doom, but I didn't think it was my setup
The issue is that clj-kondo is not anaylizing that
you can confirm that if you hover over the namespace require and call lsp-clojure-cursor-info
it prints nil on the definition
Right, I mentioned that earlier
And doesn't on datomic.client.api
And datomic-cloud comes from an S3 bucket so that's external too
for me it prints for datomic-client.api
I'll now confirm if it's a clj-kondo issue and not a clojure-lsp one
Yeah, still curious why mine isn't caching
not sure clj-kondo uses different cache path based on OS
I'm in Arch Linux
I'm on NixOS, but problably not related
I looked at Nix, but couldn't move forward with the fact that packages have to be built on your machine or they won't work. I love the declarative aspect of it though
I have my whole system on my dotfiles and it works across different systems π
Just need one file for the boot of each hardaware, the rest works perfect
Yeah, that's nice. I just like being able to use pre-built binaries for certain things
yeah, that has tradeoffs, I was a Debian user some years ago
I've been on Arch for over 15 years. Have looked around, but nothing was compelling enough to leave. The AUR and ABS are very convenient for when I need something that isn't in the main repos or needs to be tweaked or I can update it before the official maintainers.
Yes, Arch would be my second choice if there is no Nix π
So, I'm trying to use clj-kondo via terminal to lint the classpath and check if it is a issue there
So read the readme for clj-kondo and it mentions that you have to create the .clj-kondo/. I created it in the project and now there is a cache
oh, didn't know about that.. I thought it's created automatically
probably it was using a cache but in another folder like tmp
or ~/.clj-kondo/.cache
That didn't change the behavior though
I created the full cache from the classpath and it shows up in the cache
try call clj-kondo --lint /tmp/foo.clj --config '{:output {:analysis true :format :edn}}'
to get clj-kondo analysis
that what's clojure-lsp uses
I don't see anything odd in it
we need to check if it's missing datomic.dev-local analysis
like functions from that namespace that should show in completion
Oh, we should call differently, we need to pass the classpath instead of a folder, or pass the path to the datomic.dev-local jar/file
I'll try it
Something like:
clj -Sdeps '{:deps {clj-kondo {:mvn/version "2021.02.14-20210218.170309-6"}}}' -m clj-kondo.main --config '{:output {:analysis true :format :json}}' --lint "~/.m2/repository/com/datomic/dev-local/0.9.225/dev-local-0.9.225.jar:datomic/dev_local.clj" |jq .
Oh, I know what is probably the issue
there is no way clj-kondo analyze a dependency that has no source code...
that jar doesn't contain the source code
or there be some way to make that work with clj-kondo
Oh, I see. It makes sense for them to do it that way though
Again, Cursive does it so there is a way to do it.
yes, cider get the completions since use the REPL
Probably Cursive only shows when the REPL is connected
I can test that
It works without the REPL
We need to know if that is possible with clj-kondo too
I wouldn't know. I haven't used the tool directly before today
I do know that IntelliJ can decompile class files so they might be leveraging that.
@borkdude Can you help us?
TL DR: clj-kondo analysis doesn't work with jars that don't have the source code, like datomic.dev-local
, so clojure-lsp completion doesn't work for that, Is there any way to get that working?
Cursive somehow works without a REPL
Yes, it could be that @mike.j.cusack
Hi, I'm considering trying clojure-lsp and I'm wondering how well it plays with Cider and possibly other packages, particularly in Spacemacs. E.g. auto-completion looks like the thing that could clash. Are you using them together? If so are there any issues? And what's your most favorite lsp feature missing in Cider that you cannot live without? π
Most clj-refactor features doesn't work well for me in medium/big projects
I use cljr-add-import-to-ns
, cljr-add-require-to-ns
, and cljr-add-missing-libspec
all the time and they work well.
But things that require whole project evaluation break - e.g. cljr-rename-symbol
yeah, lsp code actions should handle the add-* π and the LSP rename works perfect
Mine is probably this one: https://clojurians.slack.com/archives/CPABC1H61/p1613996419114800
As for conflicts: I am using both but Iβm not aware of any conflicts, there might be but they havenβt interrupted with my dev yet
I can't get over how well this all works. Seriously guys, marriage of clj-condo and lsp is the best thing since sliced bread.
Thanks @borkdude & @ericdallo
Let's not forget @snoe, the man who started this project :)
ah, thanks @snoe, you're the best!
@jumar Yeah, they work together, at least for doom-emacs, completion will use LSP and when Cider is on, it'll use Cider completions. You can control to use LSP completion instead of Cider with (setq lsp-enable-completion-at-point t)
. For more information https://emacs-lsp.github.io/lsp-mode/tutorials/clojure-guide/.
BTW My favorite feature are the https://clojure-lsp.github.io/clojure-lsp/features/#code-actionsπ, especially clean-ns
and add-missing-*
This is probably also one of my favorites: find the definition for a local: https://twitter.com/borkdude/status/1364194077105872896
(for #3 there's cider-path-translations
to help with that)