Tools__TagList.st
branchjv
changeset 12123 4bde08cebd48
parent 11051 961760257241
child 12125 0c49a3b13e43
--- a/Tools__TagList.st	Fri Jan 27 22:18:53 2012 +0100
+++ b/Tools__TagList.st	Sun Jan 29 12:53:39 2012 +0000
@@ -197,12 +197,6 @@
     ^ self tagsSuffixes at:#'text/php'
 !
 
-pltSchemeLispSuffixes
-    ^ #('plt')
-
-    "Created: / 21-10-2011 / 09:32:20 / cg"
-!
-
 prologSuffixes
     "returns a list of supported prolog-suffixes
     "
@@ -215,12 +209,6 @@
     ^ self tagsSuffixes at:#'text/python'
 !
 
-racketSchemeLispSuffixes
-    ^ #('rkt')
-
-    "Created: / 21-10-2011 / 09:32:27 / cg"
-!
-
 rubySuffixes
     "returns a list of supported ruby-suffixes
     "
@@ -300,11 +288,7 @@
 isLispSuffix:suffix
     ^ (self isCommonLispSuffix:suffix) 
     or:[(self isSchemeSuffix:suffix)
-    or:[(self isArcLispSuffix:suffix)
-    or:[(self isPltSchemeLispSuffix:suffix)
-    or:[(self isRacketSchemeLispSuffix:suffix)]]]]
-
-    "Modified: / 21-10-2011 / 09:31:30 / cg"
+    or:[self isArcLispSuffix:suffix]]
 !
 
 isMakefileName:fileName
@@ -325,12 +309,6 @@
     ^ self isSuffix:suffix in:self phpSuffixes
 !
 
-isPltSchemeLispSuffix:suffix
-    ^ self isSuffix:suffix in:self pltSchemeLispSuffixes
-
-    "Created: / 21-10-2011 / 09:30:56 / cg"
-!
-
 isPrologSuffix:suffix
     ^ self isSuffix:suffix in:self prologSuffixes
 !
@@ -339,12 +317,6 @@
     ^ self isSuffix:suffix in:self pythonSuffixes
 !
 
-isRacketSchemeLispSuffix:suffix
-    ^ self isSuffix:suffix in:self racketSchemeLispSuffixes
-
-    "Created: / 21-10-2011 / 09:31:04 / cg"
-!
-
 isRubySuffix:suffix
     ^ self isSuffix:suffix in:self rubySuffixes
 !
@@ -1407,19 +1379,6 @@
 shellCommandFor:aFilenameString
     "returns the shellCommand to be used"
 
-    |template|
-
-    (template := self shellCommandTemplateFor:aFilenameString) isNil ifTrue:[
-        ^ nil
-    ].
-    ^ template bindWith:aFilenameString
-
-    "Modified: / 05-01-2012 / 11:10:03 / cg"
-!
-
-shellCommandTemplateFor:aFilenameString
-    "returns the shellCommand to be used (contains %1 for the filename)"
-
     |lcSuffix shellCommand isCSuffix isCPlusPlusSuffix isJavaSuffix isEiffelSuffix isFortranSuffix
      showOnly response suff fn|
 
@@ -1647,7 +1606,7 @@
         ].
 
 "/            shellCommand := shellCommand, ' -f -'.
-        shellCommand := shellCommand, ' "%1"'.
+        shellCommand := shellCommand, ' "' , aFilenameString, '"'.
         remoteTarget notNil ifTrue:[
             ^ (remoteTarget makeRemoteCommandFrom:shellCommand inDirectory:'./').
         ].
@@ -1670,14 +1629,13 @@
     Transcript showCR:('using default ctags command (not ctags from stx): <', shellCommand, '>').
     ctagsCommand := nil. "/ flush - so we will check again.
 
-    shellCommand := shellCommand, ' "%1"'.
+    shellCommand := shellCommand, ' ' , aFilenameString.
     remoteTarget notNil ifTrue:[
         ^ (remoteTarget makeRemoteCommandFrom:shellCommand inDirectory:'./').
     ].
     ^ shellCommand
 
     "Modified: / 08-07-2010 / 00:23:24 / cg"
-    "Created: / 05-01-2012 / 11:07:41 / cg"
 !
 
 sortBlock
@@ -1868,10 +1826,10 @@
 
     shellCmd := (self shellCommandFor:aFile pathName).
     shellCmd isNil ifTrue:[
-        list := self getSimpleTagListFromFile:aFile in:aTempDirectory.
+        list := self getSimpleTagListFromFile:aFile.
     ] ifFalse:[
         tagTypesPresent := false.     "/ will be set again, when ctags command provides types
-        list := self getTagListFromFile:aFile usingCommand:shellCmd mode:nil in:aTempDirectory
+        list := self getTagListFromFile:aFile usingCommand:shellCmd in:aTempDirectory
     ].
     tagTypesPresent := true.
 
@@ -1894,7 +1852,7 @@
     ].    
     self setRawList:list.
 
-    "Modified: / 05-01-2012 / 11:03:29 / cg"
+    "Modified: / 05-05-2011 / 14:47:08 / cg"
 !
 
 fromFile:aFile in:aTempDirectory onTarget:aTarget
@@ -1940,14 +1898,13 @@
     "Modified: / 20-04-2011 / 19:02:54 / cg"
 !
 
-getTagListFromFile:aFile usingCommand:scmd mode:modeOrNil in:aTempDirectory
+getTagListFromFile:aFile usingCommand:scmd in:aTempDirectory
     "create ctags-list from a file, using cmd (which is etags / ctags)"
 
     |list pipe tag tagFile contents mode infoDictionary|
 
-    (mode := modeOrNil) isNil ifTrue:[
-        mode := self getModeFromFileSuffixOf:aFile.
-    ].
+    mode := self getModeFromFileSuffixOf:aFile.
+
     list := OrderedCollection new:512.
 
     infoDictionary := Dictionary new.
@@ -2000,11 +1957,9 @@
 
     scmd = 'ctags' ifFalse:[
         "/ try default ctags without any options
-        ^ self getTagListFromFile:aFile usingCommand:'ctags' mode:modeOrNil in:aTempDirectory
+        ^ self getTagListFromFile:aFile usingCommand:'ctags' in:aTempDirectory
     ].
     ^ #()
-
-    "Created: / 05-01-2012 / 11:03:04 / cg"
 !
 
 tagFromLine:aLine mode:languageMode using:infoDictionary
@@ -2303,16 +2258,14 @@
     "Modified: / 08-05-2011 / 10:36:23 / cg"
 !
 
-getSimpleTagListFromFile:aFileOrString in:aTempDirectory
+getSimpleTagListFromFile:aFile
     "fallback, if no ctags is present, or if the file is not a c-file.
      Implemented here for some other file types (Makefiles)
     "
-    |file lcName pathName suffix|
-
-    file := aFileOrString asFilename.
-    lcName := file baseName asLowercase.
-    pathName := file pathName.
-
+    |lcName pathName suffix|
+
+    lcName := aFile asFilename baseName asLowercase.
+    pathName := aFile asFilename pathName.
     self class makeFilePatterns do:[:aPattern |
         (aPattern match:lcName) ifTrue:[
             ^ self class makeTargetTagsInFile:pathName filter:showOnly
@@ -2323,7 +2276,7 @@
 
     (self class isSmalltalkSuffix:suffix) ifTrue:[
         "/ smalltalk tags - simulated
-        ^ self stTagsInFile:pathName in:aTempDirectory
+        ^ self stTagsInFile:pathName
     ].
     (self class isPythonSuffix:suffix) ifTrue:[
         "/ python tags - simulated
@@ -2374,7 +2327,7 @@
     "/ could add more here ...
     ^ nil.
 
-    "Created: / 05-01-2012 / 10:55:03 / cg"
+    "Modified: / 20-04-2011 / 19:06:26 / cg"
 !
 
 htmlTagsInFile:aFilePath
@@ -3054,16 +3007,15 @@
     "Modified: / 08-05-2011 / 10:38:44 / cg"
 !
 
-stTagsInFile:aFilePath in:aTempDirectory
+stTagsInFile:aFilePath
     "smalltalk tags:
-     not so naive: generate a changeList from the contents and convert it into a tag-list
+     generate a changeList from the contents and convert it into a tag-list
     "
 
-    |targets s anyPrimitiveDefinitions shellCmd cTagsList|
+    |targets s|
 
     Tag autoload.
 
-    anyPrimitiveDefinitions := false.
     targets := OrderedCollection new.
     s := aFilePath asFilename readStream.
     s notNil ifTrue:[
@@ -3093,19 +3045,6 @@
                                             type:nil
                                             lineNumber:lNr).
                             ]
-                        ] ifFalse:[
-                            aChange isPrimitiveChange ifTrue:[
-                                targets add:(Tag::TMacro
-                                            label:(aChange isPrimitiveDefinitionsChange
-                                                        ifTrue:['<< primitive definitions >>']
-                                                        ifFalse:[ (aChange isPrimitiveFunctionsChange
-                                                                    ifTrue:['<< primitive functions >>']
-                                                                    ifFalse:['<< primitive variables >>'])])
-                                            pattern:('/^' , aChange source asStringCollection first)
-                                            type:nil
-                                            lineNumber:lNr).
-                                anyPrimitiveDefinitions := true
-                            ]
                         ]
                     ].
                 ]
@@ -3114,23 +3053,9 @@
             s close.
         ].
     ].
-
-    anyPrimitiveDefinitions ifTrue:[
-        "/ also invoke ctags on the file, merge those tags.
-        "/ sorry: not perfect, because ctags seems to get confused by the extra %{ %} nesting.
-        shellCmd := (self shellCommandTemplateFor:(aFilePath asFilename withSuffix:'c') pathName)
-                        bindWith:aFilePath.
-        shellCmd notNil ifTrue:[
-            cTagsList := self getTagListFromFile:aFilePath asFilename usingCommand:shellCmd mode:#c in:aTempDirectory.
-            cTagsList notEmptyOrNil ifTrue:[
-                ^ cTagsList , targets
-            ].
-        ].
-    ].
-
     ^ targets
 
-    "Created: / 05-01-2012 / 10:56:26 / cg"
+    "Modified: / 08-05-2011 / 10:38:09 / cg"
 !
 
 tclTagsInFile:aFilePath
@@ -3274,14 +3199,10 @@
 
 !TagList class methodsFor:'documentation'!
 
-version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__TagList.st,v 1.9 2012-01-05 10:29:21 cg Exp $'
-!
-
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__TagList.st,v 1.9 2012-01-05 10:29:21 cg Exp $'
+    ^ '§Header: /cvs/stx/stx/libtool/Tools__TagList.st,v 1.6 2011/07/03 15:05:02 cg Exp §'
 !
 
 version_SVN
-    ^ '§Id§'
-! !
+    ^ '$Id$'
+! !
\ No newline at end of file