This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-27
Channels
- # babashka (45)
- # beginners (44)
- # calva (3)
- # cider (14)
- # clara (4)
- # clj-commons (3)
- # clj-otel (4)
- # cljsjs (1)
- # cljsrn (111)
- # clojars (5)
- # clojure (62)
- # clojure-europe (14)
- # clojure-nl (2)
- # clojure-uk (4)
- # clojurescript (31)
- # community-development (16)
- # conjure (7)
- # cursive (9)
- # data-science (1)
- # datalevin (10)
- # docker (1)
- # emacs (20)
- # fulcro (7)
- # helix (10)
- # jobs (4)
- # lsp (22)
- # malli (35)
- # meander (12)
- # music (1)
- # nbb (2)
- # off-topic (5)
- # pathom (3)
- # quil (1)
- # re-frame (12)
- # react (6)
- # reagent (18)
- # releases (1)
- # remote-jobs (1)
- # rewrite-clj (4)
- # ring (1)
- # shadow-cljs (10)
- # spacemacs (9)
- # tools-build (17)
I have a big, big git repo with multiple Clojure projects. Is there a way to make projectile and clojure-lsp aware of the individual (sub) projects? Right now both use the root of the git repository as project root and that messes many things up. I found some documentation about how projectile discovers projects but it's not obvious how to configure it. My google-fu is failing me, and what I'm finding is not really helpful 😢
you can put a .projectile
file at the root of your subproject. For lsp it worked out of the box for me, my sub projects all have a project.clj
file
I'd rather not store any special files in the repo, other people on my team use different editors - I thought project auto discovery can be configured somehow
i think the git repo takes priority, but maybe it's configurable. Also you can just add the .projectile file to your global gitignore
Yeah, that could work. I've seen that that docs page and suggested changes didn't seem to work, but it might have been me doing something wrong - I'll give it another shot :thumbsup:
even if you swaitch projectile-root-bottom-up
and projectile-root-top-down
? what's your "project specific file" ?
fixing projectile is not enough if you have lsp-mode thinking your project root is still the mono-repo root, so you need to do this ☝️
90% of it is project.clj
rest would be either package.json or Gemfile - all of them are part of projectile's default setup.
And yeah, the order is (projectile-root-bottom-up projectile-root-local ...top-down....)
I'll try the .projectile
file approach
@UKFSJSM38 ah, I didn't realize that lsp doesn't rely on projectile, then again - wouldn't it scan for project.clj in the same fashion as projectile?
lsp-mode always guess the project root and prompt with a suggestion, but you can manually choose a different folder
Must be something about my config because I only see a warning about 4000+ files being indexed :-)
you may have misread the doc: in your case you'd want projectile-root-local projectile-root-top-down projectile-root-bottom-up projectile-root-top-down-recurring
but this may not play well with some other projects, so i'd use .dir-locals
or .projectile
anyway
@U02F0C62TC1 ok, that did it for me, at least wrt projectile itself. Thanks!
I also have this problem in monorepos. I wrote up my solution, using way too many words, here: https://www.cfclrk.com/articles/projectile_root.html. I’d be interested in better ways to do this.