This feature request is sort of inspired by Org Mode's feature of indirect editing of source code blocks. Markdown also has this feature if you use Edit Inderect package. I think rust-edit-doc-comment would be nice name for a function. C-' as shortcut would be familiar for all Org Mode users.
What it should do in rust-mode is strip leading comments, and insert whole comment into indirect buffer with markdown-mode enabled, if we on the comment itself, or edit code only in indirect buffer with rust-mode if we're on code block in documentation comment while executing the command. For example (█ represents the point):
This feature request is sort of inspired by Org Mode's feature of indirect editing of source code blocks. Markdown also has this feature if you use Edit Inderect package. I think
rust-edit-doc-comment
would be nice name for a function.C-'
as shortcut would be familiar for all Org Mode users.What it should do in
rust-mode
is strip leading comments, and insert whole comment into indirect buffer withmarkdown-mode
enabled, if we on the comment itself, or edit code only in indirect buffer with rust-mode if we're on code block in documentation comment while executing the command. For example (█
represents the point):If we execute
rust-edit-doc-comment
and this buffer is created:With
markdown-mode
enabled.If the point is anywhere inside code block like this:
And we execute
rust-edit-doc-comment
then this buffer is created:After we edit this buffer we can call
rust-finish-doc-comment-edit
and we get updated comment.This makes more convenient editing for documentation comments with proper tools available for both
markdown-mode
andrust-mode
.