I believe code editor to be called one must be designed to work with the code and provide standard facilities to manipulate upon it. The rest is for particular language support module that'd recognize semantics and do the transformations.
For example, the very core must have option to bind language module-provided semantics data to text fragments, so, say, highlighter (a proper one, not a TextMate-like mess of regexps) would base its work upon knowing not only "syntax regexp says this is a variable" but "semantic analyzer says this is a variable `foo`, and it's also used here and there, too (but not there, it's another scope), if that matters", while remaining generic.
(Edited: minor re-formatting)