!7 p-experiment { makeSFSynonym("setTextAndSelectAll", "setTextSelectAll"); } svoid makeSFSynonym(S oldName, S newName) { S snippetID = stdFunctions_cached().get(oldName); if (snippetID == null) fail("Standard function " + oldName + " not found"); L tok = javaTok(loadSnippet (snippetID)); LL funcs = findFullFunctionDefs(tok, true); new L out; for (L tokF : funcs) { int i = indexOfAny(tokF, 0, "(", "{"); if (i < 0) continue; S fname = get(tok, i-2); if (!eq(fname, oldName)) continue; L args = tok_parseArgsList(tokF); jreplace(tokF, oldName, newName); out.add(joinSubList(tok, 0, i) + "(" + args + ") {\n" + " ret " + oldName + "(" + args + ");\n" + "}"); } print(); printIndent(joinWithEmptyLines(out)); }