Autoload.st
changeset 5076 a927e67cf1db
parent 5046 21b89250759d
child 5345 e7c6030aa2b5
--- a/Autoload.st	Fri Dec 03 18:41:47 1999 +0100
+++ b/Autoload.st	Fri Dec 03 19:28:39 1999 +0100
@@ -169,7 +169,7 @@
      Since autoloaded classes dont know their real definition, simply
      output some comment string making things clear in the browser."
 
-    |myName fileName nm mgr classFileName packageDir package|
+    |myName fileName nm mgr classFileName package|
 
     (self == Autoload) ifTrue:[^ super basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace].
 
@@ -218,17 +218,18 @@
                     nextPutAll:(nm asFilename linkInfo path).
         ]
     ] ifFalse:[
-        aStream cr; nextPutLine:'There is currently no file to load ' , myName , ' from.'; cr.
+        package := self package.
+        (Smalltalk at:#SourceCodeManager) notNil ifTrue:[
+            aStream nextPutAll:'
+When accessed, I''ll ask the sourceCodeManager to load the code 
+from ''' , fileName , '.st'' in the ''' , package , ''' package.'.
+        ] ifFalse:[
+            aStream nextPutAll:'
+When accessed, I''ll search for a file named 
+''' , fileName , '.st'' in the ''' , package , ''' package.
 
-        (mgr := Smalltalk at:#SourceCodeManager) notNil ifTrue:[
-            classFileName := Smalltalk fileNameForClass:myName.
-            packageDir := Smalltalk sourceDirectoryNameOfClass:myName.
-        ].
-        (classFileName notNil and:[packageDir notNil]) ifTrue:[
-            aStream nextPutAll:'When accessed, I''ll ask the sourceCodeManager to load the code 
-from ''' , classFileName , '.st'' in the ''' , packageDir , ''' package.'.
-        ] ifFalse:[
-            aStream nextPutAll:'When accessed, an error will be reported.'.
+Packages are tried along the packagePath, which is:
+' , ((Smalltalk packagePath asStringCollection collect:[:each| '   ' , each]) asStringWith:Character cr). 
         ]
     ].
     aStream cr; nextPutAll:'"'.
@@ -584,6 +585,6 @@
 !Autoload class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Autoload.st,v 1.100 1999-12-02 00:19:08 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Autoload.st,v 1.101 1999-12-03 18:28:39 cg Exp $'
 ! !
 Autoload initialize!