mun-lang / mun

Source code for the Mun language and runtime.
https://mun-lang.org
Other
1.87k stars 73 forks source link

Provide suggestions if a function cannot be found #412

Closed baszalmstra closed 1 year ago

baszalmstra commented 2 years ago

If a mun function cannot be found when trying to execute some Mun code via the runtime, include suggestions of correct function names.

Current Behaviour

https://github.com/mun-lang/mun/blob/cc839c3ce7727834b7b395ba8f0c2100d859b355/crates/mun_runtime/tests/functions.rs#L6-L28

Desired behavour The returned error message contains an additional line recommending the function name/path that's the closest match, something like:

help: there is a function with a similar name: `main`

Good first issue process:

If this is your first PR, welcome 🎉 😄

belagoesr commented 1 year ago

I'll be taking this one!