Nice catch re wxString, just need to sort alphabetically for equal priority items?
The problem is, CalcValue() (which is tries to nearly replicate/quantify the algorithm YCM designed) gives wxString a worse value because its word boundary string is only "ws" (whereas wxSTRING_REVERSE_ITERATOR for example is "wsri", more closely matching the input). (Items with equal priority *should* already be in alphabetical order, assuming my implementation works the way I think it does.)
Unfortunately, re-balancing the weighting algorithm would probably cause it to lose the benefit it gives in most other cases. (I am tempted to hardcode a small score boost for wxString, because it is rather common in wxWidgets based code... but that could get even uglier if other similar problem tokens show up.)
There are almost certainly going to be similar problems, so don't hardcode. How about doing Acronym matching as a separate, alternative calculation that only gets used if it would create a higher score?
example: user types wxs, candidates (and their acronyms) are
wxString -> wS
wxStringHelper -> wSH
wantsXtraStr ->wxS
wxstring0 -> no acronym
You compute a score for wxString (3 matches at the start), a score for wS (no matches) and take the higher score => 3 prefix matches (I'm abstracting from the exact numeric score you might give this)
You compute a score for wxStringHelper (3 matches at the start), a score for wSH (no matches) and take the higher score => 3 prefix matches
You compute a score for wantsXtraStr (3 partial matches), a score for wxS (3 prefix matches) and take the higher score => 3 prefix matches
You compute a score for wxstring (3 matches at the start), there's no acronym so ignore => 3 prefix matches
So in this case all 3 would have an equal score, so they should appear alphabetically (you could also slightly penalize acronym match, because it isn't as intuitive as a straight prefix match).