Most of the language plugins use textmate style code highlighting which is mostly based on regex matching.
Sourcekitten/sourcekit can provide this information based on the AST which is how Xcode does it.
Super helpful in swift since it allows shadowing.