lsp

István Karaszi 2026-06-03T07:56:56.178359Z

Polylith setup in a subdirectory

István Karaszi 2026-06-03T07:57:55.721949Z

In our project we have a Polylith setup but in a subdirectory not in the repository root. The reason is because the project is a monorepo and has a lot of other projects as well, not just in languages that is supported by Polylith

❤️ 1
István Karaszi 2026-06-03T07:58:42.977349Z

I've moved the .lsp folder to the backend folder where our Polylith setup is, but the CPU usage went 100% and I've checked the logs and it was reading the wrong directory

István Karaszi 2026-06-03T07:59:02.390269Z

Tried to move back the .lsp settings to the repository root, now it can read it but the CPU usage is still 100%

ericdallo 2026-06-03T11:18:10.930759Z

what's the workspace root you are using in your editor? What looks like your case when using tree to make sure I understand

István Karaszi 2026-06-03T14:09:11.224509Z

I believe I found a solution, I needed to add the following to the .dir-locals.el:

(eval . (when (require 'lsp-mode nil t)
            (lsp-workspace-folders-add
             (expand-file-name
              (locate-dominating-file default-directory ".dir-locals.el")))))

ericdallo 2026-06-03T14:12:07.023609Z

not sure why that works but glad it did 😅

István Karaszi 2026-06-03T14:13:18.084319Z

It helps setting the :project-root-uri to the right folder