Home > front end >  Show a folder in tree which is not inside the project in PhpStorm
Show a folder in tree which is not inside the project in PhpStorm

Time:11-23

I have a project which share a folder with other project

- Project 1
  -- Project 1 code
- Project 2
  -- Project 2 code
- Shared folder
  -- uploaded file from project 1 and project 2

I only open my current working project in PhpStorm, because opening both of them makes my computer sounds like an helicopter... but I'd like to keep the shared folder open in my current project (without adding it inside my current project), to avoid to have to switch between PhpStorm and my explorer.

Is it possible? Can't find the answer on IntelliJ doc.

CodePudding user response:

All screenshots are from PhpStorm 2022.2. IntelliJ IDEA has a more complex project setup so it will be a bit different, but overall it is the same.

Just add such extra folder as an Additional Content Root at Settings (Preferences on macOS) | Directories.

Folders added this way will be treated as a part of the project itself (indexing / inspections / refactoring / searching etc.) and will be displayed as a separate node in the Project View panel.

  • enter image description here


    If you want to reference it rather in Read-Only manner (as if it's a 3rd party code/library that you do not need to modify) then reference it as a PHP Include Path (if it's a PHP code of course).

    It will be listed in the Project View under "External Libraries" node.

    • enter image description here

  • Related