Tools__TagList.st
changeset 13215 187a0aabc409
parent 13153 23ad227fb44e
child 13250 0decde6c459d
child 13311 106b5dc6fa0d
equal deleted inserted replaced
13214:7727357e3c6f 13215:187a0aabc409
  2059 
  2059 
  2060 fromFile:aFile in:aTempDirectory
  2060 fromFile:aFile in:aTempDirectory
  2061     "create tags from a file;
  2061     "create tags from a file;
  2062      either use the ctags/etags command, or an intenral naive, simple method."
  2062      either use the ctags/etags command, or an intenral naive, simple method."
  2063 
  2063 
  2064     |list shellCmd numTags fileContents|
  2064     |forceSimpleTagList list shellCmd numTags fileContents|
  2065 
  2065 
  2066     rawList := nil.
  2066     rawList := nil.
  2067     list := OrderedCollection new.
  2067     list := OrderedCollection new.
  2068 
  2068 
  2069     shellCmd := (self shellCommandFor:aFile pathName).
  2069     forceSimpleTagList := false.
  2070     shellCmd notNil ifTrue:[
  2070     "/ the simple builtin tagList generator is actually better than the ctags output for makefiles
  2071         tagTypesPresent := false.     "/ will be set again, when ctags command provides types
  2071     (self class makeFilePatterns contains:[:aPattern | (aPattern match:aFile baseName asLowercase)]) ifTrue:[forceSimpleTagList := true].
  2072         list := self getTagListFromFile:aFile usingCommand:shellCmd mode:nil in:aTempDirectory
  2072 
       
  2073     forceSimpleTagList ifFalse:[
       
  2074         shellCmd := (self shellCommandFor:aFile pathName).
       
  2075         shellCmd notNil ifTrue:[
       
  2076             tagTypesPresent := false.     "/ will be set again, when ctags command provides types
       
  2077             list := self getTagListFromFile:aFile usingCommand:shellCmd mode:nil in:aTempDirectory
       
  2078         ].
  2073     ].
  2079     ].
  2074 
  2080 
  2075     "/ in case ctags could not find anything, try our own, naive fallback (not too bad either)
  2081     "/ in case ctags could not find anything, try our own, naive fallback (not too bad either)
  2076     list isEmptyOrNil ifTrue:[
  2082     list isEmptyOrNil ifTrue:[
  2077         list := self getSimpleTagListFromFile:aFile in:aTempDirectory.
  2083         list := self getSimpleTagListFromFile:aFile in:aTempDirectory.
  3659 ! !
  3665 ! !
  3660 
  3666 
  3661 !TagList class methodsFor:'documentation'!
  3667 !TagList class methodsFor:'documentation'!
  3662 
  3668 
  3663 version
  3669 version
  3664     ^ '$Header: /cvs/stx/stx/libtool/Tools__TagList.st,v 1.28 2013-07-10 08:39:01 cg Exp $'
  3670     ^ '$Header: /cvs/stx/stx/libtool/Tools__TagList.st,v 1.29 2013-07-23 23:20:56 cg Exp $'
  3665 !
  3671 !
  3666 
  3672 
  3667 version_CVS
  3673 version_CVS
  3668     ^ '$Header: /cvs/stx/stx/libtool/Tools__TagList.st,v 1.28 2013-07-10 08:39:01 cg Exp $'
  3674     ^ '$Header: /cvs/stx/stx/libtool/Tools__TagList.st,v 1.29 2013-07-23 23:20:56 cg Exp $'
  3669 !
  3675 !
  3670 
  3676 
  3671 version_SVN
  3677 version_SVN
  3672     ^ '$Id: Tools__TagList.st,v 1.28 2013-07-10 08:39:01 cg Exp $'
  3678     ^ '$Id: Tools__TagList.st,v 1.29 2013-07-23 23:20:56 cg Exp $'
  3673 ! !
  3679 ! !
  3674 
  3680