You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Track value locations in XCConfigs per assignment (#552)
In #513, initial support for this was added, this PR moves the location to be per assignment which allows emitting fix its not just for the last seen assignments. This will also allow looking at any conditions of assignments when choosing the location for emitting fix its.
/// A mapping from macro declarations to corresponding macro value assignments, each of which is a linked list of macro expressions in precedence order. At the moment it doesn’t support conditional assignments, but that functionality will be implemented soon.
/// Adds a mapping from each of the macro-to-value mappings in `otherTable`, inserting them ahead of any already existing assignments in the receiving table. The other table isn’t affected in any way (in particular, no reference is kept from the receiver to the other table).
// We don't directly serialize MacroDeclarations, but rather serialize their contents "by hand" so when we deserialize we can re-use existing declarations in our namespace.
257
230
serializer.beginAggregate(valueAssignments.count)
@@ -279,17 +252,6 @@ public struct MacroValueAssignmentTable: Serializable, Sendable {
@@ -298,10 +260,9 @@ public struct MacroValueAssignmentTable: Serializable, Sendable {
298
260
guardlet delegate = deserializer.delegate as?(anyMacroValueAssignmentTableDeserializerDelegate)else{throwDeserializerError.invalidDelegate("delegate must be a MacroValueAssignmentTableDeserializerDelegate")}
299
261
self.namespace = delegate.namespace
300
262
self.valueAssignments =[:]
301
-
self.valueLocations =[:]
302
263
303
264
// Deserialize the table.
304
-
try deserializer.beginAggregate(3)
265
+
try deserializer.beginAggregate(1)
305
266
306
267
// Iterate over all the key-value pairs.
307
268
letcount:Int=try deserializer.beginAggregate()
@@ -348,16 +309,6 @@ public struct MacroValueAssignmentTable: Serializable, Sendable {
/// Returns the first macro value assignment that is reachable from the receiver and whose conditions match the given set of parameter values, or nil if there is no such assignment value. The returned assignment may be the receiver itself, or it may be any assignment that’s downstream in the linked list of macro value assignments, or it may be nil if there is none. Unconditional macro value assignments are considered to match any conditions. Conditions that reference parameters that don’t have a value in `paramValues` are only considered to match if the match pattern is `*`, i.e. the “match-anything” pattern (which is effectively a no-op).
@@ -435,18 +413,20 @@ public final class MacroValueAssignment: Serializable, CustomStringConvertible,
0 commit comments