[Cuis-dev] Find with Scope
Jon Raiford
raiford at labware.com
Mon Dec 30 05:58:22 PST 2024
Hi Hilaire,
I tried to just add the scope part. I really don’t use the modifier keys. That logic was all brought over from the original code. Maybe we need to grab their state before displaying the scope prompt? Btw, I’d ultimately like to see this be an integrated dialog that has the search text and the scope in one place. It could also then show checkboxes in place of the modifier keys to make it more intuitive / intuitable.
Jon
From: Cuis-dev <cuis-dev-bounces at lists.cuis.st> on behalf of Hilaire Fernandes via Cuis-dev <cuis-dev at lists.cuis.st>
Date: Sunday, December 29, 2024 at 5:32 AM
To: cuis-dev at lists.cuis.st <cuis-dev at lists.cuis.st>
Cc: Hilaire Fernandes <hfern at free.fr>
Subject: Re: [Cuis-dev] Find with Scope
This is useful, thanks. Some features, need to be documented thought (where?) when I read this method below. I did not find how to use the Shift or Ctrl alternatives. Pressing on of those prevent the search to start.
browseMethodsWithSourceString: aString
scopeClass: scopeClass
includeSubclasses: includeSubclasses
includeSuperclasses: includeSuperclasses
"Smalltalk browseMethodsWithSourceString: 'SourceString' "
"Launch a browser on all methods whose source code contains aString as a substring."
| caseSensitive suffix selectString |
Sensor controlKeyPressed ifTrue: [
selectString := ((aString findTokens: '*') sorted: [ :a :b | a size > b size ]) first.
^ self
browseMessageList: (self allMethodsSourceStringMatching: '*', aString, '*')
name: 'Methods matched by ' , aString printString , ' (no ctrl for exact match)'
autoHighlight: selectString
allOccurrences: true
].
suffix := (caseSensitive := Sensor shiftPressed)
ifTrue: [' (case-sensitive. Use ctrl for $* pattern match.)']
ifFalse: [' (shift for case-sensitive. ctrl for $* pattern match.)'].
^ self
browseMessageList: (self allMethodsWithSourceString: aString matchCase: caseSensitive scopeClass: scopeClass includeSubclasses: includeSubclasses includeSuperclasses: includeSuperclasses)
name: 'Methods containing ' , aString printString , suffix
autoHighlight: aString
allOccurrences: true.
Le 25/11/2024 à 19:47, Juan Vuletich via Cuis-dev a écrit :
I recently replaced the 'Method Source with it' menu option in Smalltalk Editors with the new 'Find with Scope' option by Jon Raiford. I'm sure it is more convenient and useful. Please try it and share your thoughts.
I have also been doing other tweaks to improve usability, for instance 'browse package' on all four lists in the Browser, and minor tweaks here and there. Feedback is most welcome as usual.
--
http://mamot.fr/@drgeo<http://mamot.fr/@drgeo>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20241230/b6eda196/attachment-0001.htm>
More information about the Cuis-dev
mailing list