The Trunk: ST80-mt.247.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: ST80-mt.247.mcz

commits-2
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 ] ] ]!