Eclipse Outline View - Visible JavaScript Categori

2019-07-26 04:05发布

I just found an option in the little white down arrow in Eclipse that reads "Visible Categories..."

How can I use this? It seems to me that it could be used to only show functions that have an @category in their comments, but I haven't been able to make the "Visible JavaScript Categories" dialog display the categories that work.

If it did work it would be incredibly useful for separating out Unit Tests from their common-functions and separating them from the setUp and tearDown methods, so what is it really for?

By the way I'm editing a Javascript file in the Eclipse "Javascript Editor", I don't know if that makes any difference or not.

It looks like there's something on that here, just search for Category Support.

But it doesn't seem to work for some reason when I try it in my instance of Eclipse.

I've tried the following above my functions to no avail:

/**
 * @category setter
 *
 */
 CheckoutTest.prototype.setTestFormValues = function(whichTest) {

1条回答
仙女界的扛把子
2楼-- · 2019-07-26 04:25

Your understanding of the feature is correct - but (sadly) it doesn't appear to work with JavaScript, at least as of Eclipse version 3.5.1. It works exactly as you expect with Java.

In your example, "setter" would appear in the little-white-down-arrow's menu, with a checkmark allowing you to quickly show/hide all methods tagged with an @category setter annotation in their JavaDoc comment block.

For anyone wondering, the Visible Categories feature is a part of Eclipse's Outline view.

查看更多
登录 后发表回答