-
Notifications
You must be signed in to change notification settings - Fork 679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto generate triple slash comments with parameters #8
Comments
From @bpasero on December 25, 2015 10:17 This is currently not supported as far as I know. |
From @EmYeuCoGiao on December 25, 2015 10:26 Thanks you for reply 👍 |
This will require a new Roslyn API. |
There is a third-party extension that (mostly) provides this functionality: https://marketplace.visualstudio.com/items?itemName=k--kato.docomment What is required of roslyn to achieve this? The fact that it does not support navigating comments within the document? |
I need to expose a new API from Roslyn so that the same feature is not simply re-implemented inside of OmniSharp. Remember, this feature already exists in Roslyn today, and it's a little tricky to get right. The feature is not just generating XML doc comments on ///, but also inserting /// on enter, handling indents properly, getting undo behavior to be correct, not interfering with XML doc comment completion lists, etc.
I'm not sure what you mean by this. There's nothing within Roslyn that disallows writing such a thing. Also, it's not clear to me why you would think navigating comments would be related to XML doc comment generation. Could you be a bit more precise? As I mentioned, the feature already exists in Roslyn. I need to expose that feature as an API so that it can be used in OmniSharp. |
@DustinCampbell What I meant was, there was an issue sometime ago within Roslyn (probably specifically as it relates to analyzers) whereby navigating the document tree would not expose comment blocks -- it would skip over them. I assumed something similar might be in play here. At any rate, I am no expert when it comes to the roslyn APIs, so I will definitely take your word for it. :) |
It would be useful even if it didn't generate the Also just basic intellisense for the common tags such as So even a basic one without Rosylin would be appreciated. :) |
I'm using this extension: https://marketplace.visualstudio.com/items?itemName=k--kato.docomment and it solves the most common scenarios. |
Update Razor to 1.0.0-apha2.1-20190322.5.
Even just adding intellisense/code-completion for the xml tags like exists in visual studio would be amazing. |
IDocumentationCommentSnippetService was recently moved down to the Features layer, which means omnisharp can now take advantage of it and generate documentation comment snippets on typing. There are a couple of caveats: 1. LSP's "/onTypingFormat" endpoint has no support for setting the cursor location after format, which means that the cursor ends up after the inserted block. This is fine for newlines inside doc comments, but awkward for the initial expansion. However, unless we want to add special support with a custom endpoint, we can't get around this (the custom endpoint is how Roslyn does it). 2. The service itself is still internal, so I had to add a few new reflection points. Server-side of dotnet/vscode-csharp#8. It also needs a vscode change, but it's a one-line change I'll submit later after we get this merged and I can write some integration tests.
Adds '\n' and '/' to the on-type format list, enabling vscode support for the newly-added omnisharp feature of auto-generating documentation comments. Closes dotnet#8.
From @EmYeuCoGiao on December 25, 2015 3:43
I use VSCode for unity3d dev, i type /// but this not auto gennerate
///
///
///
///
Copied from original issue: microsoft/vscode#1644
The text was updated successfully, but these errors were encountered: