rstudio/rstudio — pull request #220 by kevinushey (2014-11-20 18:19:06+00:00)
Title: limit number of evaluations when inferring completion type

This fixes an undesired behaviour where `rsession` could lock up when attempting to evaluate a large number of items to infer the type. We do two things:

1. We first limit the names we want to evaluate using fuzzy matching on the token (previously, we just evaluated all the potential names, then narrowed the list -- this should be more efficient),
2. We only perform evaluation to get types if we have less than 200 entries in the object (should be good enough 99.9% of the time).

I think we should do some similar throttling in the UI as well; e.g. don't do automatic popup completions if the completion list is over some size -- but allow the user to request it explicitly. Note that e.g. with 10000 completion items to display this will lock up the UI for a couple seconds, though.