Should this be a helper function in CodeHintManager instead of having a copy in every extension?