11 Commits

Author SHA1 Message Date
Jeremy Schonfeld
bcd54e0881
Prepare for _FoundationCollections module name (#650)
* Prepare for _FoundationCollections module name

* Fix build failure
2024-06-03 18:25:52 -07:00
Jeremy Schonfeld
e5211f2926
(122981400) Standardize on using internal import 2024-03-06 13:42:02 -08:00
Karoy Lorentey
06ea8b042f
Start using Rope for attribute run storage (#166)
* rdar://108152217 Start using Rope for attribute run storage

- Replace `Array<_InternalRun>` with `Rope<_InternalRun>`.
- Fix semantics of AttributeRunBoundaries.character. It no longer pretends that attributes can be tied to grapheme clusters — that never actually worked properly, and it cannot be supported without breaking the intended use case.
- Remove cache of latest run position; log(n) might be fast enough that we don’t need to worry about that.
- Switch AttributedString.Guts members to take/return BigString.Index values, not AttributedString indices. This cuts down on constant back-and-forth conversions.
- Discard unused Guts members; update remaining mutation methods to follow Swift naming conventions.
- Stop using the `public extension` language misfeature.

* rdar://108152217 Apply notes from code review

AttributedString.CharacterView and AttributedString.UnicodeScalarView
did not use the right semantics in the case when the underlying text
was not touched. It’s okay in that case to not mutate text storage,
but we still want to override the attributes within the subrange as if
the client actually did replace text — as in, we want to use precisely
the same attribute storage for the range on both paths.

Also, make sure we correctly enforce attribute constraints in the
`!hasStringChanges` case, in both views.

* rdar://108152217 Fix logic error in AttributedString.Runs.subscript

(Discovered during code review.)

* rdar://108152217 Clean up CharacterView/UnicodeScalarView mutations & update failing test

* rdar://108152217 Apply review notes
2023-06-26 13:51:15 -07:00
Jeremy Schonfeld
9c72d351d2
(105902981) Replace @_implementationOnly imports with package imports in FoundationPreview (#109) 2023-05-12 11:36:10 -07:00
Jeremy Schonfeld
61ff810564
rdar://107768277 (AttributeScope.attributeKeyType(matching:) is fairly slow and is a bottleneck for AttributedString conversion) 2023-05-01 09:56:00 -07:00
Jeremy Schonfeld
985f782734
rdar://101354563 (Codable Support for Predicate)
* (101354563) Separate CodableWithConfiguration into standalone file

* (101354563) Update PredicateExpression archive formats

* (101354563) Codable Support for Predicate

* (101354563) Assert on unsupported keypaths
2023-04-26 12:57:40 -07:00
Karoy Lorentey
e9b2f68e8a
rdar://107778676 Stop vendoring the Collections package (#50)
* rdar://107778676 Stop vendoring the Collections package

* rdar://107778676 Fix test expectation

AttributedString.CharacterView needs to round all indices down to the
nearest Character boundary to avoid semantic issues with its
Collection conformance. This means that CharacterView slices can never
start or end in between Character boundaries.

* Remove a stray print statement
2023-04-25 13:44:02 -07:00
Jeremy Schonfeld
74559afbea
rdar://104093459 (Adopt the new Reflection Package to AttributedString) (#48) 2023-04-19 11:21:17 -07:00
Jeremy Schonfeld
99a3c9f4ad
(106775060) Add TODO notes around disabled tests and functionality 2023-03-23 13:26:07 -07:00
Jeremy Schonfeld
8ce51672b6
(106775060) Update AttributedString sources for compatibility with FoundationPreview 2023-03-23 13:26:07 -07:00
Jeremy Schonfeld
b03b3032d2
(106775060) Move AttributedString sources to FoundationPreview 2023-03-23 13:26:00 -07:00