【问题标题】:Visual Studio and XML Commenting in Javascript makes "public" methods disappear in intellisenseJavascript 中的 Visual Studio 和 XML 注释使“公共”方法在智能感知中消失
【发布时间】:2012-05-09 19:13:56
【问题描述】:

我很高兴地发现我可以在我的 javascript 中使用 XML 注释(即):

/// <summary>Determines the area of a circle based on a radius parameter.</summary>
/// <param name="Name" type="String">Give this dude a NAME!</param>
/// <returns type="Nothing">The area.</returns>

直到我意识到在我这样做之后,我的“公共”方法不再在智能感知中列出...... :-(

 this.greet = function (greeting) {
        alert(greeting + " " + this);
    } 

当我实例化 var thePlayer = new player('bob'); ... 玩家;选手。

有没有人有这方面的经验和解决方法?能够将 javascript 注释到智能感知中会非常好!

【问题讨论】:

  • 您是否尝试使用 * 进行评论,或者仅使用两个破折号而不是三个/
  • 我在此处添加了星号,以便显示摘要、参数和返回标签。这些是 MS 用于评论的三个。此外,还有 3 个斜线,以便 VS 看到我正在尝试 XML 注释。
  • 我假设您只添加了星号,因为您没有缩进 cmets(从而获得语法突出显示)——我的编辑应该解决这个问题

标签: javascript visual-studio xml-comments


【解决方案1】:

我认为如果您从返回中删除 (type="Nothing") 它应该显示播放器的成员。

【讨论】:

  • 就是这样!万分感谢!现在又酷了!猜猜你甚至可以使用 XML 注释来破坏东西。谢谢!
猜你喜欢
  • 1970-01-01
  • 2011-10-14
  • 2016-03-20
  • 2018-02-06
  • 2012-01-28
  • 1970-01-01
  • 2012-03-06
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多