Add new pref maxCodeHints

For #9529.
I confirmed this is a performance boost for Code Hints.
This `maxCodeHints` validation code should be moved to `CodeHintList` so all validation is done in 1 place.