Is there a reason that CLion expands/replaces links in project paths?
I am using CLion 2022.1.1 on Slackware 15.0. My makefile project lives in /linux/maint/src. This is the path that shows at the top of the tree when I select 'Project', 'Project Files', or 'Project Source Files'. The problem arises because /linux is a link to /autofs/vorlich/linux. The directory is automounted from vorlich (a server), not hard mounted.
All of the individual project source files (package.c or list.c for eg) show as being in /linux/maint/src.
But CLion also shows several other source files as being in the project. These other files are located in /autofs/vorlich/linux/maint/src. Not all of the source files, but several (package.c is not there, but list.c is). Both list.c files are actually the same file.
I have never used any of the /autofs paths to reference any of the files in the project. As far as I am concerned, all files live in /linux/maint/src.
So, first question: Why does CLion replace links in the file paths? I really do not believe that the solution here is for me to define the project as living in /autofs/vorlich/linux. I (as a user) should never have to be aware of where the admins place the software for the project. I should not have to perform strange magic should they ever move it from vorlich to some other server.
Second question: Why only some of the files? If package.c is in the project, why does it only show in /linux/... and not in /autofs/...?
Weird behavior that this causes:
1. I am in the editor looking at the file /linux/maint/src/package.c. I select a method reference for a method defined in package.c, and do a right-click->Go To->Definition. CLion will actually open the /autofs/vorlich/linux/maint/src/package.c. Why? I now have the file open twice...
2. I am in the editor, looking at /linux/maint/src/package.c, and I refactor/rename the method from above. I will soon get a warning that someone else made a change to /autofs/vorlich/linux/maint/src/package.c and it wants to know if I want to reload from disk, memory, or whatnot. The only thing making changes to the files is CLion, but it is not recognizing that it is doing it.
Third question: Is there some way of removing the /autofs/... versions of the file? Would this help? I tried File->Delete, but that didn't work. CLion deleted both files. When I reloaded the /linux/... version, both came back.
Any ideas appreciated.
Please sign in to leave a comment.
Hello!
CLion has several issues with symlinks, unfortunately: https://youtrack.jetbrains.com/issue/CPP-15438 and the related issues. Feel free to comment or upvote the issues. See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.
Sorry for the inconvenience.