Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to mark a directory as library root?

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 :

enter image description here

The second one is bower, npm are not detected as library root : enter image description here

So the behaviour in PhpStorm is different, when I use the navigate file on second project, I see all the vendor file by default :

enter image description here

If I mark the directory as excluded, the ide don't understand the vendor class : enter image description here

So how can we configure the IDE to mark a directory as library root ?

like image 245
tchiot.ludo Avatar asked Jul 05 '17 07:07

tchiot.ludo


People also ask

How do I mark a folder as root in IntelliJ?

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

How do I mark a folder as module in IntelliJ?

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.

How do I change the root directory in PyCharm?

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.

What is the project root directory?

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.


1 Answers

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)

like image 119
tchiot.ludo Avatar answered Oct 05 '22 20:10

tchiot.ludo