Implement rule-based Studio creation, usable canvas and Reader, and consolidated package authoring
This commit is contained in:
@@ -210,7 +210,8 @@ export const editStructure = (source: string, edit: StructuralEdit): string => {
|
||||
return source;
|
||||
}
|
||||
const identifiers = node.children.filter((entry) => entry.kind === "identifier");
|
||||
const position = identifiers[identifiers.length - 1].end;
|
||||
const targetArguments = node.children.find((entry) => entry.kind === "typeArguments");
|
||||
const position = targetArguments?.end ?? identifiers[identifiers.length - 1].end;
|
||||
result = applySourceEdits(source, [{ start: position, end: position, text: ` id ${JSON.stringify(edit.id)}` }]);
|
||||
} else if (edit.operation === "append") {
|
||||
const closing = syntax.tokens.find((token) => token.kind === "RBRACE" && token.end === node.end);
|
||||
|
||||
Reference in New Issue
Block a user