How do I add files to a project?
Hi
I can see how to add directories to a project, however when I refactor on a file in a different directory that is in the project it says
"Cannot perform refactoring. Selected Parameter is not located inside project."
Do I have to setup a VSC to make this happen?
If so are there any out there that are private and free that work with PhpStorm?
Thanks
请先登录再写评论。
Hi there,
I'm not sure that I understood you here.
In any case: you can make any folder as part of the project (so it will be treated as original project folder) by adding it as Additional Content Root ("Settings (Preferences on Mac) | Project | Directories").
Adding individual files this way is not possible .. unless you put it into a separate folder and add it.
If you add it via another way (e.g. as "PHP Include path" in "Settings | Languages & Frameworks | PHP") then it will be added as partially limited resource (especially in regards of refactoring) as adding stuff this way is meant for reference purposes only (e.g. code completion).
What is VSC? I assume you meant to say "VCS -- Version Control System". If so -- no as it has nothing to do with IDE's ability to perform code refactoring.
PhpStorm supports all major VCS out of the box: git/mercurial/subversion/etc. If not -- check if corresponding plugin is enabled. For additional VCSs -- check & install additional plugins.
Thanks Andriy,
Additional Root Content solved it.
Wanted to check answered, however I first checked helpful instead and once done could not seem to go back to change it.
Regards,
Glenn
Setting->Projct->Project Structure, and add your root content (files) into the project. Hope it can help. :-)
I see the DIRECTORIES option in the PREFERENCES section but its unclear how to add the main system folder to it. (screenshot)
To get to this point, I've checked the code out from a revision system and included it in the include path. The problem I'm trying to solve is when I do a broad search cmd+shift+F no results appear under the IN PROJECT tab, they only show up on the SCOPE -> ALL PLACES section.
How to get the main project files directory to show up in the PROJECT selection? Thanks.
--edit--
Found the answer here:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/207066915-Project-view-not-showing-directories
Andriy Bazanov - ".... backup and delete .idea subfolder ...."
Thanks Andriy.