Refactor the code completion support

* adds the new icons
* uses strongly-typed classes (enums) when possible
* uses getNameOrDottedNameSpan to determine the text up to the name
being completed