Skip to content

Initial support for tracking locations for assigned values in XCConfigs #513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

neonichu
Copy link
Collaborator

This can be used to emit fix-its for XCConfigs files during the build process.

@neonichu
Copy link
Collaborator Author

@swift-ci please test

@neonichu
Copy link
Collaborator Author

Note that this currently only tracks one location per macro, I wanted to separate the mechanics a bit from the interesting parts, so there will be at least one more PR before this really becomes useful in practice.

This can be used to emit fix-its for XCConfigs files during the build process.
@neonichu neonichu force-pushed the bbuegling/retain-xcconfig-value-locations branch from fd1477f to a619ee1 Compare May 19, 2025 16:46
@neonichu
Copy link
Collaborator Author

@swift-ci please test

@@ -396,6 +423,37 @@ public final class MacroValueAssignment: Serializable, CustomStringConvertible,
}
}

public struct MacroValueAssignmentLocation: Serializable, Sendable {
public let path: Path
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we're going to end up wanting to intern these strings somewhere to cut down on memory usage in projects with large settings tables

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yah, that's a good point. I think settings already track paths of XCConfigs for invalidation purposes, maybe we can re-use that instead of duplicating the paths per macro like I am doing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants