Author Topic: discarding completions  (Read 8741 times)

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
discarding completions
« 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?

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: discarding completions
« Reply #1 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.