Author Topic: [SOLVED] Unexpected context-tagging results on struct  (Read 1203 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

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2920
  • Hero Points: 438
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.