Skip to content

Commit 97e5e41

Browse files
committed
Added implements parsing in for class syntax
1 parent 3f57a62 commit 97e5e41

File tree

1 file changed

+13
-0
lines changed
  • rocket-chatter-ingestion-server/src/process/prepare/processor/syntax

1 file changed

+13
-0
lines changed

rocket-chatter-ingestion-server/src/process/prepare/processor/syntax/classes.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ export namespace Classes {
2929
}
3030
}
3131

32+
// Check for implemented interfaces
33+
if (n.implements) {
34+
for (const i of n.implements) {
35+
node.pushUse({
36+
name: (i as any).expression.name,
37+
type: "interface",
38+
})
39+
}
40+
}
41+
3242
// Check for external references in any of the methods
3343
for (const m of n.body.body) {
3444
if (namedTypes.MethodDefinition.check(m)) {
@@ -38,6 +48,9 @@ export namespace Classes {
3848
}
3949
}
4050

51+
// Remove uses that uses the type parameters
52+
node.uses = node.uses.filter((u) => !typeParameters.includes(u.name))
53+
4154
return node
4255
}
4356

0 commit comments

Comments
 (0)