Smart completion to ignore context after the caret
Completion: better replacement range calculation for both basic and smart completions