Rename grammar "definition" to "relation"

This commit is contained in:
2026-04-30 19:24:11 -06:00
parent ef8a34f886
commit d5d6ce924c
6 changed files with 93 additions and 93 deletions

View File

@@ -50,7 +50,7 @@ pub fn items<'db>(db: &'db dyn Database, file: workspace::File) -> Vec<ItemMeta<
// otherwise, convert the symbol directly into the item kind
"type_alias" => ItemKind::TypeAlias,
"import" => ItemKind::Import,
"definition" => ItemKind::Relation, // TODO: rename grammar node
"relation" => ItemKind::Relation,
"rule" => ItemKind::Rule,
"assumption" => ItemKind::Assumption,
@@ -115,7 +115,7 @@ pub enum Item<'db> {
/// Parses [Relation] from an [AstNode].
#[salsa::tracked]
pub fn relation<'db>(db: &'db dyn Database, ast: AstNode) -> Relation<'db> {
let name = ast.expect_field(db, "relation").with_contents(db);
let name = ast.expect_field(db, "name").with_contents(db);
let is_decision = ast.get_field(db, "decision").is_some();
let ty = ty(db, ast.expect_field(db, "type"));
Relation::new(db, name, is_decision, ty)