This repository was archived by the owner on Apr 1, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed
semantic-tsx/src/Language/TSX
semantic-typescript/src/Language/TypeScript Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,19 @@ instance ToTags Tsx.Class where
100
100
} = yieldTag text Class loc byteRange >> gtags t
101
101
tags t = gtags t
102
102
103
+ instance ToTags Tsx. Module where
104
+ tags t@ Tsx. Module
105
+ { ann = loc@ Loc { byteRange }
106
+ , name
107
+ } = match name
108
+ where
109
+ match expr = case expr of
110
+ Prj Tsx. Identifier { text } -> yield text
111
+ -- TODO: Handle NestedIdentifiers and Strings
112
+ -- Prj Tsx.NestedIdentifier { extraChildren } -> match
113
+ _ -> gtags t
114
+ yield text = yieldTag text Module loc byteRange >> gtags t
115
+
103
116
instance (ToTags l , ToTags r ) => ToTags (l :+: r ) where
104
117
tags (L1 l) = tags l
105
118
tags (R1 r) = tags r
@@ -222,7 +235,7 @@ instance ToTags Tsx.MemberExpression
222
235
instance ToTags Tsx. MetaProperty
223
236
-- instance ToTags Tsx.MethodDefinition
224
237
instance ToTags Tsx. MethodSignature
225
- instance ToTags Tsx. Module
238
+ -- instance ToTags Tsx.Module
226
239
instance ToTags Tsx. NamedImports
227
240
instance ToTags Tsx. NamespaceImport
228
241
instance ToTags Tsx. NestedIdentifier
Original file line number Diff line number Diff line change @@ -93,6 +93,19 @@ instance ToTags Ts.CallExpression where
93
93
_ -> gtags t
94
94
yield name = yieldTag name Call loc byteRange >> gtags t
95
95
96
+ instance ToTags Ts. Module where
97
+ tags t@ Ts. Module
98
+ { ann = loc@ Loc { byteRange }
99
+ , name
100
+ } = match name
101
+ where
102
+ match expr = case expr of
103
+ Prj Ts. Identifier { text } -> yield text
104
+ -- TODO: Handle NestedIdentifiers and Strings
105
+ -- Prj Tsx.NestedIdentifier { extraChildren } -> match
106
+ _ -> gtags t
107
+ yield text = yieldTag text Module loc byteRange >> gtags t
108
+
96
109
instance (ToTags l , ToTags r ) => ToTags (l :+: r ) where
97
110
tags (L1 l) = tags l
98
111
tags (R1 r) = tags r
@@ -215,7 +228,7 @@ instance ToTags Ts.MemberExpression
215
228
instance ToTags Ts. MetaProperty
216
229
-- instance ToTags Ts.MethodDefinition
217
230
instance ToTags Ts. MethodSignature
218
- instance ToTags Ts. Module
231
+ -- instance ToTags Ts.Module
219
232
instance ToTags Ts. NamedImports
220
233
instance ToTags Ts. NamespaceImport
221
234
instance ToTags Ts. NestedIdentifier
You can’t perform that action at this time.
0 commit comments