Tools__TagList.st
branchjv
changeset 15720 cbf8e19959fc
parent 15709 7c4957a4261d
parent 15711 a18fbc02f64c
child 15773 81a2184a58d7
equal deleted inserted replaced
15709:7c4957a4261d 15720:cbf8e19959fc
  3011     ((self class isXSDSuffix:suffix)
  3011     ((self class isXSDSuffix:suffix)
  3012     or:[(mime ? '') includesString:'xsd']) ifTrue:[
  3012     or:[(mime ? '') includesString:'xsd']) ifTrue:[
  3013         "/ xsd tags - simulated
  3013         "/ xsd tags - simulated
  3014         ^ self xsdTagsInFile:pathName
  3014         ^ self xsdTagsInFile:pathName
  3015     ].
  3015     ].
       
  3016     (suffix = 'rs') ifTrue:[
       
  3017         ^ self stxResourceTagsInFile:pathName
       
  3018     ].
  3016 
  3019 
  3017     "/ could add more here ...
  3020     "/ could add more here ...
  3018     ^ nil.
  3021     ^ nil.
  3019 
  3022 
  3020     "Created: / 05-01-2012 / 10:55:03 / cg"
  3023     "Created: / 05-01-2012 / 10:55:03 / cg"
  3908     ^ targets
  3911     ^ targets
  3909 
  3912 
  3910     "Created: / 05-01-2012 / 10:56:26 / cg"
  3913     "Created: / 05-01-2012 / 10:56:26 / cg"
  3911 !
  3914 !
  3912 
  3915 
       
  3916 stxResourceTagsInFile:aFilePath
       
  3917     "resource tags:
       
  3918      scan for translated entries to show them alphabetically"
       
  3919 
       
  3920     |rsrcPack|
       
  3921 
       
  3922     rsrcPack := ResourcePack fromFile:aFilePath.
       
  3923     ^ self
       
  3924         linewiseNaiveTagsInFile:aFilePath 
       
  3925         using:[:rawLine :lineNr |
       
  3926             |line key tag|
       
  3927 
       
  3928             line := rawLine withoutSeparators.
       
  3929             (line isEmpty or:[line startsWithAnyOf:'#;']) ifFalse:[
       
  3930                 (line startsWith:$') ifTrue:[
       
  3931                     "read as smalltalk string"
       
  3932                     key := String readFrom:line.
       
  3933                 ] ifFalse:[
       
  3934                     key := line upToSeparator.
       
  3935                 ].
       
  3936                 (rsrcPack includesKey:key) ifTrue:[
       
  3937                     tag := Tag::TLabel 
       
  3938                         label:key 
       
  3939                         pattern:nil
       
  3940                         type:nil
       
  3941                         lineNumber:lineNr.
       
  3942                 ]
       
  3943             ].
       
  3944             tag
       
  3945         ].
       
  3946 !
       
  3947 
  3913 tclTagFromLine:line lineNr:lineNr
  3948 tclTagFromLine:line lineNr:lineNr
  3914     "tcl tags:
  3949     "tcl tags:
  3915      naive, q&d scan for lines matching:
  3950      naive, q&d scan for lines matching:
  3916         proc any
  3951         proc any
  3917     "
  3952     "
  3964                 self tclTagFromLine:line lineNr:lineNr
  3999                 self tclTagFromLine:line lineNr:lineNr
  3965               ]
  4000               ]
  3966 !
  4001 !
  3967 
  4002 
  3968 xsdTagFromLine:line lineNr:lineNr
  4003 xsdTagFromLine:line lineNr:lineNr
  3969     "tcl tags:
  4004     "xsd schema tags:
  3970      naive, q&d scan for lines matching:
  4005      naive, q&d scan for lines matching:
  3971         <xsd:complexType...
  4006         <xsd:complexType...
  3972         <xsd:simpleType ...
  4007         <xsd:simpleType ...
  3973      Should be replaced by a more sophisticated reader, which parses the xml first.    
  4008      Should be replaced by a more sophisticated reader, which parses the xml first.    
  3974     "
  4009     "