【问题标题】:Eclipse: task tags in javascript blocks inside html filesEclipse:html文件内的javascript块中的任务标签
【发布时间】:2011-06-19 21:43:08
【问题描述】:

是否可以在 Eclipse 中为 html 文件启用像 //TODO//FIXME 这样的任务标签?我已经检查了 Eclipse 的设置,并且没有 HTML 文件的“任务标签”部分。问题是我并没有真正在 html 本身中使用这些任务标签。它们位于 html 文件中的 javascript 块中。即使它们驻留在 html 文件中,以某种方式捕获它们也会很好。

【问题讨论】:

    标签: javascript html eclipse tags task


    【解决方案1】:

    很遗憾,Eclipse 无法识别嵌入在 HTML 中的 JavaScript 的任务标记。但是,您可以使用 HTML cmets 在 JavaScript 块周围添加任务标签。例如:

    <!DOCTYPE html>
    <html>
     <head>
      <!-- TODO: Add meta tags and page title here. -->
     </head>
     <body>
      <h1>Title</h1>
      <!-- FIXME: There might be a semicolon missing in this code. -->
      <script type="text/javascript">
       // TODO: This comment will not be added to Task Tags in Eclipse.
       var i = 0
      </script>
     </body>
    </html>
    

    会导致以下描述出现在您的任务视图中:

    TODO: Add meta tags and page title here.
    FIXME: There might be a semicolon missing in this code.
    

    要在 Eclipse 中启用任务标签,请转到 Preferences > General > Editors > Structured Text Editors > Task Tags

    面向 Web 开发人员的 Eclipse Java EE IDE。版本:Indigo Service Release 1 Build id:20110916-0149

    【讨论】:

    • 那太糟糕了。感谢您提供有关使用 HTML cmets 的提示!
    • 在当前版本中仍然如此吗?您是否参与过一个设置为使用 JavaScript 的项目?
    猜你喜欢
    • 1970-01-01
    • 2014-09-13
    • 1970-01-01
    • 2012-10-25
    • 1970-01-01
    • 2019-12-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多