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

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

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

shareimprove this question
 
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

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.

shareimprove this answer
 

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    or ask your own question.

 
Stack Overflow requires external JavaScript from another domain, which is blocked or failed to load.
原文地址:https://www.cnblogs.com/SofuBlue/p/8029127.html