Fork me on GitHub
#cursive
<
2021-09-23
>
kenny18:09:36

The power at my house dropped in the middle of a rebase and left my .git in a completely broken state. I just recloned my monorepo and opened it up and now the project looks totally different. Previously, my Project view in IntelliJ would show the monorepo root folder, all files within it, and and our projects folder which contains many Clojure Deps projects. Now, after reopening the project, all of the projects in the projects directory are displayed at the top level and the root directory is displayed at the very bottom, highlighted in brown. For the life of me, I cannot figure out how to get IntellliJ to recognize the top level monorepo directory as where the project starts. Does anyone here have any ideas?

Jeff Evans18:09:40

using deps.edn?

Jeff Evans18:09:12

my guess is you need to right click the topmost one, and Add as Deps Project

Jeff Evans18:09:31

I have this happen often when switching between branches where we converted from lein->deps

imre19:09:07

you might be able to "import project from existing sources", target the root of your monorepo, go through the import wizard

imre19:09:19

saved my arse and sanity a few times

kenny00:09:41

Just following up here. What worked for me was cloning the project and renaming the .idea directory temporarily. We commit .idea/clojure-deps.xml and .idea/ClojureProjectResolveSettings.xml to VCS. I then open the root directory via File > Open and finally move the two files into the newly created .idea directory. Quite the hassle. @U0567Q30W any idea why this works in this manner?

Eddie22:09:24

I’m considering adding a couple vars in my project that will be dynamically created at load-time via a macro. My understanding is that “stubs” are the only way for Cursive to recognize these vars. I understand from the docs that automatic stub generation is limited to a hard-coded set of namespaces, but is there a way to just manually write/specify some static stubs?