Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.860.mcz
==================== Summary ====================
Name: Tools-mt.860
Author: mt
Time: 4 August 2019, 11:47:29.338314 am
UUID: 4c9375a7-9e2f-994f-b08e-7ccb3a620b9e
Ancestors: Tools-mt.859
Merges Tools-ct.855, which I moved to treated inbox due to ancestry issues.
"Addition to last commit: Style content in ContextVariablesInspector completely according to doItReceiver (highlight instvars correctly)"
=============== Diff against Tools-mt.859 ===============
Item was changed:
----- Method: ContextVariablesInspector>>aboutToStyle:forMorph: (in category 'styling') -----
aboutToStyle: aStyler forMorph: aMorph
+ (super aboutToStyle: aStyler forMorph: aMorph)
+ ifFalse: [^ false].
+ aStyler
+ classOrMetaClass: self doItReceiver class;
+ context: self doItContext.
+ ^ true!
- aStyler context: self object.
- ^ super aboutToStyle: aStyler forMorph: aMorph!
A new version of Protocols was added to project The Inbox:
http://source.squeak.org/inbox/Protocols-jr.63.mcz
==================== Summary ====================
Name: Protocols-jr.63
Author: jr
Time: 4 August 2019, 11:40:18.213513 am
UUID: 7921d09f-b335-5e4e-bb85-ace62a287eb7
Ancestors: Protocols-pre.62
Implement spontaneous overriding of methods from Lexicon.
Use a new instance variable to temporarily hold which class is the target of the current accept operation.
Make sure to update the message list in case the current selector's class has now changed.
Assumption: setClassAndSelectorIn: must provide the data of the currently selected method and it will not pretend to view a different class.
Also add browseFullProtocol to ClassDescription to make it easier to open a Lexicon from a Workspace or the search box.
Depends on Tools-jr.859.
=============== Diff against Protocols-pre.62 ===============
Item was added:
+ ----- Method: ClassDescription>>browseFullProtocol (in category '*Protocols-Tools') -----
+ browseFullProtocol
+ Lexicon new openOnClass: self showingSelector: nil.!
Item was changed:
ProtocolBrowser subclass: #Lexicon
+ instanceVariableNames: 'currentVocabulary categoryList categoryListIndex targetClass limitClass currentQuery currentQueryParameter selectorsVisited compileTargetClass'
- instanceVariableNames: 'currentVocabulary categoryList categoryListIndex targetClass limitClass currentQuery currentQueryParameter selectorsVisited'
classVariableNames: ''
poolDictionaries: ''
category: 'Protocols-Tools'!
+ !Lexicon commentStamp: 'jr 8/4/2019 11:36' prior: 0!
- !Lexicon commentStamp: 'fbs 5/2/2013 08:29' prior: 0!
An instance of Lexicon shows the list of all the method categories known to an object or any of its superclasses, as a "flattened" list, and, within any selected category, shows all methods understood by the class's instances which are associated with that category, again as a "flattened" list. A variant with a search pane rather than a category list is also implemented.
categoryList the list of categories
categoryListIndex index of currently-selected category
targetObject optional -- an instance being viewed
targetClass the class being viewed
lastSearchString the last string searched for
lastSendersSearchSelector the last senders search selector
limitClass optional -- the limit class to search for
selectorsVisited list of selectors visited
selectorsActive not presently in use, subsumed by selectorsVisited
currentVocabulary the vocabulary currently installed
currentQuery what the query category relates to:
+ #senders #selectorName #currentChangeSet
+ compileTargetClass transient -- behavior in which the current contents is
+ accepted/compiled!
- #senders #selectorName #currentChangeSet!
Item was added:
+ ----- Method: Lexicon>>contents:notifying: (in category 'private') -----
+ contents: aString notifying: aController
+ "Make sure a possible choice of the compileTargetClass is not remembered."
+ [^ super contents: aString notifying: aController]
+ ensure: [compileTargetClass := nil]!
Item was added:
+ ----- Method: Lexicon>>contents:oldSelector:in:classified:notifying: (in category 'private') -----
+ contents: aString oldSelector: oldSelector in: aClass classified: category notifying: aController
+ "Update messageList if a method is compiled because the selector might be in a
+ different class now."
+ ^ (super contents: aString oldSelector: oldSelector in: aClass classified: category notifying: aController)
+ ifTrue: [ self reformulateList. ^ true]
+ ifFalse: [false]!
Item was changed:
----- Method: Lexicon>>okayToAccept (in category 'model glue') -----
okayToAccept
"Answer whether it is okay to accept the receiver's input"
+ | ok reply |
- | ok aClass reply |
(ok := super okayToAccept) ifTrue:
+ [((compileTargetClass := self selectedClassOrMetaClass) ~~ targetClass) ifTrue:
- [((aClass := self selectedClassOrMetaClass) ~~ targetClass) ifTrue:
[reply := UIManager default chooseFrom:
+ {'okay, no problem'.
+ 'cancel - let me reconsider'.
+ 'compile into ', targetClass name, ' instead'.
+ 'compile into a new uniclass'} title:
- {'okay, no problem'.
- 'cancel - let me reconsider'.
- 'compile into ', targetClass name, ' instead'.
- 'compile into a new uniclass'} title:
'Caution!! This would be
+ accepted into class ', compileTargetClass name, '.
+ Is that okay?'.
+ reply caseOf:
+ {[1] -> [^ true].
+ [2] -> [^ false].
+ [3] -> [compileTargetClass := targetClass. ^ true]}
+ otherwise: [self notYetImplemented]]].
- accepted into class ', aClass name, '.
- Is that okay?' .
- reply = 1 ifTrue: [^ true].
- reply ~= 2 ifTrue:
- [self notYetImplemented].
- ^ false]].
^ ok!
Item was removed:
- ----- Method: Lexicon>>setClassAndSelectorIn: (in category 'selection') -----
- setClassAndSelectorIn: csBlock
- "Decode strings of the form <selectorName> (<className> [class])"
-
-
- self selection ifNil: [^ csBlock value: targetClass value: nil].
- ^ super setClassAndSelectorIn: csBlock!
Item was added:
+ ----- Method: Lexicon>>targetForContents: (in category 'private') -----
+ targetForContents: aString
+ ^ compileTargetClass!
Marcel Taeumel uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-mt.1253.mcz
==================== Summary ====================
Name: Kernel-mt.1253
Author: mt
Time: 4 August 2019, 11:28:20.673314 am
UUID: 38317323-3403-404c-88d2-20ce552e20ec
Ancestors: Kernel-mt.1252
Let models configure the styler based on the particular view (or morph or widget).
This is related to merging ToolBuilder-Morphic-ct.228.
=============== Diff against Kernel-mt.1252 ===============
Item was added:
+ ----- Method: Model>>aboutToStyle:forMorph: (in category 'morphic ui') -----
+ aboutToStyle: aStyler forMorph: aMorph
+ "View-specific extension for styling. Overwrite this method to configure the styler with morph-specific information."
+
+ ^ self aboutToStyle: aStyler!
A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/Tools-jr.859.mcz
==================== Summary ====================
Name: Tools-jr.859
Author: jr
Time: 4 August 2019, 11:23:31.139513 am
UUID: da4ec759-c2aa-6040-9151-53c2942b3e88
Ancestors: Tools-mt.858
Refactor accept in MessageSet such that subclasses can override in which class the contents will be compiled.
This will allow Lexicon (package Protocols) to create an override from an inherited method without switching the tool.
Assumption: setClassAndSelectorIn: must provide the data of the currently selected method and it will not pretend to view a different class.
Also split the contents:notifying: method since it did several things at once and was quite long.
=============== Diff against Tools-mt.858 ===============
Item was changed:
----- Method: MessageSet>>contents:notifying: (in category 'private') -----
contents: aString notifying: aController
"Compile the code in aString. Notify aController of any syntax errors.
Answer false if the compilation fails. Otherwise, if the compilation
created a new method, deselect the current selection. Then answer true."
+ | category class oldSelector |
- | category selector class oldSelector |
self okayToAccept ifFalse: [^ false].
+ class := self targetForContents: aString.
- self setClassAndSelectorIn: [:c :os | class := c. oldSelector := os].
class ifNil: [^ false].
+ self setClassAndSelectorIn: [:c :os | oldSelector := os].
+ (self contents: aString specialSelector: oldSelector in: class notifying: aController)
+ ifTrue: [^ false].
- (oldSelector ~~ nil and: [oldSelector first isUppercase]) ifTrue:
- [oldSelector = #Comment ifTrue:
- [class comment: aString stamp: Utilities changeStamp.
- self changed: #annotation.
- self clearUserEditFlag.
- ^ false].
- oldSelector = #Definition ifTrue:
- ["self defineClass: aString notifying: aController."
- class subclassDefinerClass
- evaluate: aString
- notifying: aController
- logged: true.
- self clearUserEditFlag.
- ^ false].
- oldSelector = #Hierarchy ifTrue:
- [self inform: 'To change the hierarchy, edit the class definitions'.
- ^ false]].
"Normal method accept"
+ category := self selectedMessageCategoryName.
+ ^ self contents: aString
+ oldSelector: oldSelector
+ in: class
+ classified: category
+ notifying: aController!
- category := class organization categoryOfElement: oldSelector.
- selector := class compile: aString
- classified: category
- notifying: aController.
- selector == nil ifTrue: [^ false].
- self noteAcceptanceOfCodeFor: selector.
- selector == oldSelector ifFalse:
- [self reformulateListNoting: selector].
- contents := aString copy.
- self changed: #annotation.
- ^ true!
Item was added:
+ ----- Method: MessageSet>>contents:oldSelector:in:classified:notifying: (in category 'private') -----
+ contents: aString oldSelector: oldSelector in: aClass classified: category notifying: aController
+ "Compile the code in aString. Notify aController of any syntax errors.
+ Answer false if the compilation fails. Otherwise, if the compilation
+ created a new method, deselect the current selection. Then answer true."
+ | selector |
+ selector := aClass compile: aString
+ classified: category
+ notifying: aController.
+ selector == nil ifTrue: [^ false].
+ self noteAcceptanceOfCodeFor: selector.
+ selector == oldSelector ifFalse:
+ [self reformulateListNoting: selector].
+ contents := aString copy.
+ self changed: #annotation.
+ ^ true!
Item was added:
+ ----- Method: MessageSet>>contents:specialSelector:in:notifying: (in category 'private') -----
+ contents: aString specialSelector: oldSelector in: aClass notifying: aController
+ "If the selector is a fake to denote a different definition than that of a method,
+ try to change that different object. Answer whether a special selector was found and
+ handled."
+ (oldSelector ~~ nil and: [oldSelector first isUppercase]) ifFalse: [^ false].
+ oldSelector = #Comment ifTrue:
+ [aClass comment: aString stamp: Utilities changeStamp.
+ self changed: #annotation.
+ self clearUserEditFlag.
+ ^ true].
+ oldSelector = #Definition ifTrue:
+ ["self defineClass: aString notifying: aController."
+ aClass subclassDefinerClass
+ evaluate: aString
+ notifying: aController
+ logged: true.
+ self clearUserEditFlag.
+ ^ true].
+ oldSelector = #Hierarchy ifTrue:
+ [self inform: 'To change the hierarchy, edit the class definitions'.
+ ^ true].
+ ^ false!
Item was added:
+ ----- Method: MessageSet>>targetForContents: (in category 'private') -----
+ targetForContents: aString
+ "Answer the behavior into which the contents will be accepted."
+ self setClassAndSelectorIn: [:c :os | ^ c].
+ ^ nil "fail safe for overriding implementations of setClassAndSelectorIn:"!