init codes which basically achieve the function of smart-complete
add a demo which in /examples folder