feat: choose project or session for text commands
This commit is contained in:
@@ -8,9 +8,12 @@ export function mappingRoot(key: string, mapping: PlaceholderMapping): string {
|
||||
while (mapping[current].merged_into) {
|
||||
if (seen.has(current)) throw new Error(`Zyklische Zuordnung: ${key}`);
|
||||
seen.add(current);
|
||||
const target = mapping[current].merged_into!;
|
||||
const reference = mapping[current].merged_into!;
|
||||
const target = mapping[reference] ? reference
|
||||
: mapping[`<${reference.replace(/^<|>$/g, "")}>`] ? `<${reference.replace(/^<|>$/g, "")}>`
|
||||
: reference.replace(/^<|>$/g, "");
|
||||
if (!mapping[target] || mapping[target].type !== initial.type) {
|
||||
throw new Error(`Ungültiger Hauptbegriff für ${key}: ${target}`);
|
||||
throw new Error(`Ungültiger Hauptbegriff für ${key}: ${reference}`);
|
||||
}
|
||||
current = target;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user