Optimization in code completion for extensions