-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataModel.cs
More file actions
37 lines (32 loc) · 1.1 KB
/
DataModel.cs
File metadata and controls
37 lines (32 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// DataModel.cs
using System.Collections.Generic;
namespace RoslynCodeAnalyzer;
// Record to hold the final analysis result
public record AnalysisResult(
List<CodeNode> Nodes,
List<CodeEdge> Edges
);
// Represents an entity in the code (class, interface, method, etc.)
public record CodeNode(
string Id, // Unique identifier (e.g., fully qualified name)
string Type, // e.g., "Class", "Interface", "Method", "Namespace"
string Name, // Simple name
string FilePath,
int StartLine,
int EndLine,
string? Comment = null, // Optional: XML doc comment summary
string? Signature = null, // Optional: Method signature
string? CodeSnippet = null // <<< ADD OR ENSURE THIS LINE EXISTS
);
// Represents a relationship between two nodes
public record CodeEdge(
string SourceId, // ID of the source node
string TargetId, // ID of the target node
string Type // e.g., "CONTAINS", "INHERITS_FROM", "IMPLEMENTS", "CALLS"
);
// Helper to get location info
public record LocationInfo(
string FilePath,
int StartLine,
int EndLine
);