AbstractSourceCodeManager.st
changeset 769 35f1e380bd30
parent 759 2d7e72bae18b
child 792 901f03b078db
--- a/AbstractSourceCodeManager.st	Wed May 19 15:21:23 1999 +0200
+++ b/AbstractSourceCodeManager.st	Tue Jun 08 23:04:30 1999 +0200
@@ -839,7 +839,7 @@
      present (i.e. there is no way to extract the package info).
      If nil, the package is extracted from the class - which must exist."
 
-    |cls sourceInfo classFileName packageDir moduleDir s m components|
+    |cls sourceInfo classFileName packageDir moduleDir s m components i|
 
     cls := Smalltalk classNamed:aClassName.
     cls notNil ifTrue:[
@@ -852,10 +852,20 @@
     ] ifFalse:[
         classFileName := (Smalltalk fileNameForClass:aClassName) , '.st'.
         packageDir := Smalltalk sourceDirectoryNameOfClass:aClassName.
-        (packageDir notNil and:[packageDir startsWith:'stx/']) ifTrue:[
-            packageDir := packageDir copyFrom:5.
+        packageDir notNil ifTrue:[
+            (packageDir startsWith:'stx/') ifTrue:[
+                packageDir := packageDir copyFrom:5.
+            ] ifFalse:[
+                i := packageDir indexOf:$:.
+                i ~~ 0 ifTrue:[
+                    moduleDir := packageDir copyTo:i-1.
+                    packageDir := packageDir copyFrom:i+1
+                ]
+            ]
         ].
-        moduleDir := 'stx'.
+        moduleDir isNil ifTrue:[
+            moduleDir := 'stx'
+        ].
     ].
 
     packageDir isNil ifTrue:[
@@ -1136,7 +1146,7 @@
     ^ nil
 
     "
-     SourceCodeManager revisionInfoFromString:'$Revision: 1.94 $'
+     SourceCodeManager revisionInfoFromString:'$Revision: 1.95 $'
      SourceCodeManager revisionInfoFromString:(SourceCodeManager version)
     "
 
@@ -1472,6 +1482,6 @@
 !AbstractSourceCodeManager class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.94 1999-04-23 16:24:54 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.95 1999-06-08 21:04:30 stefan Exp $'
 ! !
 AbstractSourceCodeManager initialize!