cursive-ide / cursive

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

Opening a project from a symlinked directory causes module duplication #205

Open kornysietsma opened 10 years ago

kornysietsma commented 10 years ago

If I have a valid clojure project in ~/Dropbox/prj/foo/ and I have a symlink from ~/prj to ~/Dropbox/prj (this is on OSX) and I open the project from the path ~/prj/foo

Then the project opens with two identical "foo" modules - one referring to ~/Dropbox/prj/foo and one referring to ~/prj/foo. It appears this happens when the Leiningen project gets synchronised - somehow it resolves the actual path of the project, or the project.clj file or something.

Needless to say this causes some strange behaviour!

If I open the project from the real path of ~/Dropbox/prj/foo everything seems to work, which gives me a workaround for now.

cursive-ide commented 10 years ago

Hmm, I see - that is strange. I suspect that this is due to the checkout dependencies functionality - in that case, I actually need the real path. I'll see if I can come up with a decent heuristic for when to fully resolve symlinks.

conan commented 8 years ago

I have what may (or may not) be a similar issue on Windows. I use checkouts, and always end up with duplicate modules of the project I've pointed to in my checkouts, one with its real path and one with the path going via my junction or symlink, for example C:\Users\Conan\dev\my-library and C:\Users\Conan\dev\my-app\checkouts\my-library.

If this is a different problem then I'll open a new ticket.

Latest everything, Windows 10

d-t-w commented 8 years ago

Thanks for raising this ticket, it's the root cause of a minor annoyance I had (was about to raise a ticket myself). OSX; symlinked directory; duplicate root level files displayed in Project tab:

screen shot 2016-03-21 at 10 14 45 am

Using non-symlink path is a perfectly fine work-around, useful to know.

alexandercurtis commented 6 years ago

FWIW I am also seeing this problem, but since upgrading to Idea 2017.2.6 (build IU-172.4574.11) (from 2016.x) the behaviour has changed. The duplicates in the project tree are gone, but now Cursive is unable to resolve any symbols (including clojure.core symbols).

The workaround of opening the 'real' path still works though.

Cursive version 1.6.1-2017.2. Linux OS.