Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ crate.spec(
version = "0.10",
)
crate.spec(
features = ["derive"],
features = [
"derive",
"rc",
],
package = "serde",
version = "1.0",
)
Expand Down
16 changes: 12 additions & 4 deletions plantuml/linker/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,18 @@ fn read_diagram(path: &str) -> Result<DiagramInfo, String> {
.map_err(|e| format!("Failed to parse FlatBuffer {path}: {e}"))?;

let source_file = graph
.source_file()
.filter(|s| !s.is_empty())
.map(|s| s.to_string())
.ok_or_else(|| format!("Missing source_file in FlatBuffer: {path}"))?;
.components()
.and_then(|entries| {
entries
.iter()
.next()
.and_then(|entry| entry.value())
.map(|comp| comp.source_location())
.and_then(|location| location.file())
.filter(|file| !file.is_empty())
.map(ToOwned::to_owned)
})
.unwrap_or_else(|| path.to_string());

let mut components = Vec::new();
if let Some(entries) = graph.components() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
"parent_id": null,
"comp_type": "Package",
"stereotype": null,
"relations": []
"relations": [],
"source_location": {
"file": "",
"line": 15
}
},
"SampleSEooC.ComponentA": {
"id": "SampleSEooC.ComponentA",
Expand All @@ -21,9 +25,17 @@
"target": "SampleSEooC.IService",
"annotation": "provides",
"relation_type": "InterfaceBinding",
"source_role": "Provided"
"source_role": "Provided",
"source_location": {
"file": "",
"line": 23
}
}
]
],
"source_location": {
"file": "",
"line": 16
}
},
"SampleSEooC.ComponentB": {
"id": "SampleSEooC.ComponentB",
Expand All @@ -37,9 +49,17 @@
"target": "SampleSEooC.IService",
"annotation": "requires",
"relation_type": "InterfaceBinding",
"source_role": "Required"
"source_role": "Required",
"source_location": {
"file": "",
"line": 24
}
}
]
],
"source_location": {
"file": "",
"line": 18
}
},
"SampleSEooC.IService": {
"id": "SampleSEooC.IService",
Expand All @@ -48,7 +68,11 @@
"parent_id": "SampleSEooC",
"comp_type": "Interface",
"stereotype": null,
"relations": []
"relations": [],
"source_location": {
"file": "",
"line": 21
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,27 @@
"target": "IRequired",
"annotation": "requires",
"relation_type": "InterfaceBinding",
"source_role": "Required"
"source_role": "Required",
"source_location": {
"file": "",
"line": 23
}
},
{
"target": "IProvided",
"annotation": "provides",
"relation_type": "InterfaceBinding",
"source_role": "Provided"
"source_role": "Provided",
"source_location": {
"file": "",
"line": 24
}
}
]
],
"source_location": {
"file": "",
"line": 15
}
},
"IRequired": {
"id": "IRequired",
Expand All @@ -29,7 +41,11 @@
"parent_id": null,
"comp_type": "Interface",
"stereotype": null,
"relations": []
"relations": [],
"source_location": {
"file": "",
"line": 20
}
},
"IProvided": {
"id": "IProvided",
Expand All @@ -38,7 +54,11 @@
"parent_id": null,
"comp_type": "Interface",
"stereotype": null,
"relations": []
"relations": [],
"source_location": {
"file": "",
"line": 21
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,27 @@
"target": "IRequired",
"annotation": "requires",
"relation_type": "InterfaceBinding",
"source_role": "Required"
"source_role": "Required",
"source_location": {
"file": "",
"line": 23
}
},
{
"target": "IProvided",
"annotation": "provides",
"relation_type": "InterfaceBinding",
"source_role": "Provided"
"source_role": "Provided",
"source_location": {
"file": "",
"line": 24
}
}
]
],
"source_location": {
"file": "",
"line": 15
}
},
"IRequired": {
"id": "IRequired",
Expand All @@ -29,7 +41,11 @@
"parent_id": null,
"comp_type": "Interface",
"stereotype": null,
"relations": []
"relations": [],
"source_location": {
"file": "",
"line": 20
}
},
"IProvided": {
"id": "IProvided",
Expand All @@ -38,7 +54,11 @@
"parent_id": null,
"comp_type": "Interface",
"stereotype": null,
"relations": []
"relations": [],
"source_location": {
"file": "",
"line": 21
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
},
"rhs": "[Signal Adapter]",
"style": null,
"description": null
"description": null,
"source_location": {
"file": "",
"line": 15
}
}
},
{
Expand All @@ -33,7 +37,11 @@
},
"rhs": "CalibrationBus",
"style": null,
"description": "forwards"
"description": "forwards",
"source_location": {
"file": "",
"line": 16
}
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
},
"rhs": "SampleIngress",
"style": null,
"description": null
"description": null,
"source_location": {
"file": "",
"line": 14
}
}
},
{
Expand All @@ -35,7 +39,11 @@
},
"rhs": "CommandEgress",
"style": null,
"description": null
"description": null,
"source_location": {
"file": "",
"line": 15
}
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
},
"rhs": "[Telemetry Hub]",
"style": null,
"description": null
"description": null,
"source_location": {
"file": "",
"line": 14
}
}
},
{
Expand All @@ -35,7 +39,11 @@
},
"rhs": "[Telemetry Hub]",
"style": null,
"description": null
"description": null,
"source_location": {
"file": "",
"line": 15
}
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
},
"rhs": "westQueue",
"style": null,
"description": null
"description": null,
"source_location": {
"file": "",
"line": 14
}
}
},
{
Expand All @@ -43,7 +47,11 @@
},
"rhs": "eastQueue",
"style": null,
"description": null
"description": null,
"source_location": {
"file": "",
"line": 15
}
}
},
{
Expand All @@ -65,7 +73,11 @@
},
"rhs": "northQueue",
"style": null,
"description": null
"description": null,
"source_location": {
"file": "",
"line": 16
}
}
},
{
Expand All @@ -87,7 +99,11 @@
},
"rhs": "southQueue",
"style": null,
"description": null
"description": null,
"source_location": {
"file": "",
"line": 17
}
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
"alias": null,
"stereotype": null,
"style": null,
"statements": []
"statements": [],
"source_location": {
"file": "",
"line": 15
}
}
},
{
Expand All @@ -19,7 +23,11 @@
"alias": "CalibrationSvc",
"stereotype": null,
"style": null,
"statements": []
"statements": [],
"source_location": {
"file": "",
"line": 16
}
}
},
{
Expand All @@ -29,7 +37,11 @@
"alias": null,
"stereotype": null,
"style": null,
"statements": []
"statements": [],
"source_location": {
"file": "",
"line": 17
}
}
},
{
Expand All @@ -39,7 +51,11 @@
"alias": "FallbackRecorder",
"stereotype": null,
"style": null,
"statements": []
"statements": [],
"source_location": {
"file": "",
"line": 18
}
}
}
]
Expand Down
Loading
Loading