Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk:
http://source.squeak.org/trunk/HelpSystem-Core-mt.118.mcz
==================== Summary ====================
Name: HelpSystem-Core-mt.118
Author: mt
Time: 4 December 2019, 3:30:57.037613 pm
UUID: cd6c15c1-6187-4d33-a558-8cfbc19dc968
Ancestors: HelpSystem-Core-mt.117
Fixes an intialization problem with the help browser. That problem occurred, for example, when opening the Terse Guide only through the help menu.
Deprecates CodeStyledHelpTopic.
=============== Diff against HelpSystem-Core-mt.117 ===============
Item was removed:
- HelpTopic subclass: #CodeStyledHelpTopic
- instanceVariableNames: ''
- classVariableNames: ''
- poolDictionaries: ''
- category: 'HelpSystem-Core-Model'!
-
- !CodeStyledHelpTopic commentStamp: 'tpr 6/19/2018 19:27' prior: 0!
- A CodeStyledHelpTopic is a simple way to make sure a help topic gets styled for code in a help browser. Once the help browser is able to code-style individual chunks instead of having to brute-force entire pages we can remove this class and simplify thngs!
Item was removed:
- ----- Method: CodeStyledHelpTopic>>usesCodeStyling (in category 'testing') -----
- usesCodeStyling
- "do I need a styled (ie with Shout) browser page?"
- ^true!
Item was changed:
----- Method: HelpBrowser>>aboutToStyle: (in category 'styling') -----
aboutToStyle: aStyler
+ ^ self currentTopic
+ ifNil: [false]
+ ifNotNil: [:topic | topic usesCodeStyling]!
- ^ (self currentTopic ifNil: [self currentParentTopic]) usesCodeStyling!
Marcel Taeumel uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-mt.247.mcz
==================== Summary ====================
Name: ST80-mt.247
Author: mt
Time: 4 December 2019, 3:10:14.872613 pm
UUID: e48e8277-c924-4f2a-b37d-a80aa5b0c251
Ancestors: ST80-mt.246
Complements the browse-it features from Morphic-mt.1600. Well, kind of. Needs polishing for the cases that open two browser at once.
=============== Diff against ST80-mt.246 ===============
Item was changed:
----- Method: ParagraphEditor>>browseIt (in category 'menu messages') -----
browseIt
+ "Launch a browser for the current selection, if appropriate."
- "Launch a browser for the current selection, if appropriate"
- | aSymbol |
- self flag: #yoCharCases.
-
Preferences alternativeBrowseIt ifTrue: [^ self browseClassFromIt].
+ self lineSelectAndEmptyCheck: [^ view flash].
- self lineSelectAndEmptyCheck: [^ self].
- (aSymbol := self selectedSymbol) isNil ifTrue: [^ view flash].
+ self terminateAndInitializeAround: [
+
+ self flag: #todo. "mt: Active controller process will terminate if any new tool is opened. Find a way to open two tools in this method."
+
+ "First, try to show all accesses to instance or class variables."
+ self selectedInstanceVariable ifNotNil:
+ [:nameToClass | self systemNavigation
+ browseAllAccessesTo: nameToClass key
+ from: nameToClass value].
+ self selectedClassVariable ifNotNil:
+ [:binding | self systemNavigation browseAllCallsOn: binding].
+
+ "Then, either browse the class (from a binding) or all implementors of a selector."
+ self selectedBinding ifNotNil:
+ [:binding | self systemNavigation browseClass: binding].
+ self selectedSelector ifNotNil:
+ [:selector | self systemNavigation browseAllImplementorsOf: selector].
+
+ ]!
- self terminateAndInitializeAround:
- [aSymbol first isUppercase
- ifTrue: [| anEntry |
- anEntry := (Smalltalk at: aSymbol
- ifAbsent: [ self systemNavigation browseAllImplementorsOf: aSymbol.
- ^ nil]).
- anEntry isNil ifTrue: [^ view flash].
- (anEntry isBehavior or: [ anEntry isTrait ])
- ifFalse: [ anEntry := anEntry class ].
- self systemNavigation browseClass: anEntry.
- ] ifFalse:[ self systemNavigation browseAllImplementorsOf: aSymbol]]!
Item was added:
+ ----- Method: ParagraphEditor>>selectedClassVariable (in category 'menu messages') -----
+ selectedClassVariable
+ "Try to make a class-variable binding out of the current text selection."
+
+ (model respondsTo: #selectedClassOrMetaClass) ifFalse: [ ^ nil ].
+
+ ^ self selectedSymbol ifNotNil:
+ [ :symbol | model selectedClassOrMetaClass ifNotNil:
+ [ :classOrMetaClass | (classOrMetaClass theNonMetaClass allClassVarNames includes: symbol)
+ ifTrue: [ classOrMetaClass bindingOf: symbol ]
+ ifFalse: [ nil ] ] ]!
Item was changed:
----- Method: ParagraphEditor>>selectedInstanceVariable (in category 'menu messages') -----
selectedInstanceVariable
+ "Try to make an association from an instance-variable name to the class where this variable is defined. Make the implementation robust for models that do not know about classes.
+
+ Note that inst-var names might not have symbol a representation, only via their accessors."
- "Try to make an association from an instance-variable name to the class where this variable is defined. Make the implementation robust for models that do not know about classes."
(model respondsTo: #selectedClassOrMetaClass) ifFalse: [ ^ nil ].
+ ^ self selection string ifNotNil:
- ^ self selection string ifNotNil:
[ :token | model selectedClassOrMetaClass ifNotNil:
[ :behavior |
(behavior instVarIndexFor: token ifAbsent: [ 0 ]) ~= 0
ifTrue: [ token -> behavior ]
ifFalse: [ nil ] ] ]!
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1127.mcz
==================== Summary ====================
Name: System-mt.1127
Author: mt
Time: 4 December 2019, 3:04:58.090613 pm
UUID: 8c61fc56-bbd5-49e5-b735-c831e630323c
Ancestors: System-mt.1126
In system navigation, make #browseClass: work with (class) bindings. Note that there is alreay binding compatibility in #browseAllCallsOnClass:.
=============== Diff against System-mt.1126 ===============
Item was changed:
----- Method: SystemNavigation>>browseClass: (in category 'browse') -----
+ browseClass: aBehaviorOrBinding
+ "Browse the class (1) as given, (2) from its meta class, (3) from a class binding, (4) of a global variable as given, (5) of a global variable from its global binding."
+
+ | objectOrClass classOrMetaclass targetClass |
+ objectOrClass := aBehaviorOrBinding value.
+ classOrMetaclass := objectOrClass isBehavior
+ ifTrue: [objectOrClass]
+ ifFalse: [objectOrClass class].
+ targetClass := classOrMetaclass isMeta
+ ifTrue: [classOrMetaclass theNonMetaClass]
+ ifFalse: [classOrMetaclass].
+ ^ ToolSet browseClass: targetClass!
- browseClass: aBehavior
- | targetClass |
- targetClass := aBehavior isMeta
- ifTrue: [aBehavior theNonMetaClass]
- ifFalse: [aBehavior ].
- ^ ToolSet browse: targetClass selector: nil!
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1126.mcz
==================== Summary ====================
Name: System-mt.1126
Author: mt
Time: 4 December 2019, 10:33:06.353613 am
UUID: 396886fd-6463-4b06-9414-b972caa1ac4d
Ancestors: System-tpr.1125
Makes the title of access browsers more readable.
=============== Diff against System-tpr.1125 ===============
Item was changed:
----- Method: SystemNavigation>>browseAllAccessesTo:from: (in category 'browse') -----
browseAllAccessesTo: instVarName from: aClass
"Create and schedule a Message Set browser for all the receiver's methods or any methods of a subclass/superclass that refer to the instance variable name."
"self new browseAllAccessesTo: 'contents' from: Collection."
^ self
browseMessageList: [ (self allAccessesTo: instVarName from: aClass) sort ]
+ name: ('Accesses to {1} from {2}' translated format: {instVarName. aClass name})
- name: 'Accesses to ' , instVarName
autoSelect: instVarName!
Marcel Taeumel uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-mt.246.mcz
==================== Summary ====================
Name: ST80-mt.246
Author: mt
Time: 4 December 2019, 10:32:14.954613 am
UUID: 7435a337-bf82-46b4-b44d-de17edd88aae
Ancestors: ST80-jr.245
Replicates the functionality as of Morphic-mt.1599 regarding "senders of it" and "references to it".
=============== Diff against ST80-jr.245 ===============
Item was changed:
----- Method: ParagraphEditor>>lineSelectAndEmptyCheck: (in category 'menu messages') -----
lineSelectAndEmptyCheck: returnBlock
"If the current selection is an insertion point, expand it to be the entire current line; if after that's done the selection is still empty, then evaluate the returnBlock, which will typically consist of '[^ self]' in the caller -- check senders of this method to understand this."
+ self hasSelection ifFalse: [
+ self selectLine.
+ self hasSelection ifFalse: [
+ self flash.
+ ^ returnBlock value]].!
- self selectLine. "if current selection is an insertion point, then first select the entire line in which occurs before proceeding"
- self hasSelection ifFalse: [self flash. ^ returnBlock value]!
Item was changed:
----- Method: ParagraphEditor>>referencesToIt (in category 'menu messages') -----
referencesToIt
+ "Open a MessageSet with the references to the selected global or variable name."
- "Open a references browser on the selected symbol"
+ self wordSelectAndEmptyCheck: [^ self].
+ self selectedInstanceVariable ifNotNil:
+ [:nameToClass | ^ self terminateAndInitializeAround:
+ [self systemNavigation
+ browseAllAccessesTo: nameToClass key
+ from: nameToClass value]].
+ self selectedBinding ifNotNil:
+ [:binding | ^ self terminateAndInitializeAround:
+ [self systemNavigation browseAllCallsOnClass: binding]].
+ view flash.!
- | aSymbol |
- self selectLine.
- ((aSymbol := self selectedSymbol) == nil or:
- [(Smalltalk globals includesKey: aSymbol) not])
- ifTrue: [^ view flash].
-
- self terminateAndInitializeAround: [self systemNavigation browseAllCallsOn: (Smalltalk globals associationAt: self selectedSymbol)]!
Item was changed:
----- Method: ParagraphEditor>>selectLine (in category 'new selection') -----
selectLine
"Make the receiver's selection, if it currently consists of an insertion point only, encompass the current line."
+
- self hasSelection ifTrue:[^self].
self selectInterval: (self encompassLine: self selectionInterval)!
Item was added:
+ ----- Method: ParagraphEditor>>selectedBinding (in category 'menu messages') -----
+ selectedBinding
+ "Try to make a binding out of the current text selection. That binding can be a global or class."
+
+ ^ self selectedSymbol ifNotNil:
+ [ :symbol |
+ ((model respondsTo: #selectedClassOrMetaClass)
+ ifTrue: [ model selectedClassOrMetaClass ifNil: [ model environment ] ]
+ ifFalse: [ model environment ]) ifNotNil:
+ [ :environment | environment bindingOf: symbol ] ]!
Item was added:
+ ----- Method: ParagraphEditor>>selectedInstanceVariable (in category 'menu messages') -----
+ selectedInstanceVariable
+ "Try to make an association from an instance-variable name to the class where this variable is defined. Make the implementation robust for models that do not know about classes."
+
+ (model respondsTo: #selectedClassOrMetaClass) ifFalse: [ ^ nil ].
+
+ ^ self selection string ifNotNil:
+ [ :token | model selectedClassOrMetaClass ifNotNil:
+ [ :behavior |
+ (behavior instVarIndexFor: token ifAbsent: [ 0 ]) ~= 0
+ ifTrue: [ token -> behavior ]
+ ifFalse: [ nil ] ] ]!
Item was added:
+ ----- Method: ParagraphEditor>>selectedLiteral (in category 'menu messages') -----
+ selectedLiteral
+ "Try to make a Smalltalk literal out of the current text selection."
+
+ ^ self selection string findLiteral!
Item was changed:
----- Method: ParagraphEditor>>selectedSymbol (in category 'menu messages') -----
selectedSymbol
+ "Try to make a symbol out of the current text selection."
- "Return the currently selected symbol, or nil if none. Spaces, tabs and returns are ignored"
+ ^ self selection string findSymbol!
- | aString |
- self hasCaret ifTrue: [^ nil].
- aString := self selection string.
- aString isOctetString ifTrue: [aString := aString asOctetString].
- aString := self selection string copyWithoutAll: CharacterSet separators.
- aString size = 0 ifTrue: [^ nil].
- Symbol hasInterned: aString ifTrue: [:sym | ^ sym].
-
- ^ nil!
Item was changed:
----- Method: ParagraphEditor>>sendersOfIt (in category 'menu messages') -----
sendersOfIt
"Open a senders browser on the selected selector"
- | aSelector |
self lineSelectAndEmptyCheck: [^ self].
+ self selectedSelector ifNotNil:
+ [:aSelector| ^ self terminateAndInitializeAround:
+ [self systemNavigation browseAllCallsOn: aSelector]].
+ self selectedLiteral ifNotNil:
+ [:aLiteral| ^ self terminateAndInitializeAround:
+ [self systemNavigation browseAllCallsOn: aLiteral]].
+ view flash!
- (aSelector := self selectedSelector) == nil ifTrue: [^ view flash].
- self terminateAndInitializeAround: [self systemNavigation browseAllCallsOn: aSelector]!
Item was added:
+ ----- Method: ParagraphEditor>>wordSelectAndEmptyCheck: (in category 'menu messages') -----
+ wordSelectAndEmptyCheck: returnBlock
+ "If the current selection is an insertion point, expand it to be the entire current word; if after that's done the selection is still empty, then evaluate the returnBlock, which will typically consist of '[^ self]' in the caller -- check senders of this method to understand this."
+
+ self hasSelection ifFalse: [
+ self selectWord.
+ self hasSelection ifFalse: [
+ self flash.
+ ^ returnBlock value]].!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1599.mcz
==================== Summary ====================
Name: Morphic-mt.1599
Author: mt
Time: 4 December 2019, 10:30:59.590613 am
UUID: e0afb7cd-2598-4ec8-b31c-d011525ddee9
Ancestors: Morphic-mt.1598
Makes #referencesToIt as readable as #sendersOfIt. Removes some code duplication -- yeah, Editor is still kind of abstract and fails to document its interface property, i.e., #selectLine, ... so much to do! :-)
=============== Diff against Morphic-mt.1598 ===============
Item was changed:
----- Method: Editor>>lineSelectAndEmptyCheck: (in category 'menu messages') -----
lineSelectAndEmptyCheck: returnBlock
"If the current selection is an insertion point, expand it to be the entire current line; if after that's done the selection is still empty, then evaluate the returnBlock, which will typically consist of '[^ self]' in the caller -- check senders of this method to understand this."
+ self hasSelection ifFalse: [
+ self selectLine.
+ self hasSelection ifFalse: [
+ morph flash.
+ ^ returnBlock value]].!
- self selectLine. "if current selection is an insertion point, then first select the entire line in which occurs before proceeding"
- self hasSelection ifFalse: [morph flash. ^ returnBlock value]!
Item was changed:
----- Method: Editor>>wordSelectAndEmptyCheck: (in category 'menu messages') -----
wordSelectAndEmptyCheck: returnBlock
"Ensure selecting the entire current word; if after that's done the selection is still empty, then evaluate the returnBlock, which will typically consist of '[^ self]' in the caller -- check senders of this method to understand this."
+ self hasSelection ifFalse: [
+ self selectWord.
+ self hasSelection ifFalse: [
+ morph flash.
+ ^ returnBlock value]].!
- self selectWord. "Select exactly a whole word"
- self hasSelection ifFalse: [morph flash. ^ returnBlock value]!
Item was removed:
- ----- Method: TextEditor>>lineSelectAndEmptyCheck: (in category 'new selection') -----
- lineSelectAndEmptyCheck: returnBlock
- "If the current selection is an insertion point, expand it to be the entire current line; if after that's done the selection is still empty, then evaluate the returnBlock, which will typically consist of '[^ self]' in the caller -- check senders of this method to understand this."
-
- self selectLine. "if current selection is an insertion point, then first select the entire line in which occurs before proceeding"
- self hasSelection ifFalse: [morph flash. ^ returnBlock value]!
Item was changed:
----- Method: TextEditor>>referencesToIt (in category 'menu messages') -----
referencesToIt
"Open a MessageSet with the references to the selected global or variable name."
+
+ self wordSelectAndEmptyCheck: [^ self].
+ self selectedInstanceVariable ifNotNil:
+ [:nameToClass | ^ self systemNavigation
+ browseAllAccessesTo: nameToClass key
+ from: nameToClass value].
+ self selectedBinding ifNotNil:
+ [:binding | ^ self systemNavigation browseAllCallsOnClass: binding].
+ morph flash.!
- | selection environment binding |
- self selection isEmpty ifTrue: [ self selectWord ].
- environment := (model respondsTo: #selectedClassOrMetaClass)
- ifTrue: [ model selectedClassOrMetaClass ifNil: [ model environment ] ]
- ifFalse: [ model environment ].
- selection := self selectedSymbol ifNil: [ self selection asString ].
- (environment isBehavior and:
- [ (environment
- instVarIndexFor: selection
- ifAbsent: [ 0 ]) ~= 0 ]) ifTrue: [ ^ self systemNavigation
- browseAllAccessesTo: selection
- from: environment ].
- selection isSymbol ifFalse: [ ^ morph flash ].
- binding := (environment bindingOf: selection) ifNil: [ ^ morph flash ].
-
- self systemNavigation browseAllCallsOnClass: binding.!
Item was changed:
----- Method: TextEditor>>selectLine (in category 'new selection') -----
selectLine
"Make the receiver's selection, if it currently consists of an insertion point only, encompass the current line."
+
- self hasSelection ifTrue:[^self].
self selectInterval: (self encompassLine: self selectionInterval)!
Item was added:
+ ----- Method: TextEditor>>selectedBinding (in category 'menu messages') -----
+ selectedBinding
+ "Try to make a binding out of the current text selection. That binding can be a global or class."
+
+ ^ self selectedSymbol ifNotNil:
+ [ :symbol |
+ ((model respondsTo: #selectedClassOrMetaClass)
+ ifTrue: [ model selectedClassOrMetaClass ifNil: [ model environment ] ]
+ ifFalse: [ model environment ]) ifNotNil:
+ [ :environment | environment bindingOf: symbol ] ]!
Item was added:
+ ----- Method: TextEditor>>selectedInstanceVariable (in category 'menu messages') -----
+ selectedInstanceVariable
+ "Try to make an association from an instance-variable name to the class where this variable is defined. Make the implementation robust for models that do not know about classes."
+
+ (model respondsTo: #selectedClassOrMetaClass) ifFalse: [ ^ nil ].
+
+ ^ self selection string ifNotNil:
+ [ :token | model selectedClassOrMetaClass ifNotNil:
+ [ :behavior |
+ (behavior instVarIndexFor: token ifAbsent: [ 0 ]) ~= 0
+ ifTrue: [ token -> behavior ]
+ ifFalse: [ nil ] ] ]!
Eliot Miranda uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-eem.1597.mcz
==================== Summary ====================
Name: Morphic-eem.1597
Author: eem
Time: 30 November 2019, 7:05:24.872005 pm
UUID: 068e0786-10ca-433e-9ec1-7c5cc2a15942
Ancestors: Morphic-eem.1596
Fix regression from hurried programming. Apologies!
=============== Diff against Morphic-eem.1596 ===============
Item was added:
+ ----- Method: TextEditor>>selectedLiteral (in category 'menu messages') -----
+ selectedLiteral
+ "Try to make a literal out of the current text selection"
+ | tokens |
+ tokens := Scanner new typedScanTokens: self selection string.
+ ^tokens isEmpty ifFalse: [tokens first]!
Item was changed:
----- Method: TextEditor>>selectedSelector (in category 'menu messages') -----
selectedSelector
"Try to make a selector out of the current text selection"
+ ^self selection string findSelector!
- | tokens |
- tokens := Scanner new typedScanTokens: self selection string.
- ^tokens isEmpty ifFalse: [tokens first]!