omnisharp-roslyn icon indicating copy to clipboard operation
omnisharp-roslyn copied to clipboard

Documentation XML comment generation in LSP mode

Open elevin72 opened this issue 3 years ago • 2 comments

In vscode, entering /// above a class/method/property/whatever will generate a nice xml comment docs. It seems like this is not supported for other editors using LSP. That functionality could be exposed as a code action to vim/emacs (or a snippet but I'm not sure how that would work).

This would be a very helpful feature to make useable for other editors as well.

elevin72 avatar Dec 23 '21 20:12 elevin72

Documentation generation is not a code action, but is instead tied to executing code formatting. VS Code simply invokes formatting endpoint which then expands /// into a doc comment.

In LSP this can be achieved via /onTypingFormat endpoint. It has some limitations such as no support for setting the cursor location after format which ends up awkward in some situations, but this is the best that can be done without introducing custom LSP endpoints.

filipw avatar Dec 28 '21 08:12 filipw