Skip to content

Commit cab7abf

Browse files
committed
Inheritance support - Implements section for classes.
1 parent 4231198 commit cab7abf

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed

docs/Misc-Group/ChildClass.md

+23
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
>
99
ChildClass
1010

11+
12+
**Implemented types**
13+
14+
[SampleInterface](/Sample-Interfaces/SampleInterface.md)
15+
1116
## Fields
1217

1318
### `protectedGrandParentField``String`
@@ -48,6 +53,24 @@ String
4853

4954
A String.
5055

56+
### `execute()`
57+
58+
Executes the command.
59+
60+
### `getValue()`
61+
62+
Returns a value based on the executed command.
63+
64+
#### Return
65+
66+
**Type**
67+
68+
String
69+
70+
**Description**
71+
72+
The value
73+
5174
### `overridableMethod()`
5275

5376
*Inherited*

examples/force-app/main/default/classes/ChildClass.cls

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
public class ChildClass extends ParentClass {
1+
public class ChildClass extends ParentClass implements SampleInterface {
22
public void doSomething() {
33
System.debug('Do something');
44
}
@@ -10,4 +10,15 @@ public class ChildClass extends ParentClass {
1010
public override String overridableMethodOverridden() {
1111
return '';
1212
}
13+
14+
/**
15+
* @description Executes the command.
16+
*/
17+
public void execute();
18+
19+
/**
20+
* @description Returns a value based on the executed command.
21+
* @return The value
22+
*/
23+
public String getValue();
1324
}

src/model/markdown-generation-util/type-declaration-util.ts

+14
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,20 @@ export function declareType(markdownFile: MarkdownFile, typeMirror: Type): void
2727
markdownFile.addText(typeMirror.name);
2828
markdownFile.addBlankLine();
2929
}
30+
31+
if (typeAsClass.implemented_interfaces.length) {
32+
markdownFile.addBlankLine();
33+
markdownFile.addText('**Implemented types**');
34+
markdownFile.addBlankLine();
35+
for (let i = 0; i < typeAsClass.implemented_interfaces.length; i++) {
36+
const currentName = typeAsClass.implemented_interfaces[i];
37+
markdownFile.addLink(currentName);
38+
if (i < typeAsClass.implemented_interfaces.length - 1) {
39+
markdownFile.addText(', ');
40+
}
41+
}
42+
markdownFile.addBlankLine();
43+
}
3044
}
3145

3246
addCustomDocCommentAnnotations(markdownFile, typeMirror);

0 commit comments

Comments
 (0)