I tried to use this feature like i know it from VisualStudio or better VisualAssist...
I only tried latest nightly build 03jan07 on windows.
It doesnt work...
typedef struct teststr_dummy {
int test;
} teststr;
class testclass {
public:
int test;
};
/* ------------------------------------------------------------------------- */
BOOL InitInstance(hInstance, nCmdShow)
HANDLE hInstance;
int nCmdShow;
{
teststr bla_bla; // teststr not in list in code completion
bla_bla ---// no code completion after hitting .
testclass bla_class; // testclass not in list in code completion
bla_class ----// bla_class not in list in code completion | no code completion after hitting .
So how does this feature work must i refresh the symbols manually, is it only supported with depth = 1 (I Mean no . ->)
thanks for me this is a essantial feature
I tried to use this feature like i know it from VisualStudio or better VisualAssist...
I only tried latest nightly build 03jan07 on windows.
It doesnt work...
typedef struct teststr_dummy {
int test;
} teststr_dummy;
I think they must be named the same, I do NOT use code completion so I don't know for sure.
Tim S
Well, mandrav is the only man on earth who understands that plugin (he wrote it after all :wink:). I don't know how many time it would take a mortal to add it, and I have no idea if mandrav feels like implementing it anytime soon.
Even though there's something to clarify: CodeCompletion is able to parse structs and classes, but not those declared with a typedef.
In your example the plugin should be able to parse the class (testclass), but it should fail with the struct... and the function too. I just tested it and it's so.
Something that is not helping the plugin, 'cause it's unable to parse it, is the way you define the function: old-C style. If you change it from:
BOOL InitInstance(hInstance, nCmdShow)
HANDLE hInstance;
int nCmdShow;
to:
BOOL InitInstance(HANDLE hInstance, int nCmdShow)
then the plugin will be able to suggest things, and since you're also defining a class I guess you're using C++, so you should really define functions that way.
If you define structs like this:
struct NameOfTheStruct
{
// data members
};
the plugin will be able to parse them.
Please have in mind the CodeCompletion plugin is still work in progress, even though it hasn't been touched that much for many months and it's known to lack support for a few 'constructs' (you know two now).
- Typedefs are supported.
- "Typedef struct XYZ {} ABC;" is not supported. Break it in two steps if you need it (struct XYZ {}; typedef XYZ Sxyz).
- This kind of code (what's it called? K&R?) is not supported:
BOOL InitInstance(hInstance, nCmdShow)
HANDLE hInstance;
int nCmdShow;
- Finally, this is WIP. Never forget that :).
Typedefs are supported.
struct test_struct
{
int first;
int last;
int percentage;
char* text;
};
typedef struct test_struct MY_TEST_STRUCT;
int main()
{
MY_TEST_STRUCT testOne;
testOne. // hit ctrl-space, nothing happens, but code-completion DOES recognise it as a symbol (it shows up as local variable)
return 0;
}
struct test_struct
{
int first;
int last;
int percentage;
char* text;
};
typedef struct test_struct MY_TEST_STRUCT;
int main()
{
struct test_struct testTwo;
test // hit ctrl-space, nothing happens, code-completion does not even recognise testTwo as a local variable
return 0;
}
struct test_struct
{
int first;
int last;
int percentage;
char* text;
};
typedef struct test_struct test_struct;
int main()
{
test_struct testThree;
testThree. // hit ctrl-space, the list of available variables shows up
return 0;
}
struct test_struct
{
int first;
int last;
int percentage;
char* text;
};
int main()
{
test_struct testFour;
testFour. // hit ctrl-space, the list of available variables shows up
return 0;
}
So, I don't really see in what way typedefs are supported :(.
Apparent from test three and four it doesn't really parse the typedef, it just assumes it's there somehow?
It would be really superb to have typedef support, that is, testOne. completing properly.