The Inbox: Tools-ct.960.mcz

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

The Inbox: Tools-ct.960.mcz

commits-2
Christoph Thiede uploaded a new version of Tools to project The Inbox:
http://source.squeak.org/inbox/Tools-ct.960.mcz

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

Name: Tools-ct.960
Author: ct
Time: 17 March 2020, 7:47:55.955389 pm
UUID: 2080d250-68a3-104f-82ee-cb57b534fd00
Ancestors: Tools-mt.955

Revise message list menus and make "toggle break on entry" an actual toggle item. Improves multilingual support.

=============== Diff against Tools-mt.955 ===============

Item was changed:
  ----- Method: Browser>>mainMessageListMenu: (in category 'message functions') -----
  mainMessageListMenu: aMenu
  <messageListMenuShifted: false>
+
+ ^ aMenu
+ addTranslatedList: #(
+ ('what to show...' offerWhatToShowMenu));
+ add: (self isBreakOnEntry ifTrue: ['<on>'] ifFalse: ['<off>']) , 'break on entry' translated
+ action: #toggleBreakOnEntry;
+ addTranslatedList: #(
- ^ aMenu addList: #(
- ('what to show...' offerWhatToShowMenu)
- ('toggle break on entry' toggleBreakOnEntry)
  -
  ('browse full (b)' browseMethodFull)
  ('browse hierarchy (h)' browseClassHierarchy)
  ('browse protocol (p)' browseFullProtocol)
  -
  ('fileOut' fileOutMessage)
  ('printOut' printOutMessage)
  ('copy selector (c)' copySelector)
  ('copy reference (C)' copyReference)
  -
  ('senders of... (n)' browseSendersOfMessages)
  ('implementors of... (m)' browseMessages)
  ('inheritance (i)' methodHierarchy)
  ('versions (v)' browseVersions)
  -
  ('references... (r)' browseVariableReferences)
  ('assignments... (a)' browseVariableAssignments)
  ('class refs (N)' browseClassRefs)
  -
  ('remove method (x)' removeMessage)
  ('explore method' exploreMethod)
  ('inspect method' inspectMethod));
+ yourself!
- yourself
- !

Item was added:
+ ----- Method: CodeHolder>>isBreakOnEntry (in category 'breakpoints') -----
+ isBreakOnEntry
+
+ | selectedMethod |
+ selectedMethod := self selectedClassOrMetaClass
+ compiledMethodAt: self selectedMessageName
+ ifAbsent: [^ false].
+ ^ selectedMethod hasBreakpoint!

Item was changed:
  ----- Method: Debugger>>mainContextStackMenu: (in category 'context stack menu') -----
  mainContextStackMenu: aMenu
  "Set up the menu appropriately for the context-stack-list, unshifted"
  <contextStackMenuShifted: false>
+ ^ aMenu
+ addTranslatedList: #(
- ^ aMenu addList: #(
  ('fullStack (f)' fullStack)
  ('restart (r)' restart)
  ('proceed (p)' proceed)
  ('step (t)' doStep)
  ('step through (T)' stepIntoBlock)
  ('send (e)' send)
  ('where (w)' where)
  ('peel to first like this' peelToFirst)
  -
  ('return entered value' returnValue)
+ - );
+ add: (self isBreakOnEntry ifTrue: ['<on>'] ifFalse: ['<off>']) , 'break on entry' translated
+ action: #toggleBreakOnEntry;
+ addTranslatedList: #(
- -
- ('toggle break on entry' toggleBreakOnEntry)
  ('senders of    (n)' browseSendersOfMessages)
  ('implementors of    (m)' browseMessages)
  ('inheritance (i)' methodHierarchy)
- -
  ('versions (v)' browseVersions)
  -
  ('references    (r)' browseVariableReferences)
  ('assignments    (a)' browseVariableAssignments)
  -
  ('class refs (N)' browseClassRefs)
  ('browse full (b)' browseMethodFull)
  ('file out ' fileOutMessage)
  ('remove method (x) ' removeMessage)
  -
  ('copy bug report to clipboard' copyBugReportToClipboard));
+ yourself!
- yourself
- !

Item was changed:
  ----- Method: MessageSet>>mainMessageListMenu: (in category 'message list') -----
  mainMessageListMenu: aMenu
- "Answer the message-list menu"
  <messageListMenuShifted: false>
+
+ ^ aMenu
+ addTranslatedList: #(
+ ('what to show...' offerWhatToShowMenu));
+ add: (self isBreakOnEntry ifTrue: ['<on>'] ifFalse: ['<off>']) , 'break on entry' translated
+ action: #toggleBreakOnEntry;
+ addTranslatedList: #(
- aMenu addList: #(
- ('what to show...' offerWhatToShowMenu)
- ('toggle break on entry' toggleBreakOnEntry)
  -
  ('browse full (b)' browseMethodFull)
  ('browse hierarchy (h)' browseClassHierarchy)
  ('browse protocol (p)' browseFullProtocol)
  -
  ('fileOut' fileOutMessage)
  ('printOut' printOutMessage)
  ('copy selector (c)' copySelector)
  ('copy reference (C)' copyReference)
  -
  ('senders of... (n)' browseSendersOfMessages)
  ('implementors of... (m)' browseMessages)
  ('inheritance (i)' methodHierarchy)
  ('versions (v)' browseVersions)
  -
  ('references... (r)' browseVariableReferences)
  ('assignments... (a)' browseVariableAssignments)
  ('class refs (N)' browseClassRefs)
  -
  ('remove method (x)' removeMessage)
  ('explore method' exploreMethod)
+ ('inspect method' inspectMethod));
+ yourself!
- ('inspect method' inspectMethod)).
- ^ aMenu!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-ct.960.mcz

Christoph Thiede

By the way, further possible refactorings could include:


1. Deduplicate these menu implementations via CodeHolder (pragmas are a bequest you cannot refuse, but we could helper methods or so)


2. I added this for XmasDecorations and would consider it helpful for the Trunk as well: Add something like #onOrOffString to Boolean, via an extension category of Tools? There are really many senders writing that mapping again and again. It might also be useful if we had a less noisy way to pass a state selector to the menu constructor ... 😊


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Dienstag, 17. März 2020 19:48:03
An: [hidden email]
Betreff: [squeak-dev] The Inbox: Tools-ct.960.mcz
 
Christoph Thiede uploaded a new version of Tools to project The Inbox:
http://source.squeak.org/inbox/Tools-ct.960.mcz

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

Name: Tools-ct.960
Author: ct
Time: 17 March 2020, 7:47:55.955389 pm
UUID: 2080d250-68a3-104f-82ee-cb57b534fd00
Ancestors: Tools-mt.955

Revise message list menus and make "toggle break on entry" an actual toggle item. Improves multilingual support.

=============== Diff against Tools-mt.955 ===============

Item was changed:
  ----- Method: Browser>>mainMessageListMenu: (in category 'message functions') -----
  mainMessageListMenu: aMenu
         <messageListMenuShifted: false>
+
+        ^ aMenu
+                addTranslatedList: #(
+                        ('what to show...'                      offerWhatToShowMenu));
+                add: (self isBreakOnEntry ifTrue: ['<on>'] ifFalse: ['<off>']) , 'break on entry' translated
+                        action: #toggleBreakOnEntry;
+                addTranslatedList: #(
-        ^ aMenu addList: #(
-                        ('what to show...'                      offerWhatToShowMenu)
-                        ('toggle break on entry'                toggleBreakOnEntry)
                         -
                         ('browse full (b)'                       browseMethodFull)
                         ('browse hierarchy (h)'         browseClassHierarchy)
                         ('browse protocol (p)'                  browseFullProtocol)
                         -
                         ('fileOut'                                      fileOutMessage)
                         ('printOut'                                     printOutMessage)
                         ('copy selector (c)'                    copySelector)
                         ('copy reference (C)'           copyReference)
                         -
                         ('senders of... (n)'                    browseSendersOfMessages)
                         ('implementors of... (m)'               browseMessages)
                         ('inheritance (i)'                      methodHierarchy)
                         ('versions (v)'                         browseVersions)
                         -
                         ('references... (r)'                    browseVariableReferences)
                         ('assignments... (a)'                   browseVariableAssignments)
                         ('class refs (N)'                       browseClassRefs)
                         -
                         ('remove method (x)'                    removeMessage)
                         ('explore method'                       exploreMethod)
                         ('inspect method'                       inspectMethod));
+                yourself!
-                yourself
- !

Item was added:
+ ----- Method: CodeHolder>>isBreakOnEntry (in category 'breakpoints') -----
+ isBreakOnEntry
+
+        | selectedMethod |
+        selectedMethod := self selectedClassOrMetaClass
+                compiledMethodAt: self selectedMessageName
+                ifAbsent: [^ false].
+        ^ selectedMethod hasBreakpoint!

Item was changed:
  ----- Method: Debugger>>mainContextStackMenu: (in category 'context stack menu') -----
  mainContextStackMenu: aMenu
         "Set up the menu appropriately for the context-stack-list, unshifted"
         <contextStackMenuShifted: false>
+        ^ aMenu
+                addTranslatedList: #(
-        ^ aMenu addList: #(
                         ('fullStack (f)'                                 fullStack)
                         ('restart (r)'                           restart)
                         ('proceed (p)'                           proceed)
                         ('step (t)'                                      doStep)
                         ('step through (T)'               stepIntoBlock)
                         ('send (e)'                                      send)
                         ('where (w)'                             where)
                         ('peel to first like this'               peelToFirst)
                         -
                         ('return entered value'          returnValue)
+                        - );
+                add: (self isBreakOnEntry ifTrue: ['<on>'] ifFalse: ['<off>']) , 'break on entry' translated
+                        action: #toggleBreakOnEntry;
+                addTranslatedList: #(
-                        -
-                        ('toggle break on entry'        toggleBreakOnEntry)
                         ('senders of    (n)'                     browseSendersOfMessages)
                         ('implementors of    (m)'        browseMessages)
                         ('inheritance (i)'                       methodHierarchy)
-                        -
                         ('versions (v)'                          browseVersions)
                         -
                         ('references    (r)'                     browseVariableReferences)
                         ('assignments    (a)'            browseVariableAssignments)
                         -
                         ('class refs (N)'                                browseClassRefs)
                         ('browse full (b)'                       browseMethodFull)
                         ('file out '                               fileOutMessage)
                         ('remove method (x) '            removeMessage)
                         -
                         ('copy bug report to clipboard' copyBugReportToClipboard));
+                yourself!
-                yourself
- !

Item was changed:
  ----- Method: MessageSet>>mainMessageListMenu: (in category 'message list') -----
  mainMessageListMenu: aMenu
-        "Answer the message-list menu"
         <messageListMenuShifted: false>
+
+        ^ aMenu
+                addTranslatedList: #(
+                        ('what to show...'                      offerWhatToShowMenu));
+                add: (self isBreakOnEntry ifTrue: ['<on>'] ifFalse: ['<off>']) , 'break on entry' translated
+                        action: #toggleBreakOnEntry;
+                addTranslatedList: #(
-        aMenu addList: #(
-                        ('what to show...'                      offerWhatToShowMenu)
-                        ('toggle break on entry'                toggleBreakOnEntry)
                         -
                         ('browse full (b)'                       browseMethodFull)
                         ('browse hierarchy (h)'                 browseClassHierarchy)
                         ('browse protocol (p)'                  browseFullProtocol)
                         -
                         ('fileOut'                              fileOutMessage)
                         ('printOut'                             printOutMessage)
                         ('copy selector (c)'            copySelector)
                         ('copy reference (C)'   copyReference)
                         -
                         ('senders of... (n)'                    browseSendersOfMessages)
                         ('implementors of... (m)'               browseMessages)
                         ('inheritance (i)'                      methodHierarchy)
                         ('versions (v)'                         browseVersions)
                         -
                         ('references... (r)'                    browseVariableReferences)
                         ('assignments... (a)'                   browseVariableAssignments)
                         ('class refs (N)'                       browseClassRefs)
                         -
                         ('remove method (x)'                    removeMessage)
                         ('explore method'                       exploreMethod)
+                        ('inspect method'                       inspectMethod));
+                yourself!
-                        ('inspect method'                       inspectMethod)).
-        ^ aMenu!