【问题标题】:jsdoc for commonjs requirecommonjs 的 jsdoc 需要
【发布时间】:2012-10-01 10:53:30
【问题描述】:

我将 webstorm ide 与 nodejs 一起使用。当我创建模块并需要它们时,我没有代码完成。

例如:

test.js

/** @module test*/
module.exports = {
    run: function () {}
};

main.js

var test = require(__dirname+"/test.js");
test. //code completion does not offer "run"

我还没有在 jsdoc 3 文档中找到任何关于模块用法的信息。 :S

【问题讨论】:

    标签: node.js code-completion commonjs jsdoc webstorm


    【解决方案1】:
    var test = require("./test.js");
    test. //code completion offers "run"
    

    所以你必须使用“。”而不是 __dirname。

    【讨论】:

      猜你喜欢
      • 2014-01-24
      • 1970-01-01
      • 2014-01-01
      • 1970-01-01
      • 2015-10-18
      • 1970-01-01
      • 2016-04-06
      • 1970-01-01
      • 2012-07-09
      相关资源
      最近更新 更多