[squeak-dev] The Trunk: Tools-ct.1088.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Dec 15 16:33:05 UTC 2021


Christoph Thiede uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-ct.1088.mcz

==================== Summary ====================

Name: Tools-ct.1088
Author: ct
Time: 15 December 2021, 5:32:59.422981 pm
UUID: a9ceffaa-ef67-1b40-810a-10eb05924c75
Ancestors: Tools-mt.1087, Tools-ct.1057, Tools-ct.1086, Tools-ct.1067, Tools-ct.1063, Tools-ct.1066, Tools-ct.1062, Tools-ct.1044

Merges some recent fixes. Still a lot of open things to review, though. :-)

Tools-ct.1057:
	Fixes minor bugs and regressions in ChangeSorters (brittle selection, button decorations).
	
	Revision: Update currentCompiledMethod in ChangeSorter >> #setContents.

Tools-ct.1086:
	Workaround for missing updates of forms in inspectors.

Tools-ct.1067:
	FileList: When adding a new file or directory that already exists, show a dialog intead of letting the primitive error passing.

Tools-ct.1063:
	Fixes TextLinks to the comment, definition, or hierarchy of a class (available from the 'change emphasis' dialog, Cmd + 6).

Tools-ct.1066:
	Updates well known processes in the process browser to make the changes from Tools-eem.1016 visible (see postscript).

Tools-ct.1062:
	Fixes a bug in process browser when canceling the "change priority" dialog.
	
	Revision: Prefer Project uiManager over UIManager default also in sibling methods.

Tools-ct.1044:
	Fixes styling in MessageSets when prettyPrint is turned on.

Note: For each merged patch, you can read up the full message and diff in the original inbox version. :-)

=============== Diff against Tools-mt.1087 ===============

Item was changed:
  ----- Method: ChangeSorter>>currentSelector: (in category 'message list') -----
  currentSelector: messageName
  
  	currentSelector := messageName.
  	self changed: #currentSelector.
  	self setContents.
+ 	self contentsChanged.
+ 	self decorateButtons.!
- 	self contentsChanged.!

Item was changed:
  ----- Method: ChangeSorter>>initialize (in category 'initialize') -----
  initialize
  	super initialize.
+ 	self showChangeSet: ChangeSet current.!
- 	myChangeSet := ChangeSet current.!

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.
  	contentsAreStyleable := false.
+ 	currentCompiledMethod := nil.
  	myChangeSet ifNil: [^ contents := String empty].   "should not happen but can"
  	currentClassName ifNil: [^ contents := myChangeSet preambleString ifNil: [String empty]].
  	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!!'].
  			contentsAreStyleable := true.
+ 			currentCompiledMethod := class compiledMethodAt: sel.
  			contents := class sourceCodeAt: sel.
  			(#(prettyPrint prettyDiffs) includes: contentsSymbol) ifTrue:
  				[contents :=  class prettyPrinterClass
  					format: contents in: class notifying: nil].
  			self showingAnyKindOfDiffs ifTrue: [
  				contentsAreStyleable := false.
  				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: ChangeSorter>>updateIfNecessary (in category 'changeSet menu') -----
  updateIfNecessary
  	"Recompute all of my panes."
  
  	| newList |
  	self okToChange ifFalse: [^ self].
+ 	
- 
  	myChangeSet ifNil: [^ self].  "Has been known to happen though shouldn't"
  	(myChangeSet isMoribund) ifTrue:
  		[self changed: #changeSetList.
  		^ self showChangeSet: ChangeSet current].
+ 	
- 
  	newList := self changeSetList.
+ 	
- 
  	(priorChangeSetList == nil or: [priorChangeSetList ~= newList])
  		ifTrue:
  			[priorChangeSetList := newList.
+ 			self changed: #changeSetList].!
- 			self changed: #changeSetList].
- 	self showChangeSet: myChangeSet!

Item was changed:
  ----- Method: FileList>>addNew:byEvaluating: (in category 'file menu action') -----
  addNew: aString byEvaluating: aBlock
  	"A parameterization of earlier versions of #addNewDirectory and
  	#addNewFile.  Fixes the bug in each that pushing the cancel button
  	in the FillInTheBlank dialog gave a walkback."
  
  	| response newName index ending |
  	self okToChange ifFalse: [^ self].
  	(response := UIManager default
  						request: ('New {1} Name?' translated format: {aString translated})
  						initialAnswer: ('{1}Name' translated format: {aString translated}))
  		isEmpty ifTrue: [^ self].
  	newName := response asFileName.
+ 	(Cursor wait showWhile: [
+ 		directory fileOrDirectoryExists: newName])
+ 			ifTrue: [^ self inform: ('''{1}'' already exists' translated format: {newName})].
  	Cursor wait showWhile: [
  		aBlock value: newName].
  	self updateFileList.
  	index := list indexOf: newName.
  	index = 0 ifTrue: [ending := ') ',newName.
  		index := list findFirst: [:line | line endsWith: ending]].
  	self fileListIndex: index.
  !

Item was changed:
  ----- Method: FormInspector>>embedForm:inText: (in category 'support') -----
  embedForm: aForm inText: stringOrText
  
+ 	^ stringOrText asText
+ 		, ((' (hash: {1})' translated format: {aForm bits hash})
+ 			flag: #workaround "ct: Currently, text equality ignores attributes. Add a hash of the form's bits to the text to ensure that it will be re-rendered in Morphic inspectors. In the long term, we should redefine Text >> #= instead. See: http://lists.squeakfoundation.org/pipermail/squeak-dev/2020-September/211358.html";
+ 			yourself)
+ 		, String cr
+ 		, (Text string: ' ' attribute:
- 	^ stringOrText asText, String cr,
- 		(Text string: ' ' attribute:
  			(TextFontReference toFont: 
  				(FormSetFont new
  					fromFormArray: (Array with: (aForm copy offset: 0 at 0))
  					asciiStart: Character space asInteger
  					ascent: aForm height)))!

Item was changed:
  ----- Method: MessageSet>>aboutToStyle: (in category 'code pane') -----
  aboutToStyle: aPluggableShoutMorphOrView
  	"This is a notification that aPluggableShoutMorphOrView is about to re-style its text.
  	Set the classOrMetaClass in aPluggableShoutMorphOrView, so that identifiers
  	will be resolved correctly.
  	Answer true to allow styling to proceed, or false to veto the styling"
  
  	| selectedMessageName showingMethod |
+ 	self isModeStyleable ifFalse: [^false].
- 	self showingSource ifFalse: [^false].
  	selectedMessageName := self selectedMessageName.
  	showingMethod := (#(Comment Definition Hierarchy) includes: selectedMessageName) not.
  	"Hack!!  setting classOrMetaClass: to nil allows doit or class definition colouring."
  	aPluggableShoutMorphOrView classOrMetaClass: (showingMethod ifTrue: [self selectedClassOrMetaClass]).
  	^(#(Comment Hierarchy) includes: selectedMessageName) not!

Item was changed:
  ----- Method: Model>>addItem: (in category '*Tools') -----
  addItem: classAndMethod
  	"Open a browser directly on the given class and method
  	
  	Model new addItem: 'Model addItem:'
  	Model new addItem: 'Model>>addItem:'
  	"
  	
  	self flag: #mref.	"classAndMethod is a String"
  	MessageSet 
  		parse: classAndMethod  
  		toClassAndSelector: [ :class :sel |
  			class ifNil: [^self].
+ 			sel = #Comment ifTrue: [^ Browser fullOnClassComment: class].
+ 			sel = #Definition ifTrue: [^ Browser newOnClass: class].
+ 			sel = #Hierarchy ifTrue: [^ HierarchyBrowser fullOnClass: class].
  			Browser newOnClass: class selector: sel
  		]
  
  !

Item was changed:
  ----- Method: ProcessBrowser>>changePriority (in category 'process actions') -----
  changePriority
  	| str newPriority nameAndRules |
  	nameAndRules := self nameAndRulesForSelectedProcess.
+ 	nameAndRules third ifFalse: [
+ 		^ self inform: ('Nope, won''t change priority of {1}' translated format: {nameAndRules first})].
+ 	
+ 	str := Project uiManager
+ 		request: 'New priority' translated
+ 		initialAnswer: selectedProcess priority asString.
+ 	str isEmptyOrNil ifTrue: [^ self].
+ 	
- 	nameAndRules third
- 		ifFalse: [self inform: 'Nope, won''t change priority of ' , nameAndRules first.
- 			^ self].
- 	str := UIManager default 
- 				request: 'New priority' 
- 		  initialAnswer: selectedProcess priority asString.
  	newPriority := str asNumber asInteger.
+ 	newPriority ifNil: [^ self].
- 	newPriority
- 		ifNil: [^ self].
  	(newPriority < 1
  			or: [newPriority > Processor highestPriority])
+ 		ifTrue: [^ self inform: 'Bad priority' translated].
+ 	
- 		ifTrue: [self inform: 'Bad priority'.
- 			^ self].
  	self class setProcess: selectedProcess toPriority: newPriority.
+ 	self updateProcessList.!
- 	self updateProcessList!

Item was changed:
  ----- Method: ProcessBrowser>>findContext (in category 'process list') -----
  findContext
  	| initialProcessIndex initialStackIndex found |
  	initialProcessIndex := self processListIndex.
  	initialStackIndex := self stackListIndex.
+ 	searchString := Project uiManager
+ 		request: 'Enter a string to search for in the process stack lists' translated
+ 		initialAnswer: searchString.
- 	searchString := UIManager default 
- 			request: 'Enter a string to search for in the process stack lists'
- 	  initialAnswer: searchString.
  	searchString isEmpty
  		ifTrue: [^ false].
  	self processListIndex: 1.
  	self stackListIndex: 1.
  	found := self nextContext.
  	found
  		ifFalse: [self processListIndex: initialProcessIndex.
  			self stackListIndex: initialStackIndex].
  	^ found!

Item was changed:
  ----- Method: ProcessBrowser>>messageTally (in category 'stack list') -----
  messageTally
  	| secString secs |
+ 	secString := Project uiManager request: 'Profile for how many seconds?' translated initialAnswer: '4'.
- 	secString := UIManager default request: 'Profile for how many seconds?' initialAnswer: '4'.
  	secString isEmptyOrNil ifTrue: [^ self].
  	secs := secString asNumber asInteger.
  	(secs isNil or: [secs isZero])
  		ifTrue: [^ self].
  	[ TimeProfileBrowser spyOnProcess: selectedProcess forMilliseconds: secs * 1000 ] forkAt: selectedProcess priority + 1.!

Item was changed:
  (PackageInfo named: 'Tools') postscript: 'Workspace allInstances do: [:workspace |
  	(workspace instVarNamed: #bindings)
  		removeKey: #''_fileDirectory'' ifAbsent: nil;
  		removeKey: #''_windowTitle'' ifAbsent: nil;
+ 		removeKey: #''_fileLineConversion'' ifAbsent: nil].
+ 
+ ProcessBrowser registerWellKnownProcesses. "Tools-eem.1016"'!
- 		removeKey: #''_fileLineConversion'' ifAbsent: nil].'!



More information about the Squeak-dev mailing list