feat(hint): clause-concept hints layered on F1 (issue #37)
Add a hint.concept.* tier-3 layer surfaced when the cursor sits inside a recognized clause (referential actions, 1:n/m:n cardinality, primary key, unique, check, foreign key), layered beneath the per-form block. New Node::Concept grammar wrapper records clause byte-spans; concept_topic_at_cursor resolves the innermost containing span. Examples are mode-keyed so they stay syntax-correct in both simple and advanced mode. Draft ADR (number at merge).
This commit is contained in:
@@ -133,12 +133,25 @@ pub const ON_CLAUSE: Node = Node::Seq(ON_CLAUSE_NODES);
|
||||
/// Repeated `on <target> <action>` clauses (0..2 occurrences).
|
||||
/// Validation of "specified twice" + max=2 lives in the
|
||||
/// command's AST builder.
|
||||
pub const REFERENTIAL_CLAUSES: Node = Node::Repeated {
|
||||
const REFERENTIAL_CLAUSES_INNER: Node = Node::Repeated {
|
||||
inner: &ON_CLAUSE,
|
||||
separator: None,
|
||||
min: 0,
|
||||
};
|
||||
|
||||
/// As [`REFERENTIAL_CLAUSES_INNER`], tagged as the
|
||||
/// `referential_actions` clause-concept region (issue #37).
|
||||
///
|
||||
/// Shared by the simple-mode `add 1:n relationship … on delete/update`
|
||||
/// and the advanced-mode `references … on delete/update` clause, so the
|
||||
/// one wrapper surfaces the concept in both modes (the mode-keyed
|
||||
/// example is chosen by the live mode at F1 time, not by which grammar
|
||||
/// matched).
|
||||
pub const REFERENTIAL_CLAUSES: Node = Node::Concept {
|
||||
topic: "referential_actions",
|
||||
inner: &REFERENTIAL_CLAUSES_INNER,
|
||||
};
|
||||
|
||||
// =================================================================
|
||||
// Typed value slots (ADR-0024 §Phase D, §typed-value-slots)
|
||||
// =================================================================
|
||||
|
||||
Reference in New Issue
Block a user