Author |
Topic |
|
vinithpm
New Member
India
2 Posts |
Posted - Oct 26 2018 : 01:17:40 AM
|
Hi, I am using the latest version of Atmel Studio (7.0.1931) that uses visual assist.
We use a macro for enum data type. For example: #define enum8 enum
This enum8 is later used to typedef a type with some members in it.
When this type is used for a variable, atmel studio does not allow 'goto implementation'. In a large project, this can get difficult.
Sample code with issues observed (marked as comments):
#include "sam.h"
#define X
#ifdef X #define enum8 enum #else #define enum8 char:enum #endif //===================================================== typedef enum { yes, no } Enum_Type;
typedef enum8 Enum1_Type { yes1, //members are not colored purple no1 } Enum1_Type;
typedef enum8 { yes2, //members are not colored purple no2 } Enum2_Type; //red wiggly line //===================================================== Enum_Type EnumVar; Enum1_Type Enum1Var; Enum2_Type Enum2Var; //red wiggly line //===================================================== int main(void) { EnumVar = yes; Enum1Var = yes1; //red wiggly line. Cannot goto implementation on right-click Enum2Var = yes2; //red wiggly line. Cannot goto implementation on right-click } |
|
feline
Whole Tomato Software
United Kingdom
19025 Posts |
Posted - Oct 26 2018 : 12:43:22 PM
|
Thank you for the clear description, I am seeing the same problem here, and I have a solution that works for me.
Can you please find the root directory of your solution, where your .ATSLN file is stored. In this directory create a new, blank text file called "va_stdafx.h", and then edit the file, adding the code:
#define enum8 enum
making sure that the file ends with a blank line.
There is no need to add this file to the solution, VA looks specifically for this helper file when parsing, so if it is there, it will be picked up. To get VA to take note of this file, please go into AtmelStudio and Visual Assists options dialog, and press the button:
VA Options -> Performance -> Rebuild symbol databases
you will need to close and reload AtmelStudio for this to take effect, but it should only take a couple of minutes at most for VA to finish parsing. Does this fix the problems for you? |
zen is the art of being at one with the two'ness |
|
|
vinithpm
New Member
India
2 Posts |
Posted - Oct 30 2018 : 01:14:45 AM
|
It does! Thanks feline. Should I consider this as a workaround? Is there anyway where I wouldn't have to add my macros in va_stdafx.h? BR. |
|
|
feline
Whole Tomato Software
United Kingdom
19025 Posts |
Posted - Oct 30 2018 : 10:21:03 AM
|
Excellent news, I was hoping this would work, since it fixed the problem for me.
I have put in a bug report for this problem:
case=131230
but for now the va_stdafx.h is a good work around. Since this file is not part of the solution, it is also safe to check it into source control, so anyone else who is also using VA will get the same fix in time.
If you have the same situation and problem, then adding the macros to va_stdafx.h is the solution for now. If you have a different situation in the code, there may be a different solution. If you have more examples where you are having problems, I can have a look at them if you are interested. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|
|
|