Project

General

Profile

Actions

User story #16449

closed

fuzzy matching to help with error messages

Added by Gaëtan POBLON over 4 years ago. Updated almost 4 years ago.

Status:
Resolved
Priority:
N/A
Assignee:
Gaëtan POBLON
Category:
rudderc
Target version:
UX impact:
Suggestion strength:
User visibility:
Effort required:
Name check:
Reviewed
Fix check:
Checked
Regression:

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.

Actions #1

Updated by Gaëtan POBLON over 4 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 ?

Actions #2

Updated by Benoît PECCATTE over 4 years ago

  • Assignee changed from Benoît PECCATTE to Gaëtan POBLON
Actions #3

Updated by Gaëtan POBLON over 4 years ago

  • Target version set to 6.1.0~beta1
Actions #4

Updated by Anonymous over 4 years ago

  • Status changed from Pending technical review to Pending release
Actions #5

Updated by Anonymous over 4 years ago

Actions #6

Updated by Anonymous over 4 years ago

Actions #7

Updated by Gaëtan POBLON about 4 years ago

  • Status changed from Pending release to Resolved
  • Name check changed from To do to Reviewed
Actions #8

Updated by François ARMAND almost 4 years ago

  • Fix check changed from To do to Checked
Actions

Also available in: Atom PDF