class: Tools::TagList
authorClaus Gittinger <cg@exept.de>
Fri, 26 Jun 2015 14:13:49 +0200
changeset 15711 a18fbc02f64c
parent 15710 1b5bfae42860
child 15712 7d282ef23f85
class: Tools::TagList added: #stxResourceTagsInFile: comment/format in: #xsdTagFromLine:lineNr: changed: #getSimpleTagListFromFile:in:
Tools__TagList.st
--- a/Tools__TagList.st	Fri Jun 26 13:12:24 2015 +0200
+++ b/Tools__TagList.st	Fri Jun 26 14:13:49 2015 +0200
@@ -3013,6 +3013,9 @@
         "/ xsd tags - simulated
         ^ self xsdTagsInFile:pathName
     ].
+    (suffix = 'rs') ifTrue:[
+        ^ self stxResourceTagsInFile:pathName
+    ].
 
     "/ could add more here ...
     ^ nil.
@@ -3910,6 +3913,38 @@
     "Created: / 05-01-2012 / 10:56:26 / cg"
 !
 
+stxResourceTagsInFile:aFilePath
+    "resource tags:
+     scan for translated entries to show them alphabetically"
+
+    |rsrcPack|
+
+    rsrcPack := ResourcePack fromFile:aFilePath.
+    ^ self
+        linewiseNaiveTagsInFile:aFilePath 
+        using:[:rawLine :lineNr |
+            |line key tag|
+
+            line := rawLine withoutSeparators.
+            (line isEmpty or:[line startsWithAnyOf:'#;']) ifFalse:[
+                (line startsWith:$') ifTrue:[
+                    "read as smalltalk string"
+                    key := String readFrom:line.
+                ] ifFalse:[
+                    key := line upToSeparator.
+                ].
+                (rsrcPack includesKey:key) ifTrue:[
+                    tag := Tag::TLabel 
+                        label:key 
+                        pattern:nil
+                        type:nil
+                        lineNumber:lineNr.
+                ]
+            ].
+            tag
+        ].
+!
+
 tclTagFromLine:line lineNr:lineNr
     "tcl tags:
      naive, q&d scan for lines matching:
@@ -3966,7 +4001,7 @@
 !
 
 xsdTagFromLine:line lineNr:lineNr
-    "tcl tags:
+    "xsd schema tags:
      naive, q&d scan for lines matching:
         <xsd:complexType...
         <xsd:simpleType ...