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
21
sc/Emacs.sc
21
sc/Emacs.sc
|
@ -199,7 +199,20 @@ EmacsInterface {
|
|||
name -> devpath
|
||||
})
|
||||
.put( \helpSymbols, {
|
||||
var result = IdentitySet.newFrom(SCDoc.docMap.keys);
|
||||
var result, dt;
|
||||
|
||||
dt = {
|
||||
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.allClasses.do { | class |
|
||||
if (class.isMetaClass.not) {
|
||||
result.add(class.name.asString);
|
||||
|
@ -208,7 +221,11 @@ EmacsInterface {
|
|||
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