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

2 comments
Comment actions Permalink

Hi there,

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."

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).

Do I have to setup a VSC to make this happen?

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.

If so are there any out there that are private and free that work with PhpStorm?

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.

0
Comment actions Permalink

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

0

Please sign in to leave a comment.