Hi,ollydbg,thank you for your reply.Is there a special edition when revision reaches 10000? 
I don't know, you may ask our release managers.

I've tested the new revision,but it looks like that the bug is not fixed yet.
Now code completion's setting can be saved correctly, but the setting does not take effect at all.
e.g, I disable the code completion first,then restart IDE.When opening a project and trying to type
something, code completion window poped up unexpected.
I'm sorry I can't upload two attachments once so I merge them into one.
This is another but, currently all the codecompletion's settings were related to CodeCompletion plugin, not the SDK.
We have a general code completion interface in SDK(this was done by our dev Alpha), so I see that the SDK should have some options for this.
I just debugged a little.
At F:\cb_sf_git\trunk\src\plugins\codecompletion\codecompletion.cpp:927
[debug]> bt 30
[debug]#0 CodeCompletion::GetAutocompList (this=0x6ceb368, isAuto=true, ed=0x14f76e80, tknStart=@0x22f8cc: 46, tknEnd=@0x22f8d0: 46) at F:\cb_sf_git\trunk\src\plugins\codecompletion\codecompletion.cpp:927
[debug]#1 0x0109f09b in CCManager::OnCompleteCode (this=0x14f291a8, event=...) at F:\cb_sf_git\trunk\src\sdk\ccmanager.cpp:427
[debug]#2 0x0129e4ab in cbEventFunctor<CCManager, CodeBlocksEvent>::Call (this=0x14f2ecc8, event=...) at F:\cb_sf_git\trunk\src\include\cbfunctor.h:49
[debug]#3 0x01108c2a in Manager::ProcessEvent (this=0x52fbda0, event=...) at F:\cb_sf_git\trunk\src\sdk\manager.cpp:263
[debug]#4 0x010a1ec6 in CCManager::OnTimer (this=0x14f291a8, event=...) at F:\cb_sf_git\trunk\src\sdk\ccmanager.cpp:957
[debug]#5 0x627015f1 in wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#6 0x6276a07e in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#7 0x6276a457 in wxEvtHandler::SearchDynamicEventTable(wxEvent&) () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#8 0x6276a514 in wxEvtHandler::ProcessEvent(wxEvent&) () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#9 0x62837a80 in wxTimerBase::Notify() () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#10 0x62799836 in wxTimerWndProc(HWND__*, unsigned int, unsigned int, long)@16 () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#11 0x7e418734 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll
[debug]#12 0x00030a6c in ?? ()
[debug]#13 0x00000113 in ?? ()
[debug]#14 0x00000009 in ?? ()
[debug]#15 0x00000000 in ?? ()
[debug]>>>>>>cb_gdb:
And the code:
std::vector<CodeCompletion::CCToken> CodeCompletion::GetAutocompList(bool isAuto, cbEditor* ed, int& tknStart, int& tknEnd)
{
std::vector<CCToken> tokens;
if (!IsAttached() || !m_InitDone)
return tokens;
cbStyledTextCtrl* stc = ed->GetControl();
const int style = stc->GetStyleAt(tknEnd);
const wxChar curChar = stc->GetCharAt(tknEnd - 1);
if (isAuto) // filter illogical cases of auto-launch
{
if ( ( curChar == wxT(':') // scope operator
&& stc->GetCharAt(tknEnd - 2) != wxT(':') )
|| ( curChar == wxT('>') // '->'
&& stc->GetCharAt(tknEnd - 2) != wxT('-') )
|| ( wxString(wxT("<\"/")).Find(curChar) != wxNOT_FOUND // #include directive
&& !stc->IsPreprocessor(style) ) )
{
return tokens;
}
}
const int lineIndentPos = stc->GetLineIndentPosition(stc->GetCurrentLine());
const wxChar lineFirstChar = stc->GetCharAt(lineIndentPos);
if (lineFirstChar == wxT('#'))
{
const int startPos = stc->WordStartPosition(lineIndentPos + 1, true);
const int endPos = stc->WordEndPosition(lineIndentPos + 1, true);
const wxString str = stc->GetTextRange(startPos, endPos);
if (str == wxT("include") && tknEnd > endPos)
{
DoCodeCompleteIncludes(ed, tknStart, tknEnd, tokens);
}
else if (endPos >= tknEnd && tknEnd > lineIndentPos)
DoCodeCompletePreprocessor(tknStart, tknEnd, ed, tokens);
else if ( ( str == wxT("define")
|| str == wxT("if")
|| str == wxT("ifdef")
|| str == wxT("ifndef")
|| str == wxT("elif")
|| str == wxT("elifdef")
|| str == wxT("elifndef")
|| str == wxT("undef") )
&& tknEnd > endPos )
{
DoCodeComplete(tknEnd, ed, tokens, true);
}
return tokens;
}
else if (curChar == wxT('#'))
return tokens;
else if (lineFirstChar == wxT(':') && curChar == _T(':'))
return tokens;
if ( stc->IsString(style)
|| stc->IsComment(style)
|| stc->IsCharacter(style)
|| stc->IsPreprocessor(style) )
{
return tokens;
}
DoCodeComplete(tknEnd, ed, tokens);
return tokens;
}
Here, we can add a if condition to solve(workaround) this issue.
std::vector<CodeCompletion::CCToken> CodeCompletion::GetAutocompList(bool isAuto, cbEditor* ed, int& tknStart, int& tknEnd)
{
std::vector<CCToken> tokens;
if (!IsAttached() || !m_InitDone || Code suggestion is not allowed)
return tokens;
But I think the condition should be put in SDK, not the single codecompletion plugin.
EDIT:We can use this variable
// for CC
m_UseCodeCompletion = cfg->ReadBool(_T("/use_code_completion"), true);
Similar like the usage below:
void CodeCompletion::EditorEventHook(cbEditor* editor, wxScintillaEvent& event)
{
if (!IsAttached() || !m_InitDone || !m_UseCodeCompletion)
{
event.Skip();
return;
}
if ( !IsProviderFor(editor) )
{
event.Skip();
return;
}
cbStyledTextCtrl* control = editor->GetControl();
if (event.GetEventType() == wxEVT_SCI_CHARADDED)
{ TRACE(_T("wxEVT_SCI_CHARADDED")); }
else if (event.GetEventType() == wxEVT_SCI_CHANGE)
{ TRACE(_T("wxEVT_SCI_CHANGE")); }
else if (event.GetEventType() == wxEVT_SCI_KEY)
{ TRACE(_T("wxEVT_SCI_KEY")); }
else if (event.GetEventType() == wxEVT_SCI_MODIFIED)
{ TRACE(_T("wxEVT_SCI_MODIFIED")); }
else if (event.GetEventType() == wxEVT_SCI_AUTOCOMP_SELECTION)
{ TRACE(_T("wxEVT_SCI_AUTOCOMP_SELECTION")); }
else if (event.GetEventType() == wxEVT_SCI_AUTOCOMP_CANCELLED)
{ TRACE(_T("wxEVT_SCI_AUTOCOMP_CANCELLED")); }
if ( m_NativeParser.GetParser().Options().whileTyping
&& ( (event.GetModificationType() & wxSCI_MOD_INSERTTEXT)
|| (event.GetModificationType() & wxSCI_MOD_DELETETEXT) ) )
{
m_NeedReparse = true;
}
if (control->GetCurrentLine() != m_CurrentLine)
{
if (m_NeedReparse)
{
TRACE(_T("CodeCompletion::EditorEventHook: Starting m_TimerRealtimeParsing."));
m_TimerRealtimeParsing.Start(REALTIME_PARSING_DELAY, wxTIMER_ONE_SHOT);
m_CurrentLength = control->GetLength();
m_NeedReparse = false;
}
if (event.GetEventType() == wxEVT_SCI_UPDATEUI)
{
m_ToolbarNeedRefresh = true;
TRACE(_T("CodeCompletion::EditorEventHook: Starting m_TimerToolbar."));
if (m_TimerEditorActivated.IsRunning())
m_TimerToolbar.Start(EDITOR_ACTIVATED_DELAY + 1, wxTIMER_ONE_SHOT);
else
m_TimerToolbar.Start(TOOLBAR_REFRESH_DELAY, wxTIMER_ONE_SHOT);
}
}
// allow others to handle this event
event.Skip();
}