cedar-policy / cedar

Implementation of the Cedar Policy Language
https://www.cedarpolicy.com
Apache License 2.0
889 stars 80 forks source link

Suggest method in unknown extension method errors #1289

Closed adpaco-aws closed 4 weeks ago

adpaco-aws commented 4 weeks ago

Description of changes

This PR extends unknown method errors with a hint that suggests the closest method from the ones available based on the fuzzy string matching algorithm used to make similar suggestions. This recommendation uses the "limited" version of the fuzzy matching algorithm to avoid suggestions which wouldn't be too helpful. To put it simply, this PR is like #1280 but for methods.

Resolves #246

Checklist for requesting a review

The change in this PR is (choose one, and delete the other options):

I confirm that this PR (choose one, and delete the other options):

I confirm that cedar-spec (choose one, and delete the other options):

I confirm that docs.cedarpolicy.com (choose one, and delete the other options):