Fork me on GitHub
#lsp
<
2021-11-27
>
ericdallo23:11:44

interesting, and are you already using kondo with that?

Lukas Domagala23:11:20

the thing i’m currently working on is a run-with-deeptrace macro that takes your function call and instruments every function that could be called. it’s using clj-kondo analysis to get the dependents of each function so i know what to trace

Lukas Domagala23:11:30

i’m still thinking about building a version that takes that information from nrepl instead, but its easier to do with kondo for now

ericdallo23:11:50

ATM clojure-lsp scan the project and save analysis to a atom while running but it persists the external kondo analysis on datalevin ~/.lsp/.cache

ericdallo23:11:24

the issue is that your lib would need to call clojure-lsp manually, as they are not related and clojure-lsp runs as a process externally usually on the editor

Lukas Domagala23:11:49

you don’t have any communication layer currently, so it doesn’t talk to calva and back?

ericdallo23:11:14

yes it has, via stdin/out

ericdallo00:11:03

I can't see how you lib running in user's repl would access the proccess running, you know

Lukas Domagala00:11:21

ah ok, sharing kondo analysis maps through that would be very hacky, yeah

ericdallo00:11:04

yeah, if calva needs that, it's easy to provide as it's the client that is communicating with clojure-lsp

Lukas Domagala00:11:10

but i’ll check if accessing the data.mdb file is easy, haven’t looked into datalevin yet

ericdallo00:11:20

yeah, that would work

ericdallo00:11:05

but, note that we only save to datalevin external analysis, analysis related to project's jars, as the project source analysis we always analyze during startup and do not cache to avoid outdated analysis

Lukas Domagala00:11:12

btw i’m thinking of having parts of the lib as a vscode plugin so you can just press hotkeys instead of wraping stuff with function calls. would that make the communication easier?

ericdallo00:11:35

we could save in another datalevin table though, it could work

Lukas Domagala00:11:37

what do you mean by external?

ericdallo00:11:07

external == analysis that are not related with user's code, like analysis of project's deps jars

Lukas Domagala00:11:29

ah ok, well that’s probably the bigger part anyway, but yeah i of course wouldn’t mind if you also exported the project analysis. looking into datalevin right now:)

Lukas Domagala00:11:52

although i’m seeing that datalevin has a lot of dependencys, not sure i want that many more on a dev time lib that needs to be compatible with peoples versions of stuff

ericdallo00:11:53

If you intend to ready query the datalevin I think we can export that as well, note that project analysis could be outdated after startup as user may edit things

ericdallo00:11:06

Yeah, good point

Lukas Domagala00:11:32

i’ll play around with it, but it’s good to know that it’s kind of possible to get access if i realize that running kondo myself gets to slow. thanks for the support

👍 1
Lukas Domagala01:11:25

mhh, just remembered that kondo has its own cache, but running it with :cache true and false makes 0 difference. you don’t happen to know what the problem might be?

ericdallo01:11:53

kondo cache is used by kondo to "know" other namespaces during linting, I don't think it should help you