Skip to content

Commit 004b8df

Browse files
committed
Add middlewareComments to CodeSuggestion
1 parent 7a5bdd9 commit 004b8df

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Tool/Sources/SuggestionModel/CodeSuggestion.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ public struct CodeSuggestion: Codable, Equatable {
1111
self.position = position
1212
self.id = id
1313
self.range = range
14+
middlewareComments = []
15+
}
16+
17+
public static func == (lhs: CodeSuggestion, rhs: CodeSuggestion) -> Bool {
18+
return lhs.text == rhs.text
19+
&& lhs.position == rhs.position
20+
&& lhs.id == rhs.id
21+
&& lhs.range == rhs.range
1422
}
1523

1624
/// The new code to be inserted and the original code on the first line.
@@ -21,4 +29,7 @@ public struct CodeSuggestion: Codable, Equatable {
2129
public var id: String
2230
/// The range of the original code that should be replaced.
2331
public var range: CursorRange
32+
/// A place to store comments inserted by middleware for debugging use.
33+
public var middlewareComments: [String]
2434
}
35+

0 commit comments

Comments
 (0)