Losing setting for content root when closing project

My content root setting changes keep being lost and reverted to the original settings when I close my project.
Is this an issue other people have had or is there something silly I may be using.

I simply go to
File
Settings
Directories
Delete the original content rootl
Add the new content root.
Click Apply
Click Save.

Howver whenever I close the project the settings are lost.

9 comments
Comment actions Permalink

I'm having this issue currently. Super frustrating.

0
Comment actions Permalink

Please open File | Settings (Preferences on Mac) | PHP | Composer and remove "Synchronize IDE settings with composer.json" checkbox

 

0
Comment actions Permalink

 

I don't see an option for PHP in my settings

0
Comment actions Permalink

@Travis Barton

I don't see an option for PHP in my settings

To me this means that you are not using latest 2021.1.2 version (unless it's different on Mac).

Anyway: check for PHP under "Languages & Frameworks" node then

1
Comment actions Permalink

 

I don't see it there either, unfortunately. 

0
Comment actions Permalink

@Travis Barton

1) What's your IDE and version? Your screenshot does not look like PhpStorm to me. More like PyCharm ... or maybe IntelliJ IDEA (less likely).

If this is not PHP / PhpStorm then this better be reported in the correct product forum (I believe JB support can move threads between product forums; if not -- you will need to make a new thread in the correct forum).

PHP plugin can only be used in PhpStorm (bundled, not even listed on Plugins screen) or in IntelliJ IDEA Ultimate (just as any other language; so can be disabled)

2) The suggestion that Dmitry gave is about PHP and sync certain settings with composer.json file.

TBH -- he may gave you the wrong suggestion in the first place. As I understand from your initial description you are having issues with loosing the whole Content Root entry .. and not about folders marked as Sources/Tests (where that composer.json sync option may help). EDIT: Actually the first message in this thread is from another person, so I'm wrong here.

1
Comment actions Permalink

Ahhh I made a mistake, this is indeed pycharm not PHPstorm. My bad! My issue is that my python path and sources get deleted every time I close pycharm. 

0
Comment actions Permalink

@Travis Barton

Try this:

1. Close all projects so that you are on the Welcome screen

2. Locate that project and delete from there (right click .. or hover over and click on "X" icon)

3. Close IDE completely

4. Go to that project folder and remove ".idea" subfolder (this project settings). You can make a back up just in case.

5. Launch IDE, use "Open" and point to the project root folder -- IDE will create a new project from existing files. Configure as needed (do a minimal config first). Restart IDE and see if it gets saved this time.

That's if those settings are project specific.

Perhaps your project config is somehow corrupted. Or some folder permission issue. Might be something else as well (hard to tell without knowing the whole story) -- e.g. you're changing branches and .idea folder is under VCS as well (and such changes got overwritten at some point).

0
Comment actions Permalink

Столкнулся с такой же проблемой (при открытии проекта сбрасывались настройки Directories).

Причина:

В названии проекта (File - Rename Project) я использовал "ZZZ / test.loc" (символ "/" с пробелами вокруг него).
Из-за этого эта настройка сохранялась в подпапку.
В файле modules.xml путь к этому файлу сохранялся как "$PROJECT_DIR$/.idea/ZZZ / test.loc.iml" и, возможно, из-за этого PhpStorm не мог его открыть?

Проблему решил так:
1. Изменил в ручную путь в modules.xml на "$PROJECT_DIR$/.idea/test.loc.iml"
2. Перенес файл из папки "ZZZ" в папку ".idea"
3. Удалил папку "ZZZ"

П.С.
Пункт 2 можно пропустить, только тогда придется заново внести данные в Directories.

0

Please sign in to leave a comment.