Implement text expanding with snippets