1

I have PhpStorm 2018.1 set up to have multiple projects in one window (all of the ones I work on at work.) There are probably 5 different content roots in all: 4 content roots from one project, and 1 content root in a separate project. Some of the projects use the same framework, so there are duplicate vendor files.

PhpStorm gives me a warning saying there are multiple definitions for a file, and when autocompleting my code it offers me class names from multiple projects. How do I isolate this behavior to only auto complete from the project whose file is currently open?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
timetofly
  • 2,957
  • 6
  • 36
  • 76
  • 1
    Mark such "duplicate" folders as Excluded. No other way -- it's not possible to limit code completion to specific folder or scope (set of folders/files). Sounds related: https://youtrack.jetbrains.com/issue/WI-33965 (this and linked tickets). – LazyOne Jul 16 '18 at 13:55
  • Ah that's too bad. Marking as excluded won't work since I need the correct files depending on the project I'm working on. – timetofly Jul 16 '18 at 14:41
  • 1
    Try working in separate projects then (in separate frames/windows)? Do you really need to switch between more than two projects all the time? Maybe you can adjust your workflow to that (depends on your actual code base & habits, of course) – LazyOne Jul 16 '18 at 15:00

1 Answers1

1

Unfortunately ATM it's not possible to limit code completion to specific folder or scope (set of folders/files).

The only way of I could think of right now -- mark such "duplicate" folders as Excluded. For example, if you have one copy of (lets say) Laravel framework in first project then you may exclude it from 2nd one (since in your setup both projects are treated as one).

This ticket seems related: https://youtrack.jetbrains.com/issue/WI-33965 -- watch it (star/vote/comment) and related tickets to get notified on any progress or ideas.

Other than that: try working in separate projects (each project in own separate frame/window). Do you really need to switch between more than 2+ projects all the time? See if you can adjust your workflow to that (depends on your actual code base & habits, of course).

LazyOne
  • 158,824
  • 45
  • 388
  • 391