Hi, Mansimar. I don't work on code completion myself, but my recollection was that the results are always computed for the start location of the identifier, ignoring any text that may have already been typed. This is because SourceKit is meant to have an IDE as a client, and so to minimize traffic between SourceKit and the IDE it's better to have a simple filter on the client side than to send multiple requests every time the user types a key (especially backspace!).
SourceKitten may or may not want to follow that philosophy, but that should at least explain what's going on.
Best,
Jordan
···
On Jul 24, 2017, at 08:46, Mansimar Kaur via swift-dev <swift-dev@swift.org> wrote: