Feature Request: Implement Levenshtein distance for tracking Cmake bugs.

Hey there,
I’ve been using CMake a lot for my projects, and recently came across the following error messages from Cmake while trying to compile it.


Now, notice where it says, “did you mean ‘update_enter’.” This is mentioned for all methods that are incorrectly defined. Wouldn’t it be better if in build time you could provide more relevant feedback to the user such that the methods incorrectly defined are the ‘closest’ in terms of available existing methods in the project? So, instead of ‘update_enter’ for all, it could be, ‘update_7’, update_8’, and ‘update_9’ for example (given those 3 methods are in the API).

Using Levenshtein is a great way of solving this problem. Besides the fact that it takes only O(n*m) to run, it’d also be very useful for intelligent communication b/w the compiler and the user.
What do y’all think? Is it too computationally expensive? Not too useful of a feature?
Would love to open a pull request if this makes sense.
Thanks!

These messages do not come from CMake but from the compiler. CMake tool cannot help on this particular point. Propose your help to compiler development team…

1 Like