M: Broaden substitution suggestions

Allow constituents with no links to other constituents
This commit is contained in:
Ivan 2024-11-15 20:44:56 +03:00
parent 92822ccd8e
commit 1650e81751

View File

@ -125,11 +125,11 @@ export class SubstitutionValidator {
if (this.originals.has(cst.id)) { if (this.originals.has(cst.id)) {
continue; continue;
} }
if (cst.cst_class === CstClass.BASIC) { if (cst.cst_class === CstClass.BASIC || cst.definition_formal.length === 0) {
continue; continue;
} }
const inputs = schema.graph.at(cst.id)!.inputs; const inputs = schema.graph.at(cst.id)!.inputs;
if (inputs.length === 0 || inputs.some(id => !this.constituents.has(id))) { if (inputs.some(id => !this.constituents.has(id))) {
continue; continue;
} }
if (inputs.some(id => this.originals.has(id))) { if (inputs.some(id => this.originals.has(id))) {