Eclipse:html文件中的javascript块中的任务标记

Aar*_*ron 9 html javascript eclipse tags task

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

小智 5

遗憾的是,Eclipse无法识别HTML中嵌入的JavaScript的任务标签.但是,您可以使用HTML注释在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>
Run Code Online (Sandbox Code Playgroud)

将导致以下描述出现在"任务"视图中:

TODO: Add meta tags and page title here.
FIXME: There might be a semicolon missing in this code.
Run Code Online (Sandbox Code Playgroud)

要在Eclipse中启用任务标记,请转到首选项>常规>编辑器>结构化文本编辑器>任务标记.

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