Project

General

Profile

Actions

User story #16449

closed

fuzzy matching to help with error messages

User story #16449: fuzzy matching to help with error messages

Added by Gaëtan POBLON almost 6 years ago. Updated over 5 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.

Updated by Gaëtan POBLON almost 6 years ago Actions #1

  • 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 6 years ago Actions #2

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

Updated by Gaëtan POBLON almost 6 years ago Actions #3

  • Target version set to 6.1.0~beta1

Updated by Anonymous almost 6 years ago Actions #4

  • Status changed from Pending technical review to Pending release

Updated by Anonymous almost 6 years ago Actions #5

Updated by Anonymous almost 6 years ago Actions #6

Updated by Gaëtan POBLON almost 6 years ago Actions #7

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

Updated by François ARMAND over 5 years ago Actions #8

  • Fix check changed from To do to Checked
Actions

Also available in: PDF Atom