-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
browser: indicate out-of-sync messages, make target label more compact
- Loading branch information
Showing
19 changed files
with
102 additions
and
16 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
packages/SwaLintBrowser.package/SL2MethodResult.class/instance/isOutOfSync.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
testing | ||
isOutOfSync | ||
|
||
^ self method isInstalled not | ||
and: [self method timeStamp ~= ([self method methodReference timeStamp] ifError: [nil])] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/SwaLintBrowser.package/SL2Result.class/instance/isOutOfSync.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
testing | ||
isOutOfSync | ||
|
||
^ false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 17 additions & 2 deletions
19
packages/SwaLintBrowser.package/SL2Target.class/instance/label.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,20 @@ | ||
accessing | ||
label | ||
|
||
self flag: #todo. "compute compact representation" | ||
^ '{1} / {2}' format: {self systemCategories asCommaStringAnd. self classes asCommaStringAnd} | ||
| allCategories allClasses | | ||
self flag: #todo. "compute more compact representation" | ||
|
||
allCategories := OrderedCollection new. | ||
allClasses := OrderedCollection withAll: self classes. | ||
self systemCategories do: [:category | | ||
| categoryClasses | | ||
categoryClasses := SystemOrganizer default listAtCategoryNamed: category. | ||
(allClasses includesAllOf: categoryClasses) ifTrue: | ||
[allClasses removeAll: categoryClasses. | ||
allCategories add: category]]. | ||
|
||
allCategories ifEmpty: | ||
[allClasses ifEmpty: [^ '(none)']. | ||
^ allClasses asCommaStringAnd]. | ||
allClasses ifEmpty: [^ allCategories asCommaStringAnd]. | ||
^ '{1} + {2}' format: {allCategories asCommaStringAnd. allClasses asCommaStringAnd} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
packages/SwaLintBrowser.package/SwaLintBrowser.class/instance/basicHelpForMessage..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
accessing - toolbuilder | ||
basicHelpForMessage: message | ||
|
||
| selector iconHelp method | | ||
Preferences balloonHelpInMessageLists ifFalse: [^ nil]. | ||
|
||
selector := (Symbol lookup: message) ifNil: [^ nil]. | ||
method := self selectedClassOrMetaClass compiledMethodAt: selector ifAbsent: [^ nil]. | ||
iconHelp := (self messageIconHelpFor: method selector) ifNotEmpty: [:t | | ||
t , Character cr, Character cr]. | ||
|
||
^ iconHelp asText | ||
append: (self messageHelpForMethod: method); | ||
yourself |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
packages/SwaLintBrowser.package/SwaLintBrowser.class/instance/contents.notifying..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
accessing - toolbuilder | ||
contents: input notifying: aController | ||
|
||
^ (super contents: input notifying: aController) | ||
ifTrue: [self changed: #messageLabels]; | ||
yourself |
10 changes: 10 additions & 0 deletions
10
packages/SwaLintBrowser.package/SwaLintBrowser.class/instance/helpForMessage..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
accessing - toolbuilder | ||
helpForMessage: message | ||
|
||
| help | | ||
help := [self basicHelpForMessage: message] ifError: [nil]. | ||
|
||
(self isMessageOutOfSync: message) ifTrue: | ||
[help := '<i>This method has been changed after running the rests. You can press the <b>Run</b> button to update the results.</i>' asTextFromHtml , | ||
(help isEmptyOrNil ifTrue: [''] ifFalse: [String cr , String cr , help])]. | ||
^ help |
4 changes: 4 additions & 0 deletions
4
packages/SwaLintBrowser.package/SwaLintBrowser.class/instance/helpForMessageAt..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing - toolbuilder | ||
helpForMessageAt: index | ||
|
||
^ self helpForMessage: (self messages at: index ifAbsent: [^ nil]) |
4 changes: 4 additions & 0 deletions
4
packages/SwaLintBrowser.package/SwaLintBrowser.class/instance/isMessageOutOfSync..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
private | ||
isMessageOutOfSync: message | ||
|
||
^ (self resultsForTestAndClassSelectionAndMessage: message) anySatisfy: [:result | result isOutOfSync] |
16 changes: 12 additions & 4 deletions
16
packages/SwaLintBrowser.package/SwaLintBrowser.class/instance/labelForMessage..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
accessing - toolbuilder | ||
labelForMessage: message | ||
|
||
| count label | | ||
| label messageResults count | | ||
label := message asString. | ||
count := (self resultsForTestAndClassSelectionAndMessage: message) size. | ||
count = 1 ifTrue: [^ label]. | ||
^ '{1} ({2})' format: {label. count} | ||
messageResults := self resultsForTestAndClassSelectionAndMessage: message. | ||
count := messageResults size. | ||
count = 1 ifFalse: | ||
[label := '{1} ({2})' format: {label. count}]. | ||
|
||
(messageResults anySatisfy: [:result | result isOutOfSync]) ifTrue: | ||
[label := label asText | ||
addAttribute: (TextColor color: Color gray); | ||
yourself]. | ||
|
||
^ label |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
packages/SwaLintBrowser.package/SwaLintBrowser.class/instance/updateListsAndCodeIn..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
updating | ||
updateListsAndCodeIn: aWindow | ||
|
||
super updateListsAndCodeIn: aWindow. | ||
|
||
(self messages anySatisfy: [:message | self isMessageOutOfSync: message]) ifTrue: | ||
[self changed: #messageLabels]. | ||
self changed: #targetLabel. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters