Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-cmm.849.mcz ==================== Summary ==================== Name: Tools-cmm.849 Author: cmm Time: 25 May 2019, 5:49:45.269032 pm UUID: 4e35d5b2-3233-4b12-8419-2476ff4d09e0 Ancestors: Tools-nice.847 - Fix from Tim Johnson prevents a DNU from ChangeSorter under certain conditions. - Add ability to filter methods from a MessageSet based on package they're NOT in (helpful for filtering test methods, or identifying methods in the wrong package). =============== Diff against Tools-nice.847 =============== Item was changed: ----- Method: ChangeSorter>>setContents (in category 'code pane') ----- setContents "return the source code that shows in the bottom pane" | sel class strm changeType | self clearUserEditFlag. + myChangeSet ifNil: [^ contents := String empty]. "should not happen but can" + currentClassName ifNil: [^ contents := myChangeSet preambleString ifNil: [String empty]]. - currentClassName ifNil: [^ contents := myChangeSet preambleString ifNil: ['']]. class := self selectedClassOrMetaClass. (sel := self selectedMessageName) == nil ifFalse: [changeType := (myChangeSet atSelector: (sel := sel asSymbol) class: class). changeType == #remove ifTrue: [^ contents := 'Method has been removed (see versions)']. changeType == #addedThenRemoved ifTrue: [^ contents := 'Added then removed (see versions)']. class ifNil: [^ contents := 'Method was added, but cannot be found!!']. (class includesSelector: sel) ifFalse: [^ contents := 'Method was added, but cannot be found!!']. contents := class sourceCodeAt: sel. (#(prettyPrint prettyDiffs) includes: contentsSymbol) ifTrue: [contents := class prettyPrinterClass format: contents in: class notifying: nil]. self showingAnyKindOfDiffs ifTrue: [contents := self diffFromPriorSourceFor: contents]. ^ contents := contents asText makeSelectorBoldIn: class] ifTrue: [strm := WriteStream on: (String new: 100). (myChangeSet classChangeAt: (self withoutItemAnnotation: currentClassName)) do: [:each | each = #remove ifTrue: [strm nextPutAll: 'Entire class was removed.'; cr]. each = #addedThenRemoved ifTrue: [strm nextPutAll: 'Class was added then removed.']. each = #rename ifTrue: [strm nextPutAll: 'Class name was changed.'; cr]. each = #add ifTrue: [strm nextPutAll: 'Class definition was added.'; cr]. each = #change ifTrue: [strm nextPutAll: 'Class definition was changed.'; cr]. each = #reorganize ifTrue: [strm nextPutAll: 'Class organization was changed.'; cr]. each = #comment ifTrue: [strm nextPutAll: 'New class comment.'; cr. ]]. ^ contents := strm contents].! Item was changed: ----- Method: MessageSet>>filterMessageList (in category 'filtering') ----- filterMessageList "Allow the user to refine the list of messages." | builder menuSpec | builder := ToolBuilder default. menuSpec := builder pluggableMenuSpec new model: self; yourself. menuSpec addList: #( ('unsent messages' filterToUnsentMessages 'filter to show only messages that have no senders') - ('messages that send...' filterToSendersOf 'filter to show only messages that send a selector I specify') ('messages that do not send...' filterToNotSendersOf 'filter to show only messages that do not send a selector I specify') - ('messages whose selector is...' filterToImplementorsOf 'filter to show only messages with a given selector I specify') ('messages whose selector is NOT...' filterToNotImplementorsOf 'filter to show only messages whose selector is NOT a seletor I specify') - ('messages in current change set' filterToCurrentChangeSet 'filter to show only messages that are in the current change set') ('messages not in current change set' filterToNotCurrentChangeSet 'filter to show only messages that are not in the current change set') - ('messages in any change set' filterToAnyChangeSet 'filter to show only messages that occur in at least one change set') ('messages not in any change set' filterToNotAnyChangeSet 'filter to show only messages that do not occur in any change set in the system') - ('messages authored by me' filterToCurrentAuthor 'filter to show only messages whose authoring stamp has my initials') ('messages not authored by me' filterToNotCurrentAuthor 'filter to show only messages whose authoring stamp does not have my initials') - ('messages logged in .changes file' filterToMessagesInChangesFile 'filter to show only messages whose latest source code is logged in the .changes file') ('messages only in .sources file' filterToMessagesInSourcesFile 'filter to show only messages whose latest source code is logged in the .sources file') - ('messages with prior versions' filterToMessagesWithPriorVersions 'filter to show only messages that have at least one prior version') ('messages without prior versions' filterToMessagesWithoutPriorVersions 'filter to show only messages that have no prior versions') - ('uncommented messages' filterToUncommentedMethods 'filter to show only messages that do not have comments at the beginning') ('commented messages' filterToCommentedMethods 'filter to show only messages that have comments at the beginning') - ('messages in hardened classes' filterToMessagesWithHardenedClasses 'filter to show only messages of established classes (as opposed to Uniclasses such as Player23)') - ('methods in classes with matching names' filterToMatchingClassesNames 'filter to show only methods of classes with names that match the given criteria (wildcards are allowed)') ('methods in package...' filterToPackage 'filter to show only methods of a given package') + ('methods not in package...' filterToNotPackage 'filter to show only methods not of a given package') - ('messages that...' filterToMessagesThat 'let me type in a block taking a class and a selector, which will specify yea or nay concerning which elements should remain in the list')). builder runModal: (builder open: menuSpec).! Item was added: + ----- Method: MessageSet>>filterToNotPackage (in category 'filtering') ----- + filterToNotPackage + self requestPackageSelection ifNotNil: + [ : selectedPackage | self filterFrom: + [ : aClass : aSelector | (selectedPackage + includesMethod: aSelector + ofClass: aClass) not ] ]! Item was changed: ----- Method: MessageSet>>filterToPackage (in category 'filtering') ----- filterToPackage + self requestPackageSelection ifNotNil: + [ : selectedPackage | self filterFrom: + [ : aClass : aSelector | selectedPackage + includesMethod: aSelector + ofClass: aClass ] ]! - - | packages selectedIndex selectedPackage | - - packages := (PackageOrganizer default packages sort: [ :a :b | - a packageName <= b packageName ]). - - selectedIndex := UIManager default chooseFrom: (packages collect:[:each | each packageName]) lines: #() title: 'Select a package...'. - selectedIndex isZero ifTrue:[^ self]. - - selectedPackage := packages at: selectedIndex. - self filterFrom: [:aClass :aSelector | selectedPackage includesMethod: aSelector ofClass: aClass ] - ! Item was added: + ----- Method: MessageSet>>requestPackageSelection (in category 'private') ----- + requestPackageSelection + | packages selectedIndex | + packages := PackageOrganizer default packages sort: + [ : a : b | a packageName <= b packageName ]. + selectedIndex := UIManager default + chooseFrom: (packages collect: [ : each | each packageName ]) + lines: Array empty + title: 'Select a package...'. + ^ packages at: selectedIndex ifAbsent: [ nil ]! |
Free forum by Nabble | Edit this page |