Author |
Topic |
|
tiancovici
Junior Member
23 Posts |
Posted - Mar 02 2018 : 07:35:02 AM
|
In C, Visual Studio (2015) It's hard to tell apart in the VA Outline the declared/protoype functions versus the defined functions.
Would be nice if they can have two default colors to distinguish faster (whether controllable colors or default colors) |
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Mar 02 2018 : 10:29:19 AM
|
I always tried to place my prototypes into a .h file personally, to keep them separate.
Assuming all of the prototypes are grouped together, if you wrap them in:
#if 1 #endif
then VA will group them together in their own node, so you can collapse them if you want, and keep them separated from the function implementations. |
zen is the art of being at one with the two'ness |
|
|
tiancovici
Junior Member
23 Posts |
Posted - Mar 02 2018 : 11:46:26 AM
|
Haha Feline, thx i like this hack, but this is for work, I don't think they'll appreciate redundant lines.
Certain functions declarations have to be in .c file for encapsulation purpose, like a class in c++ has private function members. so they're no avoiding this. |
Edited by - tiancovici on Mar 02 2018 11:46:58 AM |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Mar 02 2018 : 12:07:01 PM
|
How about this code sample? This compiles in a .c file in VS2015 for me, and the region markers are also understood by the IDE, allowing you to collapse the block in the editor:
#pragma region prototypeTesting
// lots of prototypes here
#pragma endregion prototypeTesting because the lines are actually functional in the IDE, and doing something helpful, would this be acceptable? |
zen is the art of being at one with the two'ness |
|
|
tiancovici
Junior Member
23 Posts |
Posted - Mar 03 2018 : 08:23:22 AM
|
I want to say I love visual assist, and i continue to promote with new co-workers who also develop in visual studio, however not everyone does. The issue with this approach is that it forces the developer to continue to add these lines when programming, and to have to remember to remove before check-in, not everyone in my workplace uses visual studio so keeping these lines in check-in isn't ideal.
What I'm wondering is that in VA Outline (in my environment at least), it highlights all functions in orange all data types in gold-yellow all symbolic constants in purple all variables in white-yellow all reserved words in blue
I'm not sure how it does this, but in the VA Outline if there are two orange labeled functions and these functions have same names, then it's likely fair to assume the first is the declaration, and second is definition. Else if there's only one function name and has extern keyword before its name, it's a declaration. Else if it's one function with no extern keyword before its name then it's likely definition. |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Mar 05 2018 : 1:00:26 PM
|
I was hoping to get an instant solution up and running for this, but clearly it isn't going to be that easy. We are considering making function declarations different from function implementations in VA Outline:
case=74606
Unfortunately I don't currently have an estimate for when we might have a go at this. |
zen is the art of being at one with the two'ness |
|
|
tiancovici
Junior Member
23 Posts |
Posted - Mar 06 2018 : 07:46:14 AM
|
Thanks! |
|
|
|
Topic |
|