Does
enum T_TR_SCROLL_DYN
{
DYN_NO_DISPLAY = 0,
DYN_SELECTED,
DYN_HIGHLIGHTED,
DYN_NONE,
};
work?
Sample code.....
typedef enum
{
DYN_NO_DISPLAY = 0,
DYN_SELECTED,
DYN_HIGHLIGHTED,
DYN_NONE,
} T_TR_SCROLL_DYN;
static T_TR_SCROLL_DYN Tr_Scroller_Dynamic = DYN_NO_DISPLAY;
Then type Tr_Scroller_Dynamic = ..... no options appear, thought it would provide a choice of the four options above?
Using SVN 6181, on Windows XP SP3.
Please help!
Hi, what you want is not implemented in CC. here, when you type:
Tr_Scroller_Dynamic =| // your caret are here
For the currently implementation of CC, we just do a "left" search until we find a non-identifier. For this case, we stop after the "=", and get "nothing" returned.
If you type this:
Tr_Scroller_Dynamic =DYN_| // your caret are here
Then, the "left" search stopped at "=" as well, but now, it returned the "DYN_", so, CC plugin can use "DYN_" as a "search text" to do the suggestion list.
For your feature request, I think it will let the "left" search to parse the whole line, and analyze the whole syntax tree, then if it find the left side of the assignment is a enum, it will list all the enum values in the right side of the "=". I'd like to say, it can be done, but it need some effort and time. :D
@nanyu
This means the "left search" should go beyond the "=", and find the token type before the "=" or "new". We just need to parse the whole statement line instead of partial statement. For example:
int aaa = Ogre::Root::getSingleton().|
Till now, the currently implementation just do the analyze below:
Ogre::Root::getSingleton().|
The code related in the nativeparser.cpp, in function
BreakUpComponents()..
see the code snippet:
// Breaks up the phrase for code-completion.
// Suppose the user has invoked code-completion in this piece of code:
//
// Ogre::Root::getSingleton().|
//
// This function will break this up into an std::queue (FIFO) containing
// the following items (top is first-out):
//
// Ogre [pttNamespace]
// Root [pttClass]
// getSingleton [pttFunction]
// (empty space) [pttSearchText]
//
// It also classifies each component as a pttClass, pttNamespace, pttFunction, pttSearchText
size_t NativeParser::BreakUpComponents(const wxString& actual, std::queue<ParserComponent>& components)
So, you can see, we will do a match algorithm one by one, from "Ogre" to "enpty space", and give the suggestion list. A more details can be find in the wiki.
BTW: There are a lot of features (till now, Loaden has released a lot CC patches), and we ( I and Loaden) are discussing about the Tokentree per project instead of Tokentree per workspace. Also, there are a lot of features of CC which we can improve.. We just need more help. :D
@ollydbg:
1, about the "=" operator
int aaa = Ogre::Root::getSingleton().|
Till now, the currently implementation just do the analyze below:
Ogre::Root::getSingleton().|
OH, no. borland C++ builder do this work, but I dislike it, since I't can't do 100% correct thing.
What I want is :
enum EE {e1,e2};
EE e1 = // <-- here, I type a "space"
int e2 = //<-- and here..
step1 : I type the "="
step2 : as you said, cc do a "left search". and find e1 is a enum, but e2 is a integer.
in c++98, enum name is a namesapce...but cc allow we do this:
EE e1 = EE:: //<--here , cc will show the item list. :) but I have to delete "EE::" after.
step3 : for e1, it show the "enum items list". for e2, do nothing.
so, the new function will have no bearing on " int aaa = Ogre::Root::getSingleton().| "
------------------
2, about "new" operator
As we known, cc have enough "class inherited relation" information:
with the code :
class B {};
class D1 : public B {};
class D2 : B {};
class E : public D1 {};
cc got a very good parse result (look the image). so what I want is :
step1 : E = new | << here I press the space key...
step 2 : cc do a parse, and found the "new" , and find the "=" ..and find the "E" .. NOW cc can easy to show a list seems like:
E = new |
| E |
| D1 |
| B |
:)
--------------
I like C::B. and thinks for you and Loaden do a lot work for c::b.
I hope I can do more work for c::b..
but I'm too busy .... :(.. and my english is too bad...:(((((
[attachment deleted by admin]