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