lsp

:clojure-lsp: Clojure implementation of the Language Server Protocol: https://clojure-lsp.io/
nmkip 2021-02-22T00:10:53.092100Z

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.

nmkip 2021-02-22T23:48:22.165900Z

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:

ericdallo 2021-02-23T00:20:17.166600Z

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

nmkip 2021-02-23T01:18:39.176600Z

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

nmkip 2021-02-23T01:19:00.176800Z

~/.lsp/sqlite.db ?

nmkip 2021-02-23T01:20:10.177200Z

AHh, inside the project

ericdallo 2021-02-23T01:21:42.177800Z

yes

nmkip 2021-02-23T01:23:15.178Z

ahh that made the trick!

ericdallo 2021-02-23T01:24:04.178200Z

Nice 🙂

nmkip 2021-02-23T01:24:28.178400Z

thanks eric

ericdallo 2021-02-23T01:24:47.178600Z

You're welcome 😉

nmkip 2021-02-23T01:26:13.179Z

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

nmkip 2021-02-23T01:27:40.179600Z

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.

ericdallo 2021-02-23T01:28:06.179800Z

you need to enable it manually on lsp-mode too

ericdallo 2021-02-23T01:28:12.180Z

lsp-semantic-tokens-enable t

nmkip 2021-02-23T01:30:14.180600Z

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

😃 1
nmkip 2021-02-22T00:11:51.092700Z

ericdallo 2021-02-22T00:14:09.093100Z

Yes, the lint is done by clj-kondo

ericdallo 2021-02-22T00:14:27.093300Z

Check this: https://clojure-lsp.github.io/clojure-lsp/settings/#lint

2021-02-22T00:17:45.093600Z

yes

2021-02-22T00:18:15.093800Z

like i said, lsp works for me in .clj and .cljs but not .cljc

nmkip 2021-02-22T00:18:39.094Z

Thanks, Ill try it.

nmkip 2021-02-22T00:22:11.094300Z

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.

ericdallo 2021-02-22T00:56:13.094800Z

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

ericdallo 2021-02-22T01:01:02.095Z

Done!

nmkip 2021-02-22T01:36:33.095200Z

kk ty! 😄

anonimitoraf 2021-02-22T03:47:18.096Z

lol, a bit weird that https://github.com/tonsky/FiraCode is in there too

😄 1
devn 2021-02-22T08:12:51.098800Z

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

3
❤️ 4
ericdallo 2021-02-22T10:54:42.100Z

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

borkdude 2021-02-22T11:57:44.110200Z

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

☝️ 1
ericdallo 2021-02-22T11:59:16.110600Z

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

😍 1
anonimitoraf 2021-02-22T12:03:18.111400Z

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

ericdallo 2021-02-22T12:09:17.111700Z

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

ericdallo 2021-02-22T12:09:23.111900Z

I just wonder what to drop

anonimitoraf 2021-02-22T12:10:59.112100Z

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

ericdallo 2021-02-22T12:11:54.112300Z

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

ericdallo 2021-02-22T12:12:37.112500Z

Emacs is single thread in the end 😅

borkdude 2021-02-22T12:14:16.112700Z

rewrite in clojure

ericdallo 2021-02-22T12:14:22.112900Z

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

anonimitoraf 2021-02-22T12:14:36.113100Z

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)

ericdallo 2021-02-22T12:14:53.113400Z

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

anonimitoraf 2021-02-22T12:15:36.113700Z

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

ericdallo 2021-02-22T12:17:09.113900Z

> 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

anonimitoraf 2021-02-22T12:18:25.114100Z

Right

anonimitoraf 2021-02-22T12:19:49.114400Z

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

borkdude 2021-02-22T12:20:19.114800Z

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

1
2
ericdallo 2021-02-22T12:20:49.115100Z

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

anonimitoraf 2021-02-22T12:21:18.115300Z

Oh right, I see a rust_src dir, yea

ericdallo 2021-02-22T12:21:20.115500Z

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

borkdude 2021-02-22T12:23:21.115900Z

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

borkdude 2021-02-22T12:24:13.116100Z

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

ericdallo 2021-02-22T12:27:30.116300Z

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

ericdallo 2021-02-22T12:29:34.116600Z

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

ericdallo 2021-02-22T12:29:59.116800Z

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

borkdude 2021-02-22T12:35:33.117100Z

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

ericdallo 2021-02-22T12:36:11.117300Z

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

ericdallo 2021-02-22T12:36:19.117500Z

you can check the request/response from logs

borkdude 2021-02-22T12:37:35.117700Z

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

☝️ 2
anonimitoraf 2021-02-22T13:19:41.118Z

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

anonimitoraf 2021-02-22T13:20:18.118500Z

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

ericdallo 2021-02-22T13:22:00.118700Z

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

ericdallo 2021-02-22T13:22:24.118900Z

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

borkdude 2021-02-22T13:23:12.119100Z

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

ericdallo 2021-02-22T13:24:57.119300Z

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

borkdude 2021-02-22T13:25:15.119500Z

right

borkdude 2021-02-22T13:25:18.119700Z

makes sense

danielneal 2021-02-22T15:01:22.121700Z

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?

dharrigan 2021-02-22T15:01:39.121900Z

see above

dharrigan 2021-02-22T15:01:53.122100Z

☝️

danielneal 2021-02-22T15:02:06.122300Z

oh the company-idle-delay? Thanks

ericdallo 2021-02-22T15:02:47.123100Z

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

danielneal 2021-02-22T15:03:58.123400Z

great, thanks 🙂

2021-02-22T18:49:24.124200Z

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

2021-02-22T18:49:45.124300Z

ericdallo 2021-02-22T18:49:46.124900Z

what do you mean exactly?

ericdallo 2021-02-22T18:49:56.125100Z

oh, yes

2021-02-22T18:50:26.125300Z

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

ericdallo 2021-02-22T18:50:36.125500Z

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

ericdallo 2021-02-22T18:50:40.125700Z

https://clojure-lsp.github.io/clojure-lsp/settings/

2021-02-22T18:50:44.126Z

❤️

mikejcusack 2021-02-22T20:46:21.129Z

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.

mikejcusack 2021-02-22T20:56:10.129600Z

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

borkdude 2021-02-23T10:28:36.190600Z

clj-kondo only works with source code, not bytecode

ericdallo 2021-02-23T12:44:55.194700Z

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

borkdude 2021-02-23T12:46:03.195100Z

Is that even legal on projects like datomic?

1
ericdallo 2021-02-23T12:47:01.195400Z

Just the completion I think it is

borkdude 2021-02-23T12:47:15.195600Z

Ask Rich in your company slack ;)

😂 1
ericdallo 2021-02-23T12:47:16.195800Z

actually not sure it's ilegal decompile the class

mikejcusack 2021-02-24T00:35:01.199500Z

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

ericdallo 2021-02-24T00:36:42.199700Z

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

mikejcusack 2021-02-24T00:52:08.201100Z

I couldn't get it to work there either

mikejcusack 2021-02-24T00:52:17.201300Z

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

ericdallo 2021-02-24T00:53:10.201500Z

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

borkdude 2021-02-24T08:00:03.204900Z

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

ericdallo 2021-02-22T21:11:05.129700Z

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

ericdallo 2021-02-22T21:11:17.129900Z

Do you have a minimal repro?

ericdallo 2021-02-22T21:11:31.130100Z

Check the logs if your classpath was scanned properly

NoahTheDuke 2021-02-22T21:26:59.131Z

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

NoahTheDuke 2021-02-22T21:27:20.131500Z

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

ericdallo 2021-02-22T21:27:55.132300Z

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

NoahTheDuke 2021-02-22T21:28:38.132900Z

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

NoahTheDuke 2021-02-22T21:29:40.133100Z

NoahTheDuke 2021-02-22T21:30:34.134400Z

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

mikejcusack 2021-02-22T21:31:22.134500Z

Checked them and there's nothing indicating an issue

ericdallo 2021-02-22T21:32:37.135100Z

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

ericdallo 2021-02-22T21:33:11.135900Z

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

ericdallo 2021-02-22T21:35:00.136200Z

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

ericdallo 2021-02-22T21:35:09.136400Z

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

NoahTheDuke 2021-02-22T21:38:37.136800Z

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

👍 1
mikejcusack 2021-02-22T21:48:19.137Z

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

ericdallo 2021-02-22T21:49:23.137200Z

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?

ericdallo 2021-02-22T21:49:49.137400Z

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

mikejcusack 2021-02-22T21:50:18.137600Z

Right

ericdallo 2021-02-22T21:50:27.137800Z

these are the defaults https://github.com/clojure-lsp/clojure-lsp/blob/master/src/clojure_lsp/crawler.clj#L53-L60

ericdallo 2021-02-22T21:50:50.138100Z

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

mikejcusack 2021-02-22T21:51:31.138300Z

I have

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

mikejcusack 2021-02-22T21:51:55.138500Z

Running that command manually shows the correct path

mikejcusack 2021-02-22T21:52:11.138700Z

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

ericdallo 2021-02-22T21:54:14.138900Z

I see, it looks correct Indeed

ericdallo 2021-02-22T21:54:47.139100Z

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

mikejcusack 2021-02-22T21:59:49.139300Z

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

ericdallo 2021-02-22T22:00:37.139500Z

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

ericdallo 2021-02-22T22:01:00.139700Z

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

ericdallo 2021-02-22T22:01:07.139900Z

probably that's the issue....

mikejcusack 2021-02-22T22:02:40.140100Z

Recreated the sqlite db and no change

mikejcusack 2021-02-22T22:02:53.140300Z

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

ericdallo 2021-02-22T22:03:15.140500Z

that's odd..

ericdallo 2021-02-22T22:03:32.140700Z

Would you mind create a minimal project repro that?

mikejcusack 2021-02-22T22:03:57.140900Z

This project is early on

mikejcusack 2021-02-22T22:04:08.141100Z

I just installed Doom Emacs today

ericdallo 2021-02-22T22:04:18.141300Z

I use doom too

mikejcusack 2021-02-22T22:04:37.141500Z

So how do you include additional aliases?

ericdallo 2021-02-22T22:05:26.141700Z

let me try what you did

mikejcusack 2021-02-22T22:05:35.141900Z

But how do you personally do it?

ericdallo 2021-02-22T22:05:37.142100Z

adding a project-spec to rpoject config

ericdallo 2021-02-22T22:05:46.142300Z

I use on ~/.lsp/config.edn

ericdallo 2021-02-22T22:06:02.142500Z

I don't need to add custom project-specs

mikejcusack 2021-02-22T22:06:03.142700Z

So how do you handle per-project aliases?

mikejcusack 2021-02-22T22:06:32.142900Z

You include dev deps with prod deps?

ericdallo 2021-02-22T22:06:33.143100Z

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

ericdallo 2021-02-22T22:09:43.143300Z

Could you share your dev alias?

mikejcusack 2021-02-22T22:12:52.143500Z

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

👀 1
ericdallo 2021-02-22T22:15:12.144Z

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

ericdallo 2021-02-22T22:15:16.144200Z

I'll test with that

mikejcusack 2021-02-22T22:15:17.144400Z

Right

mikejcusack 2021-02-22T22:19:24.144600Z

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

ericdallo 2021-02-22T22:21:30.144800Z

It works for me

ericdallo 2021-02-22T22:21:39.145Z

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

ericdallo 2021-02-22T22:21:51.145200Z

so your problem is something else not right

mikejcusack 2021-02-22T22:22:10.145400Z

What is your config?

ericdallo 2021-02-22T22:22:18.145600Z

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

ericdallo 2021-02-22T22:22:45.145800Z

sample-project/.lsp/config.edn

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

ericdallo 2021-02-22T22:23:01.146Z

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

ericdallo 2021-02-22T22:23:28.146200Z

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

ericdallo 2021-02-22T22:24:05.146400Z

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

ericdallo 2021-02-22T22:24:31.146600Z

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

mikejcusack 2021-02-22T22:28:21.146800Z

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

ericdallo 2021-02-22T22:28:30.147100Z

oh, that odd

ericdallo 2021-02-22T22:28:39.147300Z

what's your clojure --version ?

mikejcusack 2021-02-22T22:29:05.147500Z

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

mikejcusack 2021-02-22T22:29:11.147700Z

1.10.2

ericdallo 2021-02-22T22:29:23.147900Z

sorry, clojure-lsp --version

mikejcusack 2021-02-22T22:29:53.148100Z

2021.02.21-21.02.51

ericdallo 2021-02-22T22:30:48.148300Z

your project should contain a .clj-kondo folder

ericdallo 2021-02-22T22:31:05.148500Z

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

ericdallo 2021-02-22T22:31:17.148700Z

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

mikejcusack 2021-02-22T22:31:25.148900Z

Doesn't exist

ericdallo 2021-02-22T22:31:34.149100Z

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

mikejcusack 2021-02-22T22:31:53.149300Z

Nope

ericdallo 2021-02-22T22:32:00.149500Z

damm, that's really odd

ericdallo 2021-02-22T22:32:33.149700Z

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

mikejcusack 2021-02-22T22:32:46.149900Z

Type out the FQDN and autocomplete doesn't work

mikejcusack 2021-02-22T22:33:23.150100Z

So like clojure.tools.namespace.repl

ericdallo 2021-02-22T22:33:45.150300Z

ohhh I see

ericdallo 2021-02-22T22:34:01.150500Z

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

mikejcusack 2021-02-22T22:34:55.150700Z

.repl/, but yes

ericdallo 2021-02-22T22:35:06.150900Z

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 🙂

mikejcusack 2021-02-22T22:35:36.151100Z

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

mikejcusack 2021-02-22T22:35:48.151300Z

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

mikejcusack 2021-02-22T22:36:00.151500Z

But the code itself runs normal

ericdallo 2021-02-22T22:36:11.151700Z

what is the dev-local?

ericdallo 2021-02-22T22:36:30.151900Z

the deps on your dev alias, right?

mikejcusack 2021-02-22T22:36:44.152100Z

com.datomic/dev-local

ericdallo 2021-02-22T22:36:56.152300Z

let me try that one

mikejcusack 2021-02-22T22:37:36.152500Z

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

ericdallo 2021-02-22T22:37:38.152700Z

BTW, is your code on dev or src folder?

ericdallo 2021-02-22T22:37:54.152900Z

hum, I thought it was public

mikejcusack 2021-02-22T22:37:56.153100Z

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

mikejcusack 2021-02-22T22:38:10.153300Z

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

ericdallo 2021-02-22T22:38:41.153500Z

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

mikejcusack 2021-02-22T22:38:48.153700Z

Yes

ericdallo 2021-02-22T22:38:53.153900Z

we use a default source-paths of src and test

ericdallo 2021-02-22T22:39:05.154100Z

I mean, clojure-lsp source-paths

mikejcusack 2021-02-22T22:39:25.154300Z

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

👍 1
ericdallo 2021-02-22T22:40:19.154700Z

so only that datomic deps is not working

ericdallo 2021-02-22T22:40:32.154900Z

but the clojure.tools.namespace work?

mikejcusack 2021-02-22T22:40:51.155100Z

yes

mikejcusack 2021-02-22T22:41:06.155300Z

What disables being able to insert spaces?

ericdallo 2021-02-22T22:41:09.155500Z

probably clj-kondo is not scanning correctly that deps so

ericdallo 2021-02-22T22:41:58.155700Z

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

ericdallo 2021-02-22T22:42:14.155900Z

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

mikejcusack 2021-02-22T22:42:16.156100Z

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

mikejcusack 2021-02-22T22:42:26.156300Z

I have clj-kondo installed

ericdallo 2021-02-22T22:42:30.156500Z

any permission issue with your project folder?

mikejcusack 2021-02-22T22:42:35.156700Z

nope

ericdallo 2021-02-22T22:42:48.156900Z

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

ericdallo 2021-02-22T22:43:06.157100Z

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

ericdallo 2021-02-22T22:43:12.157300Z

if you change the cache-dir manually

mikejcusack 2021-02-22T22:47:10.157500Z

I uninstalled the system clj-kondo and no difference

ericdallo 2021-02-22T22:48:07.157700Z

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

ericdallo 2021-02-22T22:48:15.157900Z

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

mikejcusack 2021-02-22T22:48:21.158100Z

That file doesn't exist either

ericdallo 2021-02-22T22:48:47.158300Z

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

mikejcusack 2021-02-22T22:49:00.158500Z

Nope

ericdallo 2021-02-22T22:49:56.158700Z

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

ericdallo 2021-02-22T22:50:05.158900Z

Also I created this: https://github.com/clojure-lsp/clojure-lsp/issues/337

👍 1
mikejcusack 2021-02-22T23:06:12.159300Z

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

ericdallo 2021-02-22T23:06:40.159500Z

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

mikejcusack 2021-02-22T23:06:51.159700Z

yes

mikejcusack 2021-02-22T23:07:06.159900Z

lsp is working for deps other than dev-local

ericdallo 2021-02-22T23:07:09.160100Z

It could be a permission issue with your pc

mikejcusack 2021-02-22T23:07:20.160300Z

Nah

mikejcusack 2021-02-22T23:07:31.160500Z

It works fine in Cursive

ericdallo 2021-02-22T23:08:43.160700Z

yeah, really weird

mikejcusack 2021-02-22T23:08:53.160900Z

Including autocompleting dev-local

mikejcusack 2021-02-22T23:09:19.161100Z

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

ericdallo 2021-02-22T23:09:58.161300Z

Normally it works, your case really looks a corner case

mikejcusack 2021-02-22T23:10:31.161500Z

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

ericdallo 2021-02-22T23:11:24.161700Z

Why inconsistent?

mikejcusack 2021-02-22T23:11:41.162Z

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

ericdallo 2021-02-22T23:12:16.162200Z

It could be a clj-kondo issue

mikejcusack 2021-02-22T23:12:23.162400Z

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

ericdallo 2021-02-22T23:12:49.162600Z

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

mikejcusack 2021-02-22T23:12:51.162800Z

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

mikejcusack 2021-02-22T23:13:08.163Z

Exactly. And it does show up in the -Spath

mikejcusack 2021-02-22T23:13:22.163200Z

And Cursive reads it fine

mikejcusack 2021-02-22T23:16:09.163400Z

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

ericdallo 2021-02-22T23:18:07.163600Z

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

mikejcusack 2021-02-22T23:19:01.163800Z

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

mikejcusack 2021-02-22T23:20:03.164Z

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

mikejcusack 2021-02-22T23:20:13.164200Z

None of my other deps have one to test

mikejcusack 2021-02-22T23:20:36.164400Z

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

mikejcusack 2021-02-22T23:20:45.164600Z

And that one autocompletes and goes to definition

mikejcusack 2021-02-22T23:23:33.164800Z

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

mikejcusack 2021-02-22T23:23:40.165Z

So you can pull that and test

ericdallo 2021-02-22T23:24:10.165200Z

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

👍 1
mikejcusack 2021-02-22T23:29:38.165500Z

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

ericdallo 2021-02-22T23:41:10.165700Z

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