In a recent update, C/C++ tools enable comments that were immediately before a variable or function to be displayed if you hovered over a non-declaration instance of the variable or function (could hover over foo() and see what the comments before foo() was). Example:
// A useful comment goes here
void foo(int bar){
// Work here
}
I think it would be useful if the extension could determine block comments that are done in the following way and parse out the extra // characters like in:
////////////////////////////////////////////////////
// Add segments to each processors density fields //
////////////////////////////////////////////////////
void foo(int bar){
// Work here
}
Currently it removes the first two of each line and that is it.
Also, can it be made possible to see if there is a comment block two lines above a function definition? I am currently working with inherited code that followings a format like this:
////////////////////////////////////////////////////
// Add segments to each processors density fields //
////////////////////////////////////////////////////
void foo(int bar){
// Work here
}
Since it is not immediately before the function, the extension does not see the command block and when you hover over, does not inform you what the function does.
Thank you in advance.
Edit: Another situation that might be useful to consider:
/* ---------------------------
Comment here
----------------------------*/
void foo(int bar){
// Work here
}
Sounds good to me. Not sure yet when we'll get around to improving the doc commenting (maybe May?).
Just for context, the reason we didn't look past an empty line is because it could potentially be a section comment which doesn't apply to the current function, but rather the next N functions.
Ahhh ok. Would it be possible to make that a toggle set to false by
default? I could still see reading a block for general discription useful
even if it isn't for the specific function.
On Tue, Apr 2, 2019, 2:06 AM Bob Brown notifications@github.com wrote:
Just for context, the reason we didn't look past an empty line is because
it could potentially be a section comment which doesn't apply to the
current function, but rather the next N functions.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/vscode-cpptools/issues/3392#issuecomment-478857571,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AiBI2EplylWw6pq4HVCZ75rKiWquJh7eks5vcvNmgaJpZM4cWZa8
.
Sure, we can reevaluate our decision here. Just note that Visual Studio behaves the same way and we model most of our behavior on Visual Studio so we'll want to achieve consensus across the two products.
Yeah, VS correctly removes the // from around the comment, and preserves new lines, (unlike us), but uses blank newlines to disassociate the comment, as Bob mentioned.
This feature request is being closed due to insufficient upvotes. When enough upvotes are received, this issue will be eligible for our backlog.