cursive-ide / cursive

Cursive: The IDE for beautiful Clojure code
588 stars 7 forks source link

resolving "deep" extra-paths #2560

Open takaczapka opened 3 years ago

takaczapka commented 3 years ago

Hi,

We've got a multi-module project (a monorepo really) where top deps.edn file contains definition of all extra paths required (ie. for testing). The problem is that Cursive can't resolve extra paths (using "Aliases" checkbox) which point to directory tree deeper than 1. In other words :extra-paths ["dev"] works ok, while :extra-paths ["module/dev"] does not, hence in IntelliJ it won't appear as a source/test folder.

Here's the example alias we use:

:aliases {
  :module-test {
    :extra-paths ["core/test" "core/resources"
                           "module/test" "module/test-resources"
                           "module/dev"]}}
cursive-ide commented 3 years ago

I can't reproduce this. Here's an example project setup:

Screen Shot 2021-10-28 at 13 50 22

Here the two folders are marked as source roots in the project view. Is there something else about your project that might cause this?

skoestler commented 2 years ago

I'm seeing this with a project using the following directory structure, which is inspired by the luminus template.

├── deps.edn
├── env
│   ├── dev
│   │   └── clj
│   │       └── user.clj
│   ├── prod
│   │   └── clj
│   │       └── user.clj
│   └── test
│       └── clj
│           └── user.clj
├── resources
│   └── sql
├── scaffold.iml
├── src
│   └── clj
│       └── app.clj
└── test
    └── clj
        └── app_test.clj

and the following in my deps.edn

{:paths   ["src/clj" "classes" "resources"]
 :deps    {org.clojure/clojure {:mvn/version "1.10.2"}}
 :aliases {:dev  {:extra-paths ["env/dev/clj" "env/dev/resources"]}
           :test {:extra-paths ["env/test/clj" "env/test/resources" "test/clj"]}
           :prod {:extra-paths ["env/prod/clj" "env/prod/resources"]}}}

Additionally, I can mark env/dev/clj as a source root but that gets reset every time I import changes from my deps.edn.

Here's the repo for my example https://github.com/skoestler/scaffold.