使用JetBrains WebStorm进行Firefox插件开发。如何处理大量的警告? [英] Firefox addon development using JetBrains WebStorm. What to do with numerous warnings?
问题描述
但是当我在WebStorm中打开我的项目(大约1000行)时,第一次向我展示了大约500条警告。大多数警告是未解析的函数或方法和未解析的变量或类型。
例如,这两行包含4个警告:
let sss = Cc [@ mozilla.org/content/style-sheet-service;1\"].getService(Ci.nsIStyleSheetService);
sss.loadAndRegisterSheet(uri,sss.AUTHOR_SHEET);
- getService(未解析的函数或方法)
- nsIStyleSheetService(未解析变量)
- loadAndRegisterSheet(未解析函数或方法)
- AUTHOR_SHEET(未解析变量)
现在我只是禁用了所有这些警告。但也许这不是处理这个问题的最好方法吗? WebStorm中有jQuery,Ext JS,Prototype,Dojo等的库。并且可以添加一个定制的JavaScript库。有没有办法添加/创建这样的自定义库?或者还有另一种方法来处理所有这些警告,而不是禁用它们?
有Komodo IDE提供这样的自动完成功能:
我想也许有人从Komodo IDE中提取它并添加到WebStorm作为一个库。
我已经通过克隆 repository ,然后在设置 - >语言和文件夹下添加lib / sdk目录作为新的库。 Frameworks-> JavaScript-> Libraries。
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);
- getService (Unresolved function or method)
- nsIStyleSheetService (Unresolved variable)
- loadAndRegisterSheet (Unresolved function or method)
- 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:
and I thought that maybe someone extracted it from Komodo IDE and added to WebStorm as a library.
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.
这篇关于使用JetBrains WebStorm进行Firefox插件开发。如何处理大量的警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!