I've 2 projects in PhpStorm: one is working well while another won't work and I can't figure what make the first one working.
The first one is working well with library root for bower, npm and composer :
The second one is bower, npm are not detected as library root :
So the behaviour in PhpStorm is different, when I use the navigate file on second project, I see all the vendor file by default :
If I mark the directory as excluded, the ide don't understand the vendor class :
So how can we configure the IDE to mark a directory as library root ?
From the main menu, select File | Project Structure Ctrl+Alt+Shift+S and click Project Settings | Modules. Select the necessary module and then open the Sources tab in the right-hand part of the dialog. Click Add Content Root and specify the folder that you want to add as a new content root. ).
From the main menu, select File | New | Module from Existing Sources. Select the directory in which your sources, libraries, and other assets are located and click Open. In the dialog that opens, select Create module from existing sources if you want to create a new module from the existing source code.
Create a content rootOpen the Project Structure settings. In the Projects pane of the Project Structure page, click the project you want to configure content roots for. In the dialog that opens, locate the desired directory and click OK.
The project root is the folder which is the parent for all the project sources. By default, all subfolders in this folder are treated as sources and their files are involved in indexing, searching, parsing, code completion, and so on. Use the icons on the toolbar to change this status.
Thanks to @LazyOne comment, found the solution : Select Preferences | Languages & Frameworks | JavaScript | Libraries and click Add. Select the path you want to add and the folder will be marked as library root. Really useful for non standard path (not bower_components for example)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With