scel: speedup indexing of help topics
instead of asking SCDoc to index all help topics, we guess the topics by matching schelp paths Signed-off-by: Tim Blechmann <tim@klingt.org>
This commit is contained in:
parent
fef0729223
commit
1f339518ab
1 changed files with 25 additions and 8 deletions
33
sc/Emacs.sc
33
sc/Emacs.sc
|
@ -199,16 +199,33 @@ EmacsInterface {
|
||||||
name -> devpath
|
name -> devpath
|
||||||
})
|
})
|
||||||
.put( \helpSymbols, {
|
.put( \helpSymbols, {
|
||||||
var result = IdentitySet.newFrom(SCDoc.docMap.keys);
|
var result, dt;
|
||||||
Class.allClasses.do { | class |
|
|
||||||
if (class.isMetaClass.not) {
|
dt = {
|
||||||
result.add(class.name.asString);
|
result = IdentitySet.new(16384);
|
||||||
|
SCDoc.helpSourceDirs.do {|dir|
|
||||||
|
var list = ("%/*/*.schelp").format(dir).pathMatch;
|
||||||
|
list = list ++ ("%/*/*/*.schelp").format(dir).pathMatch;
|
||||||
|
list = list ++ ("%/*/*/*/*.schelp").format(dir).pathMatch;
|
||||||
|
list = list.collect {|path| path.asRelativePath(dir).removeExtension};
|
||||||
|
list.do {|topic|
|
||||||
|
result.add(topic)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
class.methods.do { | method |
|
|
||||||
result.add(method.name.asString);
|
Class.allClasses.do { | class |
|
||||||
|
if (class.isMetaClass.not) {
|
||||||
|
result.add(class.name.asString);
|
||||||
|
};
|
||||||
|
class.methods.do { | method |
|
||||||
|
result.add(method.name.asString);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
result.asArray
|
result = result.asArray
|
||||||
|
}.bench(false);
|
||||||
|
"Emacs: Index help topics in % seconds\n".postf(dt.asStringPrec(3));
|
||||||
|
result
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue