--- a/Tools__NewSystemBrowser.st Thu Nov 27 11:41:19 2014 +0100
+++ b/Tools__NewSystemBrowser.st Thu Nov 27 12:50:14 2014 +0100
@@ -14,59 +14,59 @@
"{ NameSpace: Tools }"
SystemBrowser subclass:#NewSystemBrowser
- instanceVariableNames:'environmentHolder environment navigationState bufferNameList
- selectedBuffer buffers bufferUsageOrder browserCanvas
- immediateUpdate showClassPackages lastMethodCategory
- lastMethodMoveClass browserCanvasType
- syntaxColoringProcessRunning syntaxColoringProcess
- methodInfoProcess browsletShowHideLabelHolder browserPageCanvas
- isEmbedded hasNonEmptyEnvironmentSelectedHolder
- smalllintRulesOrAllHolder smalllintRulesOrDefaultHolder'
- classVariableNames:'LastNewProtocols LastProtocolRenames LastCategoryRenames
- LastCategoryRenameOld LastCategoryRenameNew LastProjectMoves
- LastNameSpaceMove LastMethodMoveOrCopyTargetClass
- LastClassFilterBlockString LastMethodFilterBlockString
- LastBreakPointConditionString LastIndividualChecks
- LastAcceptPackage LastVariableRenames LastVisitorClassName
- LastTemporaryVariableName FindHistory
- CheckForInstancesWhenRemovingClasses SynchronousUpdate
- DoubleClickIsOpenBrowser ShowMethodTemplateWhenProtocolIsSelected
- DefaultShowMethodInheritance DefaultEmphasizeUnloadedClasses
- DefaultImmediateSyntaxColoring DefaultImmediateExplaining
- DefaultSyntaxColoring DefaultToolBarVisible
- DefaultCodeInfoVisible DefaultShortNameInTabs
- DefaultHideUnloadedClasses DefaultMarkApplications
- DefaultAutoFormat DefaultShowMethodComplexity
- DefaultShowMethodTypeIcon DefaultShowSpecialResourceEditors
- DefaultShowSyntheticMethods SharedMethodCategoryCache
- LastMethodProcessingBlockString LastLoadedPackages
- DefaultShortAllClassesInNameSpaceOrganisation LastBaseVersionTag
- LastTag DefaultShowPseudoProtocols DefaultShowMultitabMode
- LastRenamedOld LastRenamedNew LastImportedPackage
- LastLintRulesHolder NewNavigationHistory
- LastLiteralReplacementType LastLiteralReplacementNewName
- LastLiteralReplacementOldLiteral LastNewProjectType
- LastClassProcessingBlockString RecentlyClosedList
- LastClassSearchBoxShowedFullName CachedTagToRevisionMapping
- CachedMethodsImplemented LastCypressDirectory
- LastClassSearchBoxShowedJavaOnly LastRemoteRepository
- LastClassDocDirectory'
- poolDictionaries:''
- category:'Interface-Browsers-New'
+ instanceVariableNames:'environmentHolder environment navigationState bufferNameList
+ selectedBuffer buffers bufferUsageOrder browserCanvas
+ immediateUpdate showClassPackages lastMethodCategory
+ lastMethodMoveClass browserCanvasType
+ syntaxColoringProcessRunning syntaxColoringProcess
+ methodInfoProcess browsletShowHideLabelHolder browserPageCanvas
+ isEmbedded hasNonEmptyEnvironmentSelectedHolder
+ smalllintRulesOrAllHolder smalllintRulesOrDefaultHolder'
+ classVariableNames:'LastNewProtocols LastProtocolRenames LastCategoryRenames
+ LastCategoryRenameOld LastCategoryRenameNew LastProjectMoves
+ LastNameSpaceMove LastMethodMoveOrCopyTargetClass
+ LastClassFilterBlockString LastMethodFilterBlockString
+ LastBreakPointConditionString LastIndividualChecks
+ LastAcceptPackage LastVariableRenames LastVisitorClassName
+ LastTemporaryVariableName FindHistory
+ CheckForInstancesWhenRemovingClasses SynchronousUpdate
+ DoubleClickIsOpenBrowser ShowMethodTemplateWhenProtocolIsSelected
+ DefaultShowMethodInheritance DefaultEmphasizeUnloadedClasses
+ DefaultImmediateSyntaxColoring DefaultImmediateExplaining
+ DefaultSyntaxColoring DefaultToolBarVisible
+ DefaultCodeInfoVisible DefaultShortNameInTabs
+ DefaultHideUnloadedClasses DefaultMarkApplications
+ DefaultAutoFormat DefaultShowMethodComplexity
+ DefaultShowMethodTypeIcon DefaultShowSpecialResourceEditors
+ DefaultShowSyntheticMethods SharedMethodCategoryCache
+ LastMethodProcessingBlockString LastLoadedPackages
+ DefaultShortAllClassesInNameSpaceOrganisation LastBaseVersionTag
+ LastTag DefaultShowPseudoProtocols DefaultShowMultitabMode
+ LastRenamedOld LastRenamedNew LastImportedPackage
+ LastLintRulesHolder NewNavigationHistory
+ LastLiteralReplacementType LastLiteralReplacementNewName
+ LastLiteralReplacementOldLiteral LastNewProjectType
+ LastClassProcessingBlockString RecentlyClosedList
+ LastClassSearchBoxShowedFullName CachedTagToRevisionMapping
+ CachedMethodsImplemented LastCypressDirectory
+ LastClassSearchBoxShowedJavaOnly LastRemoteRepository
+ LastClassDocDirectory'
+ poolDictionaries:''
+ category:'Interface-Browsers-New'
!
ListEntry subclass:#OwnershipGraph
- instanceVariableNames:'ownershipInfo cachedForm'
- classVariableNames:''
- poolDictionaries:''
- privateIn:NewSystemBrowser
+ instanceVariableNames:'ownershipInfo cachedForm'
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:NewSystemBrowser
!
Object subclass:#RevisionOwnershipInfo
- instanceVariableNames:'revision author date lineOwnership'
- classVariableNames:''
- poolDictionaries:''
- privateIn:NewSystemBrowser::OwnershipGraph
+ instanceVariableNames:'revision author date lineOwnership'
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:NewSystemBrowser::OwnershipGraph
!
!NewSystemBrowser class methodsFor:'documentation'!
@@ -19122,6 +19122,8 @@
"Created: / 24.2.2000 / 23:28:06 / cg"
! !
+
+
!NewSystemBrowser methodsFor:'aspects-organization'!
categoryMenuVisible
@@ -27378,9 +27380,7 @@
categoryMenuSmalllintCheck: what
"perform all checks on the selected class(es)."
- self
- smalllintCheck:self selectedCategoriesAsEnvironment
- against: what
+ self smalllintRun:what onEnvironment:self selectedCategoriesAsEnvironment
"Modified: / 28-12-2008 / 14:42:01 / bazantj <enter your email here>"
"Modified: / 13-01-2009 / 13:20:48 / Jiri Bazant <bazanj2@fel.cvut.cz>"
@@ -27636,128 +27636,15 @@
"Run previously selected rules or default rules on
currently selected code (depends on navigation state)"
- ^ self
- smalllintCheck: self selectedCodeComponentsAsEnvironment
- against: self smalllintRulesOrDefaultHolder value
+ ^ self smalllintRun:self smalllintRulesOrDefaultHolder value
+ onEnvironment:self selectedCodeComponentsAsEnvironment
"Modified: / 07-03-2012 / 17:39:34 / cg"
"Modified: / 27-11-2014 / 10:20:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
-runLintOnPreviousRules
- "run the new smallLint checker tool"
-
- self
- smalllintCheck: self selectedCodeComponentsAsEnvironment
- against: LastLintRulesHolder value
-
- "Modified (comment): / 01-03-2012 / 14:10:47 / cg"
- "Created: / 07-03-2012 / 17:39:28 / cg"
- "Modified: / 27-11-2014 / 09:39:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-runLintOnSelectedRules
- "run the new smallLint checker tool on selected rules"
-
- self
- smalllintCheck: self selectedCodeComponentsAsEnvironment
- against: nil
-
- "Created: / 07-03-2012 / 17:40:23 / cg"
- "Modified: / 27-11-2014 / 09:38:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-smalllintCheck:rbenvironment against:ruleSetOrNil
- "Run given SmallLint rules on given browser environment.
- If `ruleSetOrNil` is nil. then ask sure for set of
- rules.
-
- As a side effect, remembers run rules so next time user
- do 'Run Again', these rules we be run."
-
- | rule runRules |
-
- ruleSetOrNil isNil ifTrue:[
- | dialog |
-
- dialog := Tools::LintRuleSelectionDialog new.
- dialog open.
- dialog accepted ifTrue:[
- rule := dialog selectionAsRule
- ] ifFalse:[
- ^ self
- ].
- ] ifFalse:[
- rule := ruleSetOrNil.
- ].
- rule isEmptyInTree ifTrue:[
- self inlineMessageApp
- reset;
- beInformation;
- message: (resources string: 'Ruleset ''%1'' is empty!!' with: rule name);
- addButtonOK;
- show.
- ^ self.
- ].
-
- LastLintRulesHolder isNil ifTrue:[
- LastLintRulesHolder := ValueHolder new.
- ].
- LastLintRulesHolder value: rule.
-
- runRules :=
- [
- "/ Run on copy, because running rules has a sideeffect
- "/ of modifying the rule (storing in its result)
- rule := rule copy.
- self smalllintRunRule:rule onEnvironment:rbenvironment.
- [rule notNil and:[rule isEmpty]] whileTrue:[
- (Dialog confirm:'Nothing special found.\\Proceed to select more/different lint rules.' withCRs) ifTrue:[
- | dialog |
-
- dialog := Tools::LintRuleSelectionDialog new.
- dialog open.
- dialog accepted ifTrue:[
- rule := dialog selectionAsRule
- ] ifFalse:[
- rule := nil.
- ].
- rule notNil ifTrue:[
- "/ Run on copy, because running rules has a sideeffect
- "/ of modifying the rule (storing in its result)
- rule := rule copy.
- self smalllintRunRule:rule onEnvironment:rbenvironment.
- ].
- ] ifFalse:[
- rule := nil
- ].
- ].
- rule notNil ifTrue:[
- self
- spawnSmalllintBrowserByRuleFor:rule
- in:#newBuffer
- label:'SmallLint results for ' , rbenvironment label
- ].
- ].
-
- "background operation (Jan's pref) makes it difficult to stop and debug...)"
- UserPreferences current runLintChecksInBackground ifTrue:[
- self showMessage:'Checking code...' whileExecutingBackgroundAction:runRules.
- ] ifFalse:[
- self withWaitCursorDo:runRules
- ].
-
- "Modified: / 15-12-2008 / 18:51:43 / Josef Grega <gregaj1@fel.cvut.cz>"
- "Modified: / 28-12-2008 / 14:40:01 / bazantj <enter your email here>"
- "Created: / 24-02-2009 / 11:02:57 / Jan Vrany <vranyj1@fel.cvut.cz>"
- "Modified: / 22-07-2009 / 14:38:30 / Jan Vrany <vranyj1@fel.cvut.cz>"
- "Modified: / 15-05-2012 / 10:46:02 / cg"
- "Modified: / 27-11-2014 / 10:18:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
smalllintRulesOrDefault
- "Returns a set of user-selected SmallLint rules or all rules,
- if no user selection is done"
+ "Return last run rules or default ruleset if no checks has been run so far"
(LastLintRulesHolder isNil or:[ LastLintRulesHolder value isNil ]) ifTrue:[
| default |
@@ -27773,11 +27660,11 @@
"Created: / 28-02-2013 / 22:42:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 16-10-2014 / 10:45:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (comment): / 27-11-2014 / 11:41:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
smalllintRulesOrDefaultHolder
- "Returns a holder on user-selected SmallLint rules
- (or all rules if user made no selection"
+ "Return a holder on last run rules or on default ruleset if no checks has been run so far"
smalllintRulesOrDefaultHolder isNil ifTrue:[
LastLintRulesHolder isNil ifTrue:[ LastLintRulesHolder := ValueHolder new ].
@@ -27787,10 +27674,112 @@
"Created: / 28-02-2013 / 22:43:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 07-10-2014 / 13:11:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-smalllintRunRule: aLintRule onEnvironment: anEnvironment
- "run a checker in the background"
+ "Modified (comment): / 27-11-2014 / 11:42:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+smalllintRun
+ "Run previously selected rules or default rules on
+ currently selected code (depends on navigation state)"
+
+ ^ self smalllintRunOnEnvironment: self selectedCodeComponentsAsEnvironment
+
+ "Created: / 27-11-2014 / 11:43:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+smalllintRun:ruleSetOrNil onEnvironment:rbenvironment
+ "Run given SmallLint rules on given browser environment.
+ If `ruleSetOrNil` is nil. then ask sure for set of
+ rules.
+
+ As a side effect, remembers run rules so next time user
+ do 'Run Again', these rules we be run."
+
+ | rule runRules |
+
+ ruleSetOrNil isNil ifTrue:[
+ | dialog |
+
+ dialog := Tools::LintRuleSelectionDialog new.
+ dialog open.
+ dialog accepted ifTrue:[
+ rule := dialog selectionAsRule
+ ] ifFalse:[ ^ self ].
+ ] ifFalse:[
+ rule := ruleSetOrNil.
+ ].
+ rule isEmptyInTree ifTrue:[
+ (self inlineMessageApp)
+ reset;
+ beInformation;
+ message:(resources string:'Ruleset ''%1'' is empty!!' with:rule name);
+ addButtonOK;
+ show.
+ ^ self.
+ ].
+ LastLintRulesHolder isNil ifTrue:[
+ LastLintRulesHolder := ValueHolder new.
+ ].
+ LastLintRulesHolder value:rule.
+ runRules := [
+ "/ Run on copy, because running rules has a sideeffect
+ "/ of modifying the rule (storing in its result)
+ rule := rule copy.
+ self smalllintRunRule:rule onEnvironment:rbenvironment.
+ [ rule notNil and:[ rule isEmpty ] ] whileTrue:[
+ (Dialog confirm:(resources string: 'Nothing special found.\\Proceed to select more/different lint rules.') withCRs) ifTrue:[
+ | dialog |
+
+ dialog := Tools::LintRuleSelectionDialog new.
+ dialog open.
+ dialog accepted ifTrue:[
+ rule := dialog selectionAsRule
+ ] ifFalse:[
+ rule := nil.
+ ].
+ rule notNil ifTrue:[
+ "/ Run on copy, because running rules has a sideeffect
+ "/ of modifying the rule (storing in its result)
+ rule := rule copy.
+ self smalllintRunRule:rule onEnvironment:rbenvironment.
+ ].
+ ] ifFalse:[
+ rule := nil
+ ].
+ ].
+ rule notNil ifTrue:[
+ self
+ spawnSmalllintBrowserByRuleFor:rule
+ in:#newBuffer
+ label:'SmallLint results for ' , rbenvironment label
+ ].
+ ].
+ "background operation (Jan's pref) makes it difficult to stop and debug...)"
+ UserPreferences current runLintChecksInBackground ifTrue:[
+ self showMessage:'Checking code...' whileExecutingBackgroundAction:runRules.
+ ] ifFalse:[
+ self withWaitCursorDo:runRules
+ ].
+
+ "Modified: / 15-12-2008 / 18:51:43 / Josef Grega <gregaj1@fel.cvut.cz>"
+ "Modified: / 28-12-2008 / 14:40:01 / bazantj <enter your email here>"
+ "Created: / 24-02-2009 / 11:02:57 / Jan Vrany <vranyj1@fel.cvut.cz>"
+ "Modified: / 22-07-2009 / 14:38:30 / Jan Vrany <vranyj1@fel.cvut.cz>"
+ "Modified: / 15-05-2012 / 10:46:02 / cg"
+ "Modified: / 27-11-2014 / 11:35:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+smalllintRunOnEnvironment:aBrowserEnvironment
+ "Run previously selected rules or default rules on given environment"
+
+ ^ self smalllintRun: self smalllintRulesOrDefaultHolder value onEnvironment: aBrowserEnvironment
+
+ "Created: / 27-11-2014 / 11:46:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+smalllintRunRule: anRBLintRule onEnvironment: aBrowserEnvironment
+ "Internal helper: Actually run the given rule on given environment.
+ THis is called from a background worker - see smallLintRun:onEnvironment:
+ "
| rules checker |
@@ -27798,7 +27787,7 @@
"/ checker := SmalllintChecker.
checker := (Smalltalk at:#SmalllintChecker).
- rules := aLintRule flattened.
+ rules := anRBLintRule flattened.
rules withIndexDo:[:rule :index|
|t|
@@ -27808,7 +27797,7 @@
raiseRequest.
[
- checker runRule: rule onEnvironment: anEnvironment
+ checker runRule: rule onEnvironment: aBrowserEnvironment
] value. "/ benchmark: rule name, ': '.
].
ProgressNotification new
@@ -27822,6 +27811,15 @@
"Created: / 28-08-2010 / 12:12:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 01-03-2012 / 15:22:20 / cg"
"Modified: / 14-10-2014 / 18:01:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (comment): / 27-11-2014 / 11:38:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+smalllintRunSelectedOnEnvironment:aBrowserEnvironment
+ "Ask user for rules and run them on given environment"
+
+ ^ self smalllintRun: nil onEnvironment: aBrowserEnvironment
+
+ "Created: / 27-11-2014 / 11:49:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
spawnSmalllintBrowserByRuleFor: result in:where label:labelOrNil
@@ -28598,9 +28596,7 @@
Dialog warn:'Missing refactoryBrowser/browser package'.
^ self.
].
- self
- smalllintCheck:self selectedClassesAsEnvironment
- against: what
+ self smalllintRun:what onEnvironment:self selectedClassesAsEnvironment
"Modified: / 28-12-2008 / 14:42:01 / bazantj <enter your email here>"
"Modified: / 13-01-2009 / 13:20:48 / Jiri Bazant <bazanj2@fel.cvut.cz>"
@@ -38702,6 +38698,7 @@
HTMLDocumentView openFullOnDocumentationFile:'TOP.html'
! !
+
!NewSystemBrowser methodsFor:'menu actions-inheritance'!
inheritanceMenuNavigateToClass
@@ -42380,9 +42377,7 @@
projectMenuSmalllintCheck: what
"perform all checks on the selected project's class(es)."
- self
- smalllintCheck:self selectedPackagesAsEnvironment
- against: what
+ self smalllintRun:what onEnvironment:self selectedPackagesAsEnvironment
"Created: / 05-05-2012 / 10:19:44 / cg"
!
@@ -43080,9 +43075,7 @@
protocolCheckMenuSmalllintCheck: what
"perform all checks on the selected class(es)."
- self
- smalllintCheck:self selectedProtocolsAsEnvironment
- against: what
+ self smalllintRun:what onEnvironment:self selectedProtocolsAsEnvironment
"Modified: / 28-12-2008 / 14:42:01 / bazantj <enter your email here>"
"Modified: / 13-01-2009 / 13:20:48 / Jiri Bazant <bazanj2@fel.cvut.cz>"
@@ -45216,9 +45209,7 @@
selectorCheckMenuSmalllintCheck: what
"perform all checks on the selected class(es)."
- self
- smalllintCheck:self selectedSelectorsAsEnvironment
- against: what
+ self smalllintRun:what onEnvironment:self selectedSelectorsAsEnvironment
"Modified: / 28-12-2008 / 14:42:01 / bazantj <enter your email here>"
"Modified: / 13-01-2009 / 13:20:48 / Jiri Bazant <bazanj2@fel.cvut.cz>"
@@ -51600,6 +51591,7 @@
"Modified: / 19-10-2011 / 16:48:31 / cg"
! !
+
!NewSystemBrowser methodsFor:'menus-dynamic-lint'!
smalllintCheckMenuForCategory
@@ -51630,23 +51622,24 @@
LastLintRulesHolder value notNil ifTrue:[
menu addItem:
(MenuItem label: (resources string: 'Run Again - %1' with: LastLintRulesHolder value displayString)
- itemValue: [ self smalllintCheck: rbenvironment against: LastLintRulesHolder value ])
+ itemValue: [ self smalllintRunOnEnvironment:rbenvironment ])
] ifFalse:[
menu addItem: (MenuItem label: (resources string: 'Run Again')
- itemValue: [ self smalllintCheck: rbenvironment against: LastLintRulesHolder value ]
+ itemValue: [ self smalllintRunOnEnvironment:rbenvironment ]
enabled: false)
].
RBCompositeLintRule rulesets do:[:ruleset|
menu addItem:
(MenuItem label: (resources string: 'Run Checks - %1' with: ruleset displayString)
- itemValue: [ self smalllintCheck: rbenvironment against: ruleset ])
+ itemValue: [ self smalllintRun:ruleset onEnvironment:rbenvironment ])
].
menu addItem:
(MenuItem label: (resources string: 'Run Selected...')
- itemValue: [ self smalllintCheck: rbenvironment against: nil ]).
+ itemValue: [ self smalllintRunSelectedOnEnvironment:rbenvironment ]).
^ menu
"Created: / 27-11-2014 / 06:16:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 27-11-2014 / 11:49:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
smalllintCheckMenuForPackage
@@ -57067,6 +57060,7 @@
"Created: / 04-12-2011 / 22:22:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+
!NewSystemBrowser methodsFor:'private-semantic checks'!
checkAcceptedMethod:aMethod inClass:aClass
@@ -61564,11 +61558,11 @@
!NewSystemBrowser class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.2129 2014-11-27 10:41:19 vrany Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.2130 2014-11-27 11:50:14 vrany Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.2129 2014-11-27 10:41:19 vrany Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.2130 2014-11-27 11:50:14 vrany Exp $'
!
version_HG
@@ -61577,7 +61571,7 @@
!
version_SVN
- ^ '$Id: Tools__NewSystemBrowser.st,v 1.2129 2014-11-27 10:41:19 vrany Exp $'
+ ^ '$Id: Tools__NewSystemBrowser.st,v 1.2130 2014-11-27 11:50:14 vrany Exp $'
! !