Fixed with doc changes and query requests made out of sequence

When a freshly open document is changed, the changes were processed
after the request for hints, which was causing incorrect hints being
generated.