# HG changeset patch # User Claus Gittinger # Date 1364661555 -3600 # Node ID 9e97b3ddbc712dd7239671a8061acc95c8ab5b63 # Parent 56a8d17b69876fb4c41b075a7c6c934b7b88e318 class: ProjectProblem diff -r 56a8d17b6987 -r 9e97b3ddbc71 ProjectProblem.st --- a/ProjectProblem.st Sat Mar 30 17:01:17 2013 +0100 +++ b/ProjectProblem.st Sat Mar 30 17:39:15 2013 +0100 @@ -832,16 +832,29 @@ description "Return a (HTML) describing the problem." - self method package = package ifTrue:[^ 'Already fixed.']. + |mthd text| -^'Method %1 listed in %3 but is in a different package. + (mthd := self method) isNil ifTrue:[ ^ 'Method removed.' ]. + mthd package = package ifTrue:[^ 'Already fixed.']. + mthd package = mthd mclass package ifTrue:[ + text := +'Method %1 listed in %3 but is in its classes package (%4). +Maybe the method used to be an extension but is now a proper part of the class. + +It is recommended to remove the method from the list (%3).' + ] ifFalse:[ + text := +'Method %1 listed in %3 but is in a different package (%4). The package will compile but may fail to (auto)load from sources. It is recommended to either remove the method from the list (%3) or move the method it to the correct package.' - bindWith: (self linkToClass: (Smalltalk classNamed: className) selector: selector) "className" - with: selector - with: (self linkToClass: self packageDefinitionClass class selector: #extensionMethodNames) + ]. + ^ text + bindWith: (self linkToClass: (Smalltalk classNamed: className) selector: selector) "className" + with: selector + with: (self linkToClass: self packageDefinitionClass class selector: #extensionMethodNames) + with: mthd package "Modified: / 23-02-2012 / 15:18:19 / Jan Vrany " ! @@ -849,7 +862,16 @@ label "Return the label (possibly instance if a Text) shortly describing the problem" - ^'Extension method %1 >> %2 listed but in different package' + |mthd text| + + text := 'Extension method %1 >> %2 listed but in different package'. + + (mthd := self method) notNil ifTrue:[ + mthd package = mthd mclass package ifTrue:[ + text := 'Extension method %1 >> %2 listed but in classes package' + ] + ]. + ^ text bindWith: className allBold with: selector allBold @@ -862,10 +884,23 @@ self method package:package ! +doRemoveMethodFromExtensionsList + Dialog warn:'Unimplemented - please remove manually in a browser' +! + fixes + |mthd| + + (mthd := self method) isNil ifTrue:[ ^ #() ]. + mthd package = package ifTrue:[ ^ #() ]. + mthd package = mthd mclass package ifTrue:[ + ^Array + with: (Array with: 'Remove method from the extensions list' with: [ self doRemoveMethodFromExtensionsList ]) + ]. ^Array with: (Array with: 'Move method into package' with: [ self doMoveMethodToProject ]) + with: (Array with: 'Remove method from the extensions list' with: [ self doRemoveMethodFromExtensionsList ]) "Created: / 26-07-2012 / 10:41:18 / Jan Vrany " ! ! @@ -1432,11 +1467,11 @@ !ProjectProblem class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libbasic3/ProjectProblem.st,v 1.13 2013-03-30 15:40:06 cg Exp $' + ^ '$Header: /cvs/stx/stx/libbasic3/ProjectProblem.st,v 1.14 2013-03-30 16:39:15 cg Exp $' ! version_CVS - ^ '$Header: /cvs/stx/stx/libbasic3/ProjectProblem.st,v 1.13 2013-03-30 15:40:06 cg Exp $' + ^ '$Header: /cvs/stx/stx/libbasic3/ProjectProblem.st,v 1.14 2013-03-30 16:39:15 cg Exp $' ! version_SVN