Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
CodeCompletion plugin
killerbot:
Something I just remembered.
A question to our CodeCompletion developers : with all the improvements in place, how difficult is it to have the following working correctly [no completion, nor type tooltips on certain scopes : scopes where the declaration occurs in the if/for, ...]
Examples :
--- Code: ---TiXmlHandle handle;
if(TiXmlElement* foo = handle.ToElement())
{
foo->doSomething();
}
for(int index =0 ; index < 10; ++index)
{
int bar = index;
}
--- End code ---
==> so type information and completion on : index, foo ...
ollydbg:
I know the current feature: if the parser meets a keyword (if or for or while), it just skip the whole body. and the parentheses behind these keyword were skipped too.
Is it possible that we just add these auto variables to the top-level function body? so they can be deleted when edit caret changed to another function body.
killerbot:
--- Quote from: ollydbg on April 20, 2011, 04:54:15 pm ---I know the current feature: if the parser meets a keyword (if or for or while), it just skip the whole body. and the parentheses behind these keyword were skipped too.
Is it possible that we just add these auto variables to the top-level function body? so they can be deleted when edit caret changed to another function body.
--- End quote ---
Does it skip the entire body ? I think not, local variables declared in the body do work, right ?
So basically, things between the "()" of an if, for, while, could be seen as a set of statements, all on the same line, and be treated scope wise as if they were inside the body ?
This sounds easy as an algorithm, but I guess reality is much more complicated ?
ollydbg:
Ok, You are right.
I find the logic:
--- Code: --- if (token == ParserConsts::kw_for)
{
if (!m_Options.useBuffer || m_Options.bufferSkipBlocks)
SkipToOneOfChars(ParserConsts::semicolonclbrace, true);
else
m_Tokenizer.GetToken(); //skip args
m_Str.Clear();
}
--- End code ---
We say, when we are parsing the function body to collect the auto variables, we has the option:
--- Code: ---m_Options.useBuffer==true
m_Options.bufferSkipBlocks==false
--- End code ---
So, finally
--- Code: ---m_Tokenizer.GetToken(); //skip args
--- End code ---
will be called.
The proposed way was:
--- Code: --- if (token == ParserConsts::kw_for)
{
if (!m_Options.useBuffer || m_Options.bufferSkipBlocks)
SkipToOneOfChars(ParserConsts::semicolonclbrace, true);
else
//m_Tokenizer.GetToken(); //skip args
GetAutoVariable();
m_Str.Clear();
}
--- End code ---
Well, the function GetAutoVariable() will read the args in the next parentheses, and catch the variables in you cases. Oh, I think Reading the auto variables is much LIKE reading the function arguments.
Any logic error???
MortenMacFly:
--- Quote from: ollydbg on April 21, 2011, 03:16:52 am ---
--- Code: --- GetAutoVariable();
--- End code ---
--- End quote ---
What is an "auto variable"? :shock:
Navigation
[0] Message Index
[#] Next page
Go to full version