How to add libraries to “External Libraries” in WebStorm/PhpStorm/Intellij

Join Stack Overflow to learn, share knowledge, and build your career.

Email Sign UpOR SIGN IN WITH
 Google
 Facebook
 

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?

How to add libraries to “External Libraries” in WebStorm/PhpStorm/IntellijHow to add libraries to “External Libraries” in WebStorm/PhpStorm/Intellij

asked Nov 21 '14 at 10:18
How to add libraries to “External Libraries” in WebStorm/PhpStorm/Intellij
AngularInDepth.com
30.6k1260150
 
1  
I don't really know how it works in WebStorm, but in PhpStorm the stuff listed under External Libraries would be: 1) PHAR files; 2) 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: 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. – LazyOne Nov 21 '14 at 10:25 
    
Thanks, LazyOne. You seems to be right about when you reference a library that is physically located outside of the project, it should be listed there. I added such library to libraries and it is indeed is listed under External Libraries. You can make it as an answer here so I can accept it. – AngularInDepth.com Nov 21 '14 at 10:52
    
So the question now is why TODOs are shown for libraries that are not external (located within a project). Do you know if it's the expected behavior? I'd assume that once I mark files as library no inspection should take place there regardless of the location (within the project or external) – AngularInDepth.com Nov 21 '14 at 10:54 
1  
AFAIK -- Yes, it's expected (for "local" libraries). But that's very easy to bypass in TODO window. – LazyOneNov 21 '14 at 11:00
1  
Correct -- using it myself. My only hope would be to have JB implementing separate scope for that themselves which will include only "normal" code and will exclude excluded/generated/libraries content automatically. – LazyOne Nov 21 '14 at 11:56
up vote14down voteaccepted

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.

answered Nov 21 '14 at 11:58
How to add libraries to “External Libraries” in WebStorm/PhpStorm/Intellij
LazyOne
88.1k14203205
 

Your Answer

 
 
 
 
 

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged How to add libraries to “External Libraries” in WebStorm/PhpStorm/Intellijintellij-idea How to add libraries to “External Libraries” in WebStorm/PhpStorm/Intellijphpstorm How to add libraries to “External Libraries” in WebStorm/PhpStorm/Intellijwebstorm or ask your own question.

asked

3 years ago

viewed

10,006 times

active

2 years, 1 month ago

 
Work from anywhere
 
Stack Overflow requires external JavaScript from another domain, which is blocked or failed to load.
上一篇:/etc目录深入理解


下一篇:Digital Image Processing 笔记(二)-基本概念