User story #16449
closedfuzzy matching to help with error messages
Description
This feature will output more helpful error messages regarding tokens names, suggesting (when found) a similar name related to the same type.
It will apply to variables, resources names, states names, enums (I might add more cases if needed).
It would be nice to make sure context is taken into account so checks apply only to available and global types in a given scope.
Updated by Gaëtan POBLON about 5 years ago
- Status changed from New to Pending technical review
- Assignee changed from Gaëtan POBLON to Benoît PECCATTE
- Pull Request set to https://github.com/Normation/rudder/pull/2687
Done:
Fuzzy search function taking a token name (&str) and an iterator.
`ast::add_resources()`, if initialisation does not match any declaration
`ast::add_enum_mappings()`, if enum decl name doesn’t match parent decl name
`ast::add_children_list()`, if name not found when trying to define mapping
`enum::add_mapping()`, if an enum value does not match its parent value
`ast::enum()`, if an enum does not match any parent value
`ast::binding_check()`, if a resource type does not exist }
`ast::binding_check()` if a state does not exist for the related resource type
`enum::canonify_expression()` 7 additions
Todo-issues:
Parameter count check is done before binding check. So if a wrong resource type is sent we cannot know it because it will stop at params count if > 0. Maybe reverse the order
This is going on in `enum::fom_pstatement()`
Questions:
When do we enter ast::add_enum_mapping() err ?
How to test enum::canonify_expression, meaning comparisons ?
Updated by Benoît PECCATTE almost 5 years ago
- Assignee changed from Benoît PECCATTE to Gaëtan POBLON
Updated by Anonymous almost 5 years ago
- Status changed from Pending technical review to Pending release
Applied in changeset rudder|5f3588a94d7e92c20320292b810fafbd6f38ef2a.
Updated by Anonymous almost 5 years ago
Applied in changeset rudder|767034aaf6d68533df7d27e144700f7c05f9cb58.
Updated by Anonymous almost 5 years ago
Applied in changeset rudder|c7e903b139fd7bdbf179deb868c0b9caca98bbbb.
Updated by Gaëtan POBLON almost 5 years ago
- Status changed from Pending release to Resolved
- Name check changed from To do to Reviewed
Updated by François ARMAND over 4 years ago
- Fix check changed from To do to Checked