Feature to show completion for the selected text

This feature allows users to get autoCompletion for the selected text which would replace the selected text with the selected option from completion widget.
Earlier user has to select , then delete the keyword and then exec autoCompletion to achieve, Now with this feature once can easily get the completions for the selected text.

Please review the code and give comment on the feature.

Thank you
Dheeraj