Including folders in a project but not indexing them

Hi,

I have read the help files here (http://www.jetbrains.com/phpstorm/webhelp/configuring-project-structure.html ) but unfortunately still cannot figure out how to visibly include folders in my project that are also marked as excluded (so that they are not indexed and errors are not brought to my attention, etc). If I do mark a folder as excluded, it disappears from the folders listed in my project, and so I cannot access it or alter those files easily from within the IDE.

5 comments
Comment actions Permalink

It might help if I describe my usage scenario just in case there is a workaround.

I want to include a series of folders and their files in my project. I often use this folder as a code base - files for references and to run immediate programming tests to see how things function or would work. It also includes a code base I have previously built and I use the pieces of the code base in various projects. I want these file to be syntatically highlighted, but I dont want to know about errors in them.

I do not know if it is possible, but I would like to have class names and lookups in this folder resolve to only classes and names in this folder (recursively). That way phpstorm doesn't ask me everytime I want to go to a class in my actual project if I want to go to the class in my code base with the same name. If that isn't possible, I would prefer that phpstorm not even use the classes in the code base folder so I am not asked each time if I want to go to the class in my code base or the class in my actual project.

Thanks for any help here.

0
Comment actions Permalink

Hi there,

If those files are located OUTSIDE of the project folder (they can .. since they are "previously built" and, as I understand, not used directly) then you just include them as External Library (Settings | PHP | Include path).

If those files are INSIDE the project folder (and have to stay there)... then you can try this, but I'm not 100% sure if it will work (have not tried this myself as I have no such need -- I can organize my code better than all-in-one and keep old code separately from current project):

  • exclude folder
  • .. and then add it as external library (Settings | PHP).

I do not know if it is possible, but I would like to have class names and lookups in this folder resolve to only classes and names in this folder (recursively).

All classes/global functions/etc must be unique within project. If this is not the case then IDE will have to ask what file/class to work with (it cannot read your mind in regards to "what exactly do you want at this moment").

You can resolve this by having 2 separate projects and switch between them (Alt+Tab)

0
Comment actions Permalink

Thanks Andriy. That seemed to work.

I will look at your alt-tab approach. Do you just mean you open projects in different windows and switch between them, or is there a way to open multiple projects in the same window? I notice on the left side there is a vertical bar and that one tab is labled "project" - could other projects be included on this bar?

0
Comment actions Permalink
Do you just mean you open projects in different windows and switch between them,

Yes.

or is there a way to open multiple projects in the same window?

This is not currently implemented ( http://youtrack.jetbrains.com/issue/WI-15187 ) ... and even if it will, there is still a chance (depends on how devs will implement this, of course) that it will still behave in the same way regarding the classes with the same names. But what's the point of guessing -- let's wait until it will get implemented.

In any case -- even right now you can kind of open multiple projects in the same frame (Settings | Directories --> Add Content Root) .. but the "choose declaration to go to" issue will remain (as well as checking for errors etc) as that 2nd folder/project will be part of the main project. External libraries or separate projects, on another hand, are separated:

  • External Library has checking for errors disabled as well as not included when searching for TODOs/refactoring code/etc
  • Separate project is even better -- it is completely separate instance and has it's own configuration.



Interesting tickets to watch after (subscribe (star/vote/comment) to get notified on progress/when implemented):

0
Comment actions Permalink

Thanks again - I will keep an eye on those tickets. I hope something like this is implemented.

0

Please sign in to leave a comment.