是否有编辑器显示WYSIWYG评论?

时间:2022-09-11 19:43:20

Has anyone seen an editor/IDE that shows WYSIWYG comments inside the code? I have seen some that show the docs of an element in a separated tab/windows, but not together with code. For example, a JavaDoc comment would be much clearer and easier to edit if it had no tags and could be edited like a snippet from a normal text document.

有没有人看到编辑器/ IDE在代码中显示WYSIWYG注释?我已经看到一些在分隔的选项卡/窗口中显示元素的文档,但不与代码一起显示。例如,如果JavaDoc注释没有标记,则可以更清晰,更容易编辑,并且可以像普通文本文档中的片段一样进行编辑。

/**
 * Writes <code>Hello world!</code> to the <b>standard output</b>.
 * @seealso showGoodbye
 */
public static void showHello() {

Could be something like this:

可能是这样的:

/*
Writes Hello world! to the standard output.
See also: showGoodbye()
*/

/ *写Hello世界!到标准输出。另见:showGoodbye()* /

public static void showHello() {

but, editable, of course.

但是,当然是可编辑的。

And for anyone who happens to have some knowledge/experience with open IDEs like Eclipse, Netbeans, etc.: would it be too hard to implement this?

对于那些碰巧拥有Eclipse,Netbeans等开放式IDE的知识/经验的人来说,实现这一点会难吗?

4 个解决方案

#1


Never seen it like that.

从来没有见过这样的。

Most, however, have a "Hover" mode that will show you the WYSIWYG version when you hover over the class/method/variable that the javadoc refers to.

但是,大多数都有一个“悬停”模式,当您将鼠标悬停在javadoc引用的类/方法/变量上时,它将显示所见即所得的版本。

It could be a switch, but you probably would decide not to use it for the same reason web designers rarely use a WYSIWYG editor for web development.

它可能是一个开关,但您可能会决定不使用它,因为Web设计人员很少使用WYSIWYG编辑器进行Web开发。

#2


There are a few fringe languages/IDEs out there that separate the programming view from the storage, but these are mostly research languages, and deal mostly with the code, not the comments. Look up extensible programming for some of the stuff out there. The general idea is to model the code as an AST in the background and provide a text-based interface to edit/display that model. That AST can then be stored as anything, such as plain text, s-expressions, XML, or even a binary representation.

有一些边缘语言/ IDE将编程视图与存储分开,但这些语言主要是研究语言,主要处理代码,而不是注释。查找一些可扩展的程序设计。一般的想法是在后台将代码建模为AST,并提供基于文本的界面来编辑/显示该模型。然后可以将AST存储为任何内容,例如纯文本,s表达式,XML,甚至二进制表示。

It wouldn't be much of a leap at all to go from this sort of model to one that actually prettified the comments and gave you a WYSIWYG interface.

从这种模型转变为实际美化评论并为您提供WYSIWYG界面的模型,实际上并没有太大的飞跃。

#3


Emacs has preview-latex, which does this kind of visual conversion for LaTeX source files. I guess that it should be possible to do the same for your purpose.

Emacs有预览乳胶,它为LaTeX源文件进行这种可视化转换。我想应该可以为你的目的做同样的事情。

#4


This doesn't answer exactly what you seem to be asking. But as for efficient creation of comments you might want to checkout Textmate. Check this video demo of using and creating comments. In particular the "banner", "head" and "todo" comment modes. Also if you need the comment formatting in specific format structure you could presumably create a customized bundle that facilitates the comment formatting as you type. I would presume that you could create entry and escape sequence to enter in and out of comment mode and have the editor wrap the text block after you complete the comment. The thing that makes Textmate popular among many folks is the extensibility of its bundle system.

这并没有完全回答你似乎要问的问题。但至于有效创建评论,您可能需要签出Textmate。查看使用和创建评论的视频演示。特别是“banner”,“head”和“todo”评论模式。此外,如果您需要特定格式结构的注释格式,您可能会创建一个自定义的包,以便在您键入时方便注释格式。我认为您可以创建进入和退出序列以进入和退出注释模式,并让编辑器在完成注释后包装文本块。使Textmate在众多人中流行的是它的捆绑系统的可扩展性。

#1


Never seen it like that.

从来没有见过这样的。

Most, however, have a "Hover" mode that will show you the WYSIWYG version when you hover over the class/method/variable that the javadoc refers to.

但是,大多数都有一个“悬停”模式,当您将鼠标悬停在javadoc引用的类/方法/变量上时,它将显示所见即所得的版本。

It could be a switch, but you probably would decide not to use it for the same reason web designers rarely use a WYSIWYG editor for web development.

它可能是一个开关,但您可能会决定不使用它,因为Web设计人员很少使用WYSIWYG编辑器进行Web开发。

#2


There are a few fringe languages/IDEs out there that separate the programming view from the storage, but these are mostly research languages, and deal mostly with the code, not the comments. Look up extensible programming for some of the stuff out there. The general idea is to model the code as an AST in the background and provide a text-based interface to edit/display that model. That AST can then be stored as anything, such as plain text, s-expressions, XML, or even a binary representation.

有一些边缘语言/ IDE将编程视图与存储分开,但这些语言主要是研究语言,主要处理代码,而不是注释。查找一些可扩展的程序设计。一般的想法是在后台将代码建模为AST,并提供基于文本的界面来编辑/显示该模型。然后可以将AST存储为任何内容,例如纯文本,s表达式,XML,甚至二进制表示。

It wouldn't be much of a leap at all to go from this sort of model to one that actually prettified the comments and gave you a WYSIWYG interface.

从这种模型转变为实际美化评论并为您提供WYSIWYG界面的模型,实际上并没有太大的飞跃。

#3


Emacs has preview-latex, which does this kind of visual conversion for LaTeX source files. I guess that it should be possible to do the same for your purpose.

Emacs有预览乳胶,它为LaTeX源文件进行这种可视化转换。我想应该可以为你的目的做同样的事情。

#4


This doesn't answer exactly what you seem to be asking. But as for efficient creation of comments you might want to checkout Textmate. Check this video demo of using and creating comments. In particular the "banner", "head" and "todo" comment modes. Also if you need the comment formatting in specific format structure you could presumably create a customized bundle that facilitates the comment formatting as you type. I would presume that you could create entry and escape sequence to enter in and out of comment mode and have the editor wrap the text block after you complete the comment. The thing that makes Textmate popular among many folks is the extensibility of its bundle system.

这并没有完全回答你似乎要问的问题。但至于有效创建评论,您可能需要签出Textmate。查看使用和创建评论的视频演示。特别是“banner”,“head”和“todo”评论模式。此外,如果您需要特定格式结构的注释格式,您可能会创建一个自定义的包,以便在您键入时方便注释格式。我认为您可以创建进入和退出序列以进入和退出注释模式,并让编辑器在完成注释后包装文本块。使Textmate在众多人中流行的是它的捆绑系统的可扩展性。