Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => CodeCompletion redesign => Topic started by: dmoore on May 13, 2014, 11:57:02 pm

Title: discarding completions
Post by: dmoore on May 13, 2014, 11:57:02 pm
Question for alpha...

Sometimes my python CC will take a long time to respond and by the time it has I have arrowed away from the position, but then get a irrelevant popups in the new position. What is the best way to check if i should show a completion?
Title: Re: discarding completions
Post by: Alpha on May 14, 2014, 04:39:33 am
Probably store the tknStart parameter when launching the request, then when it returns, only display if the new tknStart is the same as the stored one.  (You may need to re-filter the list by prefix (or whatever heuristic you choose) before returning the list, but that operation will be comparatively fast.)

By the way, you can make a call to CCManager::RegisterAutoLaunchChars() if codecompletion is being requested in irrelevant situations.  Also of note, use tknEnd instead of control->GetCurrentPos(), even though they are often the same value, CCManager does not guarantee it.