[Pharo-project] Syntax extension for the Mercury Search bar
OK, for those who don't know it, there is a nifty search tool in Omnibrowser, called the Mercury search bar, which comes at the top of OB (you can enabled it through Settings if it does not appear). As a remainder, this is what you can do from the search bar. Type: ClassName (starts with uppercase, look up class definition) #ClassName (look up references to ClassName) methodName (starts with lowercase, look up implementors of methodName) #methodName (look up senders of methodName) - 'string' (look up for string in methods (not the same as look up in method source, which is much slower)) The search bar also works with completion, so it doubles as a useful launch bar actually. Two things I would like to have: 1) look for package/system category 2) scope search, or environment search (open an environment on the given scope before starting the search) (3) ok a third, look for class hierarchy) Now for the first, any idea about an easy syntax to express a package search? I don't want to mix class and package search. So I was thinking of $PackageName or %PackageName, especially the first as it can not be recognized as a binary selector, but it looks weird. Second, I'm wondering about an inline syntax for scoping, like: methodName in: #PackageA -> will lookup for implementors of methodName in PackageA or simply cutting the Mercury textfield in two, with one for the search term and one for the scope) Any idea welcomed -- Simon
As a remainder, this is what you can do from the search bar. Type: Â ClassName (starts with uppercase, look up class definition) Â #ClassName (look up references to ClassName) Â methodName (starts with lowercase, look up implementors of methodName) Â #methodName (look up senders of methodName) - 'string' (look up for string in methods (not the same as look up in method source, which is much slower))
There is another one if you have the refactoring tools loaded. If the expression contains a backquote it searches for parse tree patterns, e.g. `@expr instVarNamed: `#string finds all the senders of #instVarNamed: that have a plain string-literal as its argument.
The search bar also works with completion, so it doubles as a useful launch bar actually.
The fact that completion works is quite accidental and should be improved :-)
Any idea welcomed
Actually, Colin and I were discussing about removing the Mercury panel. We observed that almost nobody uses or knows how to use it. I personally never use it, I find other ways to navigate much more efficient and simpler to perform without the need of typing cryptographic sequences of characters :-) The mercury panel is highly extensible, so maybe it would make sense to move it into an externally maintained package? Lukas -- Lukas Renggli www.lukas-renggli.ch
participants (2)
-
Lukas Renggli -
Simon Denier