Fork me on GitHub
#lsp
<
2021-02-22
>
nmkip00:02:53

Hi, is there a place to configure clojure-lsp and clj-kondo? I'm not getting all the warnings and also it doesnt look like in the docs.

ericdallo00:02:09

Yes, the lint is done by clj-kondo

nmkip00:02:39

Thanks, Ill try it.

nmkip00:02:11

Another quick question, do I need company-lsp? In the https://emacs-lsp.github.io/lsp-mode/ I read it was no longer supported. https://clojure-lsp.github.io/clojure-lsp/clients/ it recommends it.

ericdallo00:02:13

No, it's deprecated, you should use company-capf, I'll update the docs, thanks!

nmkip01:02:33

kk ty! 😄

nmkip23:02:22

I'm still having some problems with clj-kondo and lsp. I have an example file with 1 error and 3 warnings. I manually run clj-kondo which gets the config that I placed in ~/.clj-kondo/config.edn on that file and I get the 3 warnings and the error. When I open that example.clj file with emacs and lsp, I'm only getting 3 warnings and no errors.

$ clj-kondo --lint example.clj

example.clj:4:5: warning: Unsorted namespace: clojure.set
example.clj:4:5: warning: namespace clojure.set is required but never used
example.clj:11:12: warning: unused binding x
example.clj:15:3: error: clojure.string/join is called with 0 args but expects 1 or 2
linting took 12ms, errors: 1, warnings: 3
My clj-kondo config looks like this:
{:skip-comments true
 :linters {:unused-namespace {:exclude [clojure.test.check]}
           :unused-referred-var {:exclude {clojure.test [is deftest testing]}}
           :unsorted-required-namespaces {:level :warning}} }
This is what I have in my init.el:
(use-package lsp-mode
    :ensure t
    :hook ((clojure-mode . lsp)
           (clojurec-mode . lsp)
           (clojurescript-mode . lsp))
    :config
    ;; add paths to your local installation of project mgmt tools, like lein
    (setenv "PATH" (concat
                    "/usr/local/bin" path-separator
                    (getenv "PATH")))
    (dolist (m '(clojure-mode
                 clojurec-mode
                 clojurescript-mode
                 clojurex-mode))
      (add-to-list 'lsp-language-id-configuration `(,m . "clojure")))
    (setq lsp-clojure-server-command '("bash" "-c" "clojure-lsp"))
    (setq gc-cons-threshold 100000000)
    (setq read-process-output-max (* 1024 1024))
    (setq lsp-completion-provider :capf)
    (setq lsp-headerline-breadcrumb-enable nil))
Previously I was using flycheck-clj-kondo but I removed it. When I had`flycheck-clj-kondo` and lsp-mode at the same time I saw the 3 warnings and 1 error for 1 or 2 seconds until lsp-mode connected to the clojure-lsp server. When it connected, lsp-mode overrode the error. And emacs shows the example file like this:

ericdallo00:02:17

Hum, I could not reproduce that, could you try remove .lsp/sqlite.db ?

nmkip01:02:39

back, I was eating. Let me check if I have that file

nmkip01:02:00

~/.lsp/sqlite.db ?

nmkip01:02:10

AHh, inside the project

nmkip01:02:15

ahh that made the trick!

nmkip01:02:28

thanks eric

ericdallo01:02:47

You're welcome 😉

nmkip01:02:13

btw, is there a way to check if semantic-tokens are active?

nmkip01:02:40

This is my ~/.lsp/config.edn

{
 :auto-add-ns-to-new-files? true
 :semantic-tokens? true
 }
but as you can see in the screenshot I sent before, comment isn't colored. It gets colored once I turn on cider and eval the buffer.

ericdallo01:02:06

you need to enable it manually on lsp-mode too

ericdallo01:02:12

lsp-semantic-tokens-enable t

nmkip01:02:14

ah ! great, Ill try it now. You helped me a lot! Thanks.

😃 3
devn08:02:51

thanks @ericdallo for all of your work. the new github pages layout, the emacs guide, and all of the support I’ve seen in this channel are much appreciated

❤️ 12
clojure-lsp 9
ericdallo10:02:42

Glad to hear it's helping :D, thank you!

ericdallo00:02:25

Thank you for the support ❤️

borkdude11:02:44

If you experience slowness in clojure-lsp with emacs, consider bumping company-idle-delay to a positive non-zero value

☝️ 3
ericdallo11:02:16

Another thing that maybe can help is increase the company-min-length too Also I'll improve 0 length completion peerformance on clojure-lsp

😍 3
anonimitoraf12:02:18

I tend to abuse the 0 min-length completion in Typescript 😅 to see which exports a module has 😅

ericdallo12:02:17

Yeah, that feature added this performance issue haha we can improve the results to show more important items and discard others

ericdallo12:02:23

I just wonder what to drop

anonimitoraf12:02:59

Oh right, yea I can imagine how much more inefficient it can get with everything showing up as a candidate. Is it possible to asynchronously load the candidates in chunks? Not sure how TS LSP does it but I'm willing to bet they do something like this

ericdallo12:02:54

we can certainly improve some things like don't return the docs for all items and use resolveItem LSP method

ericdallo12:02:37

Emacs is single thread in the end 😅

borkdude12:02:16

rewrite in clojure

ericdallo12:02:22

BTW @U04V15CAJ just FYI, doom-emacs default of company-idle-delay is 0.5 and the company package default is 0.2

anonimitoraf12:02:36

resolveItem = only return candidates that fit the current context? > Emacs is single thread in the end The comm with the LSP server is done async, right? So do you mean, the inefficiency is from Emacs rendering the candidates? (I'm just guessing)

ericdallo12:02:53

There is https://github.com/emacs-ng/emacs-ng in rust, that make emacs use js and is 30x better in performance 🙂

anonimitoraf12:02:36

Oh yea. Is this backwards-compatible with Elisp packages?

ericdallo12:02:09

> Oh yea. Is this backwards-compatible with Elisp packages? I think so 😅 > The comm with the LSP server is done async, right? So do you mean, the inefficiency is from Emacs rendering the candidates? (I'm just guessing) (edited) I don't know that much about client completion, but the size of json matters a lot, but yeah, completion performance on emacs is worst than vscode for example AFAIK

anonimitoraf12:02:49

Oh wait, emacs-ng is not the rust port of emacs. You're probably talking about remacs. Seems like emacs-ng is from the native-comp branch that supports Deno (Typescript) for writing packages

ericdallo12:02:49

yep, remacs is kind of stuck AFAIK, emacs-ng is also written using rust

anonimitoraf12:02:18

Oh right, I see a rust_src dir, yea

ericdallo12:02:20

but yeah, emacs-ng is the native-comp branch with improvements in rust

borkdude12:02:21

Can we support other languages like Clojure too maybe via a running JVM server or possibly babashka? Is this emacs-ng extensible?

borkdude12:02:13

I guess you can already kind of do this by shelling out in elisp

ericdallo12:02:30

yeah, probably 🙂 This is the maintainers channel: https://gitter.im/emacsng/community

ericdallo12:02:34

@U04V15CAJ @UR37CBF8D do you see any items from this "All completions items" that we could remove from the 0 length completion? https://pastebin.com/U4zH4jYD

ericdallo12:02:59

There are, clojure.core symbols, java.lang and util symbols, other ns symbols, current ns symbols

borkdude12:02:33

@ericdallo When I type 1s, why would lsp be interested in symbols not starting with 1 at all?

ericdallo12:02:11

Good question, but we don't return any completion for 1s

ericdallo12:02:19

you can check the request/response from logs

borkdude12:02:35

If I don't get any completions for 1s, why did it make the request and why did it take so long?

☝️ 6
anonimitoraf13:02:41

I can see a bunch of keyword labels like these: Are these meant to be candidates?

anonimitoraf13:02:18

(I have to sleep now, past midnight here in Aus 😴 )

ericdallo13:02:00

They are from the clj-kondo (the project I was testing it), I think makes sense to keep it

ericdallo13:02:24

Also the response size is not big, I'll let remove completion items as a last resource if needed

borkdude13:02:12

@ericdallo When do you get all these completions, out of the blue without a context (a starting letter, for example)?

ericdallo13:02:57

when I just hit C-SPC in the start of a line (to get all completion items, without any prefix)

borkdude13:02:18

makes sense

borkdude12:02:19

@ericdallo thanks for fixing the keyword search, works perfectly now.

catjam 3
nice 6
danielneal15:02:22

When I have lsp enabled in emacs, using clojure-lsp, the editor slows to a crawl, forward-char, backward-char, previous-line and next-line take about a second to run. Is this normal?

danielneal15:02:06

oh the company-idle-delay? Thanks

ericdallo15:02:47

Yes @danieleneal, Also I'm improving that on clojure-lsp side, soon changing that setting will not be necessary anymore

danielneal15:02:58

great, thanks 🙂

ribelo18:02:24

is there any way to make lsp eldoc work identically to cider eldoc?

ericdallo18:02:46

what do you mean exactly?

ribelo18:02:26

when I use cider alone, in addition to the function name I also have the required arguments

ericdallo18:02:36

set show-docs-arity-on-same-line? to true

mikejcusack20:02:21

Just trying out Doom Emacs with clojure-lsp and having some trouble with autocompletion hints. It doesn't seem to work on expanding ns aliases unless I type some standard form first (like defn). But then it still isn't working for deps that are in an extra deps.edn alias. For example, [datomic.dev-local :as dev-local] in a :dev alias. Typing "(dev-local)" doesn't show any hints. Running the actual code works with dev-local as intended.

ericdallo21:02:17

Do you have a minimal repro?

ericdallo21:02:31

Check the logs if your classpath was scanned properly

mikejcusack20:02:10

It appears my .lsp/config.edn in the project root is being ignored.

ericdallo21:02:05

Check the logs running lsp-clojure-server-info , via the log-path property

mikejcusack21:02:22

Checked them and there's nothing indicating an issue

ericdallo21:02:00

could you test if moving the config to ~/.lsp/config.edn works?

ericdallo21:02:09

also what is the config you added that is not working?

mikejcusack21:02:19

Ok so I checked lsp-clojure-server-info and there is :project-settings, which shows what I have and :client-settings, which does not include my alias and :project-specs is nil

ericdallo21:02:23

so, let me see if I understand your issue, you have a deps in your deps.edn in a custom alias, and the completion feature doesn't show the completion for that deps, right?

ericdallo21:02:49

if so, you need to tell clojure-lsp to use a custom project-spec classpath-cmd

ericdallo21:02:50

if you need a different classpath different from clojure -Spath , then you need to configure the project-spec

mikejcusack21:02:31

I have

:project-specs [{:project-path "deps.edn"
                  :classpath-cmd ["clj" "-A:dev" "-Spath"]}]

mikejcusack21:02:55

Running that command manually shows the correct path

mikejcusack21:02:11

But it seems to be using the settings in :client-settings vs :project-settings

ericdallo21:02:14

I see, it looks correct Indeed

ericdallo21:02:47

If you add that config in ~/.lsp/config.edn it works?

mikejcusack21:02:49

It shows the same output in the server info and still doesn't work

ericdallo22:02:37

the :client-settings are settings sent from emacs, your config should be in :project-settings

ericdallo22:02:00

oh, make sure you remove your project/.lsp/sqlite*

ericdallo22:02:07

probably that's the issue....

mikejcusack22:02:40

Recreated the sqlite db and no change

mikejcusack22:02:53

My config is in :project-settings, but it's not being applied

ericdallo22:02:15

that's odd..

ericdallo22:02:32

Would you mind create a minimal project repro that?

mikejcusack22:02:57

This project is early on

mikejcusack22:02:08

I just installed Doom Emacs today

ericdallo22:02:18

I use doom too

mikejcusack22:02:37

So how do you include additional aliases?

ericdallo22:02:26

let me try what you did

mikejcusack22:02:35

But how do you personally do it?

ericdallo22:02:37

adding a project-spec to rpoject config

ericdallo22:02:46

I use on ~/.lsp/config.edn

ericdallo22:02:02

I don't need to add custom project-specs

mikejcusack22:02:03

So how do you handle per-project aliases?

mikejcusack22:02:32

You include dev deps with prod deps?

ericdallo22:02:33

the projects I work have custom alias but none change the deps

ericdallo22:02:43

Could you share your dev alias?

mikejcusack22:02:52

:dev {:extra-paths ["dev"]
      :extra-deps {com.datomic/dev-local {:mvn/version "0.9.225"}
                   org.clojure/tools.namespace {:mvn/version "1.1.0"}}}

👀 3
ericdallo22:02:12

so tools.namespace completion doesn't work too, right?

ericdallo22:02:16

I'll test with that

mikejcusack22:02:24

Oddly enough moving dev-local to main deps still doesn't work

ericdallo22:02:30

It works for me

ericdallo22:02:39

only when adding the project/.lsp/config.edn

ericdallo22:02:51

so your problem is something else not right

mikejcusack22:02:10

What is your config?

ericdallo22:02:18

do you have clj on your emacs path? try changing to clojure instead of clj

ericdallo22:02:45

sample-project/.lsp/config.edn

{:project-specs [{:project-path "deps.edn"
                  :classpath-cmd ["clj" "-A:dev" "-Spath"]}]}

ericdallo22:02:01

sample-project/deps.edn

{:deps {org.clojure/clojure {:mvn/version "1.10.2"}}
 :paths ["src" "resource"]
 :aliases {:dev {:extra-paths ["dev"]
                 :extra-deps {org.clojure/tools.namespace {:mvn/version "1.1.0"}}}}} 

ericdallo22:02:28

and when I require [clojure.tools.namespace.file :as tools.ns] and try to complete tools.ns/ I get the results

ericdallo22:02:05

I'll probably improve the classpath scanning log, to help with cases like that

ericdallo22:02:31

try removing .lsp/sqlite.db and .clj-kondo/.cache

mikejcusack22:02:21

I tried that already. And .clj-kondo doesn't exist

ericdallo22:02:30

oh, that odd

ericdallo22:02:39

what's your clojure --version ?

mikejcusack22:02:05

Ok, so when require the tools.namespace.repl with an alias it does work. But typing out the FQDN doesn't

ericdallo22:02:23

sorry, clojure-lsp --version

mikejcusack22:02:53

2021.02.21-21.02.51

ericdallo22:02:48

your project should contain a .clj-kondo folder

ericdallo22:02:05

clojure-lsp scan the classpath using clj-kondo under the hood

ericdallo22:02:17

and we cache the results on that .clj-kondo/.cache

mikejcusack22:02:25

Doesn't exist

ericdallo22:02:34

do you have any clj-kondo config in your home or something that could mess with that?

ericdallo22:02:00

damm, that's really odd

ericdallo22:02:33

what means "But typing out the FQDN doesn't"?

mikejcusack22:02:46

Type out the FQDN and autocomplete doesn't work

mikejcusack22:02:23

So like clojure.tools.namespace.repl

ericdallo22:02:01

you are trying to complete something like clojure.tools.namespace.file/ ?

mikejcusack22:02:55

.repl/, but yes

ericdallo22:02:06

yeah, we don't support that ATM, and it should not be hard to implement it, please open a feature request issue, sorry for the bad comumnication 🙂

mikejcusack22:02:36

Hmm, ok. That's a significant missing piece since there are times to prefer the FQDN

mikejcusack22:02:48

But I still can't get dev-local to work

mikejcusack22:02:00

But the code itself runs normal

ericdallo22:02:11

what is the dev-local?

ericdallo22:02:30

the deps on your dev alias, right?

mikejcusack22:02:44

com.datomic/dev-local

ericdallo22:02:56

let me try that one

mikejcusack22:02:36

That one is a bit more complicated because you have to have a mvn config for the repo

ericdallo22:02:38

BTW, is your code on dev or src folder?

ericdallo22:02:54

hum, I thought it was public

mikejcusack22:02:56

My dev helper code is in dev and the main stuff is in src

mikejcusack22:02:10

It's free to use, but you still have to sign up for access

ericdallo22:02:41

oh, did you add the dev folder to source-paths ?

ericdallo22:02:53

we use a default source-paths of src and test

ericdallo22:02:05

I mean, clojure-lsp source-paths

mikejcusack22:02:25

:source-paths #{"src" "dev"}

👍 3
ericdallo22:02:19

so only that datomic deps is not working

ericdallo22:02:32

but the clojure.tools.namespace work?

mikejcusack22:02:06

What disables being able to insert spaces?

ericdallo22:02:09

probably clj-kondo is not scanning correctly that deps so

ericdallo22:02:58

we could check the transit file, like this for example:

project/.clj-kondo/.cache/2021.02.14-SNAPSHOT/clj/clojure.tools.namespace.file.transit.json

ericdallo22:02:14

but your project has no .clj-kondo is really weird

mikejcusack22:02:16

So I don't know why that dir doesn't exist

mikejcusack22:02:26

I have clj-kondo installed

ericdallo22:02:30

any permission issue with your project folder?

ericdallo22:02:48

you don't need clj-kondo installed, clojure-lsp use clj-kondo via JVM

ericdallo22:02:06

but if you have a custom .clj-kondo/config.edn somewhere, it could mess that

ericdallo22:02:12

if you change the cache-dir manually

mikejcusack22:02:10

I uninstalled the system clj-kondo and no difference

ericdallo22:02:07

it should not make any difference indeed, but any ~/.clj-kondo/config.edn or something like that changing the cache dir can cause a issue

ericdallo22:02:15

but I don't think that's the issue here

mikejcusack22:02:21

That file doesn't exist either

ericdallo22:02:47

anything on clojure-lsp logs? /tmp/clojure-lsp.*.out

ericdallo22:02:56

yeah, that's sad. Please open an issue following the issue template, it'd be good to use a external deps easy to debug and a minimal project with all those files configured if you don't mind

mikejcusack23:02:12

I also can't get REBL to work with Doom either so this is looking less appealing as I go

ericdallo23:02:40

😕 did you enable the (clojure +lsp) in your init.el?

mikejcusack23:02:06

lsp is working for deps other than dev-local

ericdallo23:02:09

It could be a permission issue with your pc

mikejcusack23:02:31

It works fine in Cursive

ericdallo23:02:43

yeah, really weird

mikejcusack23:02:53

Including autocompleting dev-local

mikejcusack23:02:19

I like Cursive a lot. I just wanted to see what this side looked like. I don't know how it's so popular with how much trouble it is to get right

ericdallo23:02:58

Normally it works, your case really looks a corner case

mikejcusack23:02:31

But not really. Even with the regular alias deps it was inconsistent in autocompleting

ericdallo23:02:24

Why inconsistent?

mikejcusack23:02:41

What I don't understand is that the jar is in my .m2/repository for dev-local so Cursive can scan it fine. I don't know why clojure-lsp is having this trouble

ericdallo23:02:16

It could be a clj-kondo issue

mikejcusack23:02:23

The autocomplete wouldn't always work for the working completions. Sometimes nothing would show up and just deleting the text repeatedly it would sometimes work

ericdallo23:02:49

But if clj -Spath works and you can cat the file in m2, it should work

mikejcusack23:02:51

But if I grabbed the latest doom emacs and simply enabled clojure and lsp then there shouldn't be an issue

mikejcusack23:02:08

Exactly. And it does show up in the -Spath

mikejcusack23:02:22

And Cursive reads it fine

mikejcusack23:02:09

But you can easily sign up for datomic dev-local and grab the jar yourself. It's just an email sign-up and .m2/settings.xml credentials given

ericdallo23:02:07

Oh, check if kondo recognizes the namespace, hover under the datomic.dev require and call lsp-clojure-cursor-info

mikejcusack23:02:01

Nope. And thus going to definition also doesn't work

mikejcusack23:02:03

I honestly wonder if it's an issue with the hyphen

mikejcusack23:02:13

None of my other deps have one to test

mikejcusack23:02:36

Wait, yes there is one. com.datomic/client-cloud

mikejcusack23:02:45

And that one autocompletes and goes to definition

mikejcusack23:02:33

Hold on. I'm derping. I'm thinking of the on-prem dev tools. dev-local is just a regular dep: https://docs.datomic.com/cloud/dev-local.html#using

mikejcusack23:02:40

So you can pull that and test

ericdallo23:02:10

Yes, I can test it in a some minutes, I'm on mobile right now

👍 3
mikejcusack23:02:38

I'm also noticing that enabling parinfer makes lsp not start automatically. And it doesn't work either

ericdallo23:02:10

Hahaha that doesnt makes any sense, but it's a lsp-mode side issue or related

ericdallo00:02:48

I'm getting:

Could not find artifact com.datomic:dev-local:jar:0.9.225 in central ()
when add that datomic deps

mikejcusack00:02:06

What is the dep config you have?

mikejcusack00:02:17

Oh, missed the bit at the top. You do have to sign up for it after all: https://cognitect.com/dev-tools

mikejcusack00:02:25

But still just an email sign-up

ericdallo00:02:30

{: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"}}}}}

mikejcusack00:02:05

But once it gets used it does get added to .m2/repository

ericdallo00:02:06

Do I need to download the dep manually?

mikejcusack00:02:14

Follow the link

ericdallo00:02:57

Ok, I managed to run the clj command right now

ericdallo00:02:14

It works properly 😔

mikejcusack00:02:01

That's datomic.client.api. That one works for me

mikejcusack00:02:14

We're talking about com.datomic/dev-local

ericdallo00:02:37

I have that deps already, what is the namespace so?

ericdallo00:02:20

[datomic.dev-local :as dev-local]
?

ericdallo00:02:53

Alright, finally I could reproduce it

ericdallo00:02:15

for datomic.dev-local , the completions indeed don't work, I'll investigate

👍 3
mikejcusack00:02:57

I know I'm brand new to Doom, but I didn't think it was my setup

ericdallo00:02:05

The issue is that clj-kondo is not anaylizing that

ericdallo00:02:24

you can confirm that if you hover over the namespace require and call lsp-clojure-cursor-info

ericdallo00:02:29

it prints nil on the definition

mikejcusack00:02:39

Right, I mentioned that earlier

mikejcusack00:02:48

And doesn't on datomic.client.api

mikejcusack00:02:12

And datomic-cloud comes from an S3 bucket so that's external too

ericdallo00:02:33

for me it prints for datomic-client.api

ericdallo00:02:47

I'll now confirm if it's a clj-kondo issue and not a clojure-lsp one

mikejcusack00:02:04

Yeah, still curious why mine isn't caching

ericdallo00:02:39

not sure clj-kondo uses different cache path based on OS

mikejcusack00:02:21

I'm in Arch Linux

ericdallo00:02:15

I'm on NixOS, but problably not related

mikejcusack00:02:13

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

ericdallo00:02:00

I have my whole system on my dotfiles and it works across different systems 🙂

ericdallo00:02:17

Just need one file for the boot of each hardaware, the rest works perfect

mikejcusack00:02:43

Yeah, that's nice. I just like being able to use pre-built binaries for certain things

ericdallo00:02:42

yeah, that has tradeoffs, I was a Debian user some years ago

mikejcusack01:02:45

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.

ericdallo01:02:42

Yes, Arch would be my second choice if there is no Nix 😅

🙌 3
ericdallo01:02:17

So, I'm trying to use clj-kondo via terminal to lint the classpath and check if it is a issue there

mikejcusack01:02:53

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

ericdallo01:02:12

oh, didn't know about that.. I thought it's created automatically

ericdallo01:02:23

probably it was using a cache but in another folder like tmp

ericdallo01:02:55

or ~/.clj-kondo/.cache

mikejcusack01:02:45

That didn't change the behavior though

mikejcusack01:02:01

I created the full cache from the classpath and it shows up in the cache

ericdallo01:02:45

try call clj-kondo --lint /tmp/foo.clj --config '{:output {:analysis true :format :edn}}' to get clj-kondo analysis

ericdallo01:02:53

that what's clojure-lsp uses

mikejcusack01:02:33

I don't see anything odd in it

ericdallo01:02:54

we need to check if it's missing datomic.dev-local analysis

ericdallo01:02:12

like functions from that namespace that should show in completion

ericdallo01:02:14

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

ericdallo01:02:20

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 .

ericdallo01:02:11

Oh, I know what is probably the issue

ericdallo01:02:29

there is no way clj-kondo analyze a dependency that has no source code...

ericdallo01:02:48

that jar doesn't contain the source code

ericdallo01:02:58

or there be some way to make that work with clj-kondo

mikejcusack01:02:59

Oh, I see. It makes sense for them to do it that way though

mikejcusack01:02:58

Again, Cursive does it so there is a way to do it.

ericdallo01:02:02

yes, cider get the completions since use the REPL

ericdallo01:02:17

Probably Cursive only shows when the REPL is connected

mikejcusack01:02:24

I can test that

mikejcusack01:02:46

It works without the REPL

ericdallo01:02:01

We need to know if that is possible with clj-kondo too

mikejcusack01:02:17

I wouldn't know. I haven't used the tool directly before today

mikejcusack01:02:35

I do know that IntelliJ can decompile class files so they might be leveraging that.

ericdallo01:02:32

@U04V15CAJ 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

ericdallo01:02:46

Yes, it could be that @U01NYKKE69G

borkdude10:02:36

clj-kondo only works with source code, not bytecode

ericdallo12:02:55

I see, it makes sense, Probably Cursive decompile the class or something

borkdude12:02:03

Is that even legal on projects like datomic?

3
ericdallo12:02:01

Just the completion I think it is

borkdude12:02:15

Ask Rich in your company slack ;)

😂 3
ericdallo12:02:16

actually not sure it's ilegal decompile the class

mikejcusack00:02:01

Thanks for confirming, but that really puts a damper on using it for me

ericdallo00:02:42

:/ I'm sorry, I can't see a easier way to fix that, only using cider probably you will get that completion

mikejcusack00:02:08

I couldn't get it to work there either

mikejcusack00:02:17

The code itself runs fine, but the completion doesn't work

ericdallo00:02:10

yeah, not sure Cider completion doesn't work for jars without source code, I suggest you ask in #emacs

borkdude08:02:03

I think that should work since cider looks at the vars at runtime

Noah Bogart21:02:59

hey all! thanks so much for making clojure-lsp, it's wonderful

Noah Bogart21:02:20

is there a way to turn off tooltips/intellisense on words in strings?

ericdallo21:02:55

thank you! What editor are you using? tooltips/intellisense you mean the diagnostics/lint?

Noah Bogart21:02:38

sorry, the pop-up window that displays function argument lists and docstrings. i use vim 8.1 and coc.nvim

Noah Bogart21:02:34

as you can see, it's suggesting apply even tho I'm in the middle of typing applicable lol

ericdallo21:02:37

We implemente support for signatureHelp on latest release, probably now it's enable by default on vim

ericdallo21:02:11

you need to disable on your vim LSP client, maybe @dharrigan knows how to do that, I'm a emacs user 😛

Noah Bogart21:02:37

coolio, i'll look into the coc.nvim config. thank you!

👍 3