-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(*): add definition of how we use includeDerivedTypes in JSDoc
Signed-off-by: muhammed-abdulkadir <[email protected]>
- Loading branch information
muhammed-abdulkadir
committed
Nov 1, 2024
1 parent
13442eb
commit 2c40067
Showing
3 changed files
with
8 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,6 +174,8 @@ class ConcertoGraphVisitor extends BaseVisitor { | |
* Visitor design pattern | ||
* @param {ClassDeclaration} classDeclaration - the object being visited | ||
* @param {Object} parameters - the parameter | ||
* @property {boolean} parameters.includeDerivedTypes - If this option is enabled, edges will be created from super types to their derived types. | ||
* This guarantees that if type X exists in the model manager, all types that inherit from X will be represented in the graph. | ||
* @protected | ||
*/ | ||
visitClassDeclaration(classDeclaration, parameters) { | ||
|
@@ -183,7 +185,7 @@ class ConcertoGraphVisitor extends BaseVisitor { | |
parameters.graph.addEdge(classDeclaration.getFullyQualifiedName(), classDeclaration.getSuperType()); | ||
|
||
// Adds a reverse edge to create a cyclic dependency between a class declaration and its supertype. | ||
if(!parameters.createDependencyGraph && classDeclaration.getSuperType() !== '[email protected]') { | ||
if(parameters.includeDerivedTypes && classDeclaration.getSuperType() !== '[email protected]') { | ||
parameters.graph.addVertex(classDeclaration.getSuperType()); | ||
parameters.graph.addEdge(classDeclaration.getSuperType(), classDeclaration.getFullyQualifiedName()); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ describe('graph', function() { | |
const writer = new InMemoryWriter(); | ||
|
||
const graph = new DirectedGraph(); | ||
modelManager.accept(visitor, { graph }); | ||
modelManager.accept(visitor, { graph, includeDerivedTypes: true }); | ||
|
||
writer.openFile('graph.mmd'); | ||
graph.print(writer); | ||
|
@@ -71,7 +71,7 @@ describe('graph', function() { | |
const writer = new InMemoryWriter(); | ||
|
||
const graph = new DirectedGraph(); | ||
modelManager.accept(visitor, { graph }); | ||
modelManager.accept(visitor, { graph, includeDerivedTypes: true }); | ||
|
||
const connectedGraph = graph.findConnectedGraph( | ||
'[email protected]' | ||
|
@@ -106,7 +106,7 @@ describe('graph', function() { | |
const graph = new DirectedGraph(); | ||
modelManager.accept(visitor, { | ||
graph, | ||
createDependencyGraph: true | ||
includeDerivedTypes: false | ||
}); | ||
|
||
expect( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters