Author Topic: [SOLVED] Unexpected context-tagging results on struct  (Read 2301 times)

marfig

  • Junior Community Member
  • Posts: 5
  • Hero Points: 2
[SOLVED] Unexpected context-tagging results on struct
« on: November 01, 2016, 09:59:57 PM »
I have a struct defined as such:
Code: [Select]
struct options {
    int       input;
    int       output;
    int       wordsize;
    char      encoding;
    int       uppercase;
    long long number;
};
The single file project has the following includes:
Code: [Select]
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <errno.h>
The project configuration has the following includes defined under the Directories tab (taken from the command shown)
Code: [Select]
$ gcc -xc -E -v -
...
 /usr/lib/gcc/x86_64-linux-gnu/5/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
After retagging I declare an options object and try to use it.
Code: [Select]
struct options opts = { .input = 10 ), *op = &opts;
...
op->|
When my cursor is on the vertical bar above, I get the auto-complete options for the op pointer which include the declared members but also a whole lot of other items like curOptIdx, fOptSet, optCt, OrgiArgCt, and a bunch more.

What is causing this excess o items that are not related to my object declaration?
« Last Edit: November 02, 2016, 06:30:08 PM by marfig »

Dennis

  • Senior Community Member
  • Posts: 3992
  • Hero Points: 520
Re: Unexpected context-tagging results on struct
« Reply #1 on: November 02, 2016, 03:51:55 PM »
There is probably another struct (or class or enumerated type) named "options".  Without doing full C++ preprocessing and symbol analysis, SlickEdit can't assume that the struct options in your header file is the one that you want.  Try a more unique name, and it should work fine.

marfig

  • Junior Community Member
  • Posts: 5
  • Hero Points: 2
Re: Unexpected context-tagging results on struct
« Reply #2 on: November 02, 2016, 06:29:35 PM »
Thank you, Dennis.
After your explanation, that is in fact sort of a desirable feature.
I changed the struct to a more unique name.