在Sublime中按回车键时自动“续写”注释块?

6

我相信有答案存在,但由于问题的不确定性和关键词的模糊性,这很困难。

我想要的只是一个评论插件或答案,以模仿Eclipse中的Java,其中:

/* 
 * This is a description of a function in Javascript
 * When I press return a line like this
 *
 * should appear (above) and allow me to continue the comment block
 * and be surrounded by the following
 */

更新/答案

在我发布这篇文章几分钟后,用户pst进来重新表达了我的问题使其更加清晰明了。在搜索后,我找到了DocBlockr。非常好用,感谢你们两位!

1个回答

12

从使用DocBlockr包开始。

如果您输入并对齐第一个*,它将插入以下起始*

/*
 * <-- Type and align that one, hit <RETURN>...
 * <-- This one will be inserted and aligned automatically.

如果您插入双星号,它将插入前导*而不带提示:

/**
 * <-- Inserted automatically.

如果您正在函数的开头,它也会为您添加JsDoc注释。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接