Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firefox addon development using JetBrains WebStorm. What to do with numerous warnings?

I am developing a firefox addon now. I have tried a lot of IDEs for JavaScript and finally ended up with JetBrains WebStorm. But when I opened my project(about 1000 lines) in WebStorm the first time it showed me about 500 warnings. The most of the warnings are "Unresolved function or method" and "Unresolved variable or type".

For example this 2 lines contain 4 warnings:

let sss = Cc["@mozilla.org/content/style-sheet-service;1"].getService(Ci.nsIStyleSheetService);
sss.loadAndRegisterSheet(uri, sss.AUTHOR_SHEET);
  1. getService (Unresolved function or method)
  2. nsIStyleSheetService (Unresolved variable)
  3. loadAndRegisterSheet (Unresolved function or method)
  4. AUTHOR_SHEET (Unresolved variable)

For now I just disabled all this warnings. But maybe it's not the best way to handle the problem? There are "libraries" in WebStorm for jQuery, Ext JS, Prototype, Dojo and other. And a custom JavaScript library can be added. Is there a way to add/create such a custom library? Or is there another way to handle all this warning not disabling them at all?

P.S. There's Komodo IDE that provides such autocompletions: Komodo IDE

and I thought that maybe someone extracted it from Komodo IDE and added to WebStorm as a library.

like image 278
traxium Avatar asked Oct 31 '22 03:10

traxium


1 Answers

I have solved the issue by cloning the repository and adding the lib/sdk directory as a new library under Settings->Languages & Frameworks->JavaScript->Libraries.

like image 153
Ilya Avatar answered Nov 09 '22 07:11

Ilya