BenMorel
BenMorel

Reputation: 36514

How to attach a project without mixing class declarations in PhpStorm?

I like PhpStorm's ability to attach multiple projects to the current window:

enter image description here

I've noticed, however, that all classes declared in both projects are available in both projects, which can lead to duplicate declarations:

enter image description here

I understand how this can be useful at times, however I'd like to attach projects just to navigate easily between them (I prefer this to switching windows), while keeping them separate as if they were in separate windows.

Is this possible?

Upvotes: 0

Views: 151

Answers (1)

LazyOne
LazyOne

Reputation: 165168

Currently IDE does not have "scoped indexing" that may be able to resolve this. Right now you would need to exclude such duplicate files or tell IDE to not to treat them as PHP so they do not get indexed as such.

Your current options:

  • Use Mark Directory As | Excluded via context menu in Project View panel (or manually via Settings (Preferences on macOS) | Directories) for a folder(s) from additional project.
  • Mark individual files as Plain Text via context menu in Project View panel. The downside: such "marking" is IDE-wide as far as I know, so the same file path will be excluded in another project as well.
  • Any other exclusion mechanic that is currently available (e.g. Settings (Preferences on macOS) | Editor | File Types | Ignore files and folders -- global as well and based on file name only and file will be completely ignored from all operations... so not really acceptable for your case).

Consider watching after https://youtrack.jetbrains.com/issue/WI-17646 (star/vote/comment) and related tickets to get notified on any progress.


If they are the same classes, have you thought about making a composer package for them? Would be easier to manage it all I think.

Upvotes: 2

Related Questions