Implement priority based clearsnippets.

Implement priority-based clearsnippets and add corresponding test cases (#335).
This method is pulled-up from file-based snippet source: it ensures the snippet information is always updated when the user is trying to expand any snippet.

No, it should do nothing for non file-based snippet source.