User story #16449
closed
fuzzy matching to help with error messages
Added by Gaëtan POBLON almost 5 years ago.
Updated over 4 years ago.
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.
- 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 ?
- Assignee changed from Benoît PECCATTE to Gaëtan POBLON
- Target version set to 6.1.0~beta1
- Status changed from Pending technical review to Pending release
- Status changed from Pending release to Resolved
- Name check changed from To do to Reviewed
- Fix check changed from To do to Checked
Also available in: Atom
PDF