This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCSv6.1.1: Automatic highlighting doesn't work for structure members

Guru 20045 points

Hello,

Usually when you select a variable in CCS, CCS highlights that variable throughout the active file.  However, I noticed that doesn't work for structure member variable.  For example, if there is a structure type variable var1.member1 and I select member1, CCS doesn't highlight member1 throughout the file.  

Is there a setting to allow this to work?

Stephen

  • Stephen,

    If you go to Window -> preferences.  Click on show advanced options at the bottom then the option is shown in this capture.  However I don't see anything that changes this particular behavior.  It seems to just turn the whole thing on or off.

    For me I do see the members being highlighted in 6.1.1.

    Regards,

    John

  • It works for a simple source file where the struct is defined in the same file where it is used; however, it doesn't work for my large project.
  • I have placed the definition in a separate header and then include the header in my source and it still works. Not sure how complicated your project is but if you wanted to zip it up and send it to me in a private message I could try to figure out what is going on.
  • Hello John,

    I would rather not send my send my entire project. Does CCS need to know the definition of the variable before it will work? Notepad++ is able to select it without knowing the definition.
  • Hello John,

    It works now after I removed 

    #ifdef __cplusplus
    extern "C" {
    #endif

    from a header file that defines the variables I was selecting.

    I had an issue with extern "C" before and it was reported as a bug (e2e.ti.com/.../1500614  When will that bug be fixed.

    Thanks,
    Stephen

  • Is the extern "C" bug an eclipse bug?
  • The  selection issue doesn't happen on a simple c++ project I created, which also has the struct definition surrounded by #ifdef __cplusplus  extern "C" { #endif, so now I am not sure what's causing this issue.

    Stephen

    TestExternCBug.zip

  • Ok, the issue occurs after I rename main.cpp to main.c and select "Treat C as C++ files" in CCS Build->C2000 Compiler->Advanced Options->language Options.

    Why?
  • stevenh said:
    Ok, the issue occurs after I rename main.cpp to main.c and select "Treat C as C++ files" in CCS Build->C2000 Compiler->Advanced Options->language Options.

    Why?

    My guess is that selecting "Treat C as C++ files" causes only the compiler to treat the .c source file as a C++, whereas the Eclipse indexer will still be trying to index the .c source file as C.

    Under the CCS Project Properties, if you select "Show advanced settings" under C/C++ General -> File Types you can override the workspace settings with project specific file types. For the project in question you could use that to tell Eclipse to treat .c files as C++ to see if that corrects the issue.

    [I haven't tested this myself]

  • Fantastic. That works.