Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add libraries to "External Libraries" in WebStorm/PhpStorm/Intellij

I'm trying to add libraries to "External Libraries". I've added them in Setting -> Javascript -> Libraries and they are highlighted now as "(library home)", but they are not added to external libraries which allows code inspection and TODO's to work for them.

What is the difference between "library home" and "External Libraries" and how do I make a library external?

enter image description hereenter image description here

like image 360
Max Koretskyi Avatar asked Nov 21 '14 10:11

Max Koretskyi


People also ask

How do I add a library to WebStorm?

Press Ctrl+Alt+S to open the IDE settings and select Languages & Frameworks | JavaScript | Libraries. On the Settings: JavaScript Libraries page that opens, click Add. The New Library dialog opens. , and choose Attach File or Attach Directory from the list.

How do I import an external library into IntelliJ?

From the main menu, select File | Project Structure | Project Settings | Modules. Select the module for which you want to add a library and click Dependencies. button and select Library. In the dialog that opens, select a project or a global library that you want to add to the module.

What is the difference between PhpStorm and WebStorm?

PHPStorm incorporates all the functionality that WebStorm comes equipped with (CSS, JavaScript HTML), PLUS full-fledged PHP support (and databases support).


1 Answers

In PhpStorm the stuff listed under External Libraries branch will include:

  • PHAR files
  • folders from Settings | PHP | Include paths (folders that are not part of the actual project but still referenced for code completion: e.g. libraries installed globally).

Quite likely it's the same here in WebStorm for JavaScript libraries: global npm modules or whatever. So I guess when you reference a library that is physically located outside of the project, it should be listed there.

like image 66
LazyOne Avatar answered Oct 05 '22 19:10

LazyOne