lsp 2024-11-05

Hey hey, I am working on a project where some code actions do not work for me but for other people (both using lsp through emacs). An example being: suggesting import statements for Java classes. Is there some way how to best debug this?

probably only java classes import code actions are the ones affected, they rely on the https://clojure-lsp.io/settings/#java-support

take a look at that doc, if you think your JDK is correct, try removing the global cache and restarting clojure-lsp: rm -rf ~/.cache/clojure-lsp

ok, remove the local cache as well .lsp/.cache of the project, restart clojure-lsp, and check the server logs if jdk is being analyzed.

Also removed the local cache

Is that *lsp-log* I should be looking at?

Ok found it

2024-11-05T12:25:41.763Z  WARN [clojure-lsp.feature.java-interop:292] - [Java] Skipping download JDK source, setting `:java :download-jdk-source?` is disabled.
2024-11-05T12:25:41.763Z  WARN [clojure-lsp.feature.java-interop:303] - [Java] JDK source not found, skipping java analysis.

yep, so you have options to set the jdk location or understand why it's not finding it automatically

If it doesn't find the JDK it turns off all suggestions for java classes?

no, only jdk classes

what java class you are trying to import?

RootAllocator from [org.apache.arrow.memory RootAllocator]

That works for the colleague but not for me.

hum, if it's on the classpath clojure-lsp should be aware of it sending clj-kondo to analyze that

could you try adding that dep to a sample project like https://github.com/ericdallo/clojure-sample and check if it works there?

Will do. 🙏 for your time

👍 1

let me try

seems to be working for me 🤔

I only get Create private function ...

are you sure you are using latest clojure-lsp version?

:server-version "2024.08.05-18.16.00"

Ok, so after latest changes UUID works but RootAllocator still doesn't

Maybe it's some weird classpath issue ...

UUID is from jdk, so not exactly the same way it's analyzed