lsp

2025-01-13T20:09:45.508469Z

i've started a new job that uses a monorepo. they have a root project.clj that merely holds the :repositories and :managed-dependencies, while each directory has a project-specific project.clj that uses :parent-project {:path "../project.clj" :inherit [:repositories :managed-dependencies]}. clojure-lsp is struggling to understand that i'm opening a specific project, and doesn't build the classpath correctly. running lein classpath in each project directory displays the correct classpath, and clj-kondo --lint $(lein classpath) seems to work correctly. i've never worked in an environment like this, so how do i get clojure-lsp to understand?

ericdallo 2025-01-13T20:12:48.315439Z

my suggestion would be to open the monorepo root, where things should work as expected

ericdallo 2025-01-13T20:14:03.922499Z

but if lein classpath works, I can't see why wouldn't work as well

2025-01-13T20:16:53.481799Z

is there a way to debug this?

2025-01-13T20:19:17.778389Z

i thought the parent stuff was built-in but it's actually from this plugin https://github.com/achin/lein-parent

ericdallo 2025-01-13T20:45:20.051389Z

I wanna improve this kind of debug support soon, but the logs should tell what we need to know, it logs the classpath found, try rm -rf .lsp/.cache and check the server logs

2025-01-13T20:50:33.857369Z

i used server-info to see what clojure-lsp is doing, and it's showing :project-root-uri "file:///Users/nbogart/work/rn-v3", which is the root folder, not the current project folder

ericdallo 2025-01-13T20:51:14.380009Z

so your editor imported that

ericdallo 2025-01-13T20:51:35.986569Z

the project-uri is something that the client sends to server, usually asking to user the first time it's opened

ericdallo 2025-01-13T20:51:44.252109Z

i have no idea how vim handles that though

2025-01-13T20:52:03.785309Z

hmm okay

2025-01-13T20:52:11.807669Z

dang, i'll see if i can modify that, then