Patent attributes
A code completion tool uses machine learning models to more precisely predict the likelihood of a method invocation completing a code fragment that follows one or more method invocations of different classes in a same document during program development. In one aspect, the machine learning model is a n-order Markov chain model that is trained on features that represent characteristics of the context of method invocations found in commonly-used programs from a sampled population. The machine learning model is implemented as a hash table contained a ranked order of hash values in descending order of probability of completing a partially-formed method invocation.