Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Several improvements to Code Completion plugin
ollydbg:
--- Quote from: Huki on August 28, 2014, 08:33:33 pm ---Here is a patch that adds support for:
1) Nested unnamed (struct or union) within unnamed: all the members should be invokable from the parent class or struct.
2) Show tooltips for members of unnamed / enum within class invoked directly (also for nested cases).
--- End quote ---
Hi, Huki, thanks for the contribution, this patch is in trunk now(rev 9901) with some comments added by me.
ollydbg:
Hi, with the cctest project, I can get such beautiful result:
--- Code: ----PASS: ClassA:: a
-PASS: ClassA:: s
-PASS: ClassA:: u
-PASS: ClassA:: v
-PASS: ClassA:: STRUCT_A
-PASS: ClassA:: STRUCT_B
-PASS: ClassA:: UNNAMED_A
-PASS: ClassA:: UNNAMED_B
-PASS: ClassA:: ENUM_A
-PASS: ClassA:: ENUM_B
--------------------------------------------------------
Total 10 tests, 10 PASS, 0 FAIL
--------------------------------------------------------
--- End code ---
Here is the test file:
--- Code: ---class ClassA
{
public:
int a;
struct A
{
int c;
} z;
// unnamed struct
struct
{
int s;
union
{
int u;
short v;
};
enum EnumS
{
STRUCT_A,
STRUCT_B,
};
};
enum
{
UNNAMED_A,
UNNAMED_B
};
enum EnumA
{
ENUM_A,
ENUM_B
};
};
// Hovering on following member variables should
// show tooltip: a, s, u, v, all the enums like STRUCT_A, etc.
// not c
//ClassA:: //a,s,u,v,STRUCT_A,STRUCT_B,UNNAMED_A,UNNAMED_B,ENUM_A,ENUM_B
--- End code ---
SteelRat:
I still don't understand logic of inactive code's highlighting or is it bug?
Little test for example:
--- Code: (H) ---#ifndef _MAIN_H_
#define _MAIN_H_
#define TEST 0
#endif
--- End code ---
--- Code: (CPP) ---#include "main.h"
//#define TEST 0
int main()
{
#if defined(TEST)
int = 0;
#else
int = 1;
#end
#ifdef TEST
int n = 0;
#else
int n = 1;
#endif
#if TEST == 1
int n = 2;
#endif
#if TEST == 0
int n = 3;
#endif
}
--- End code ---
If TEST defined in header - it is ignored always, it just does not exist for highlighting. CC can't find declaration until opening Symbols browser - then it can. If TEST defined in the same file it has strange behaviour with defined: TEST, TEST 1, TEST 2. For example, "#if defined" works well, but next "#if TEST == 1" - ignored.
ollydbg:
--- Quote from: SteelRat on September 04, 2014, 11:01:38 am ---CC can't find declaration until opening Symbols browser - then it can.
--- End quote ---
I can't reproduce this bug, it works fine here with your test code.
BTW: CC has nothing to do with active C preprocessor highlighting, highlighting was done purely by scintilla editor control.
SteelRat:
Can i modify scintilla myself? I mean license permission. When there will be some time for it.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version