What's the process of bringing in missing APIs (macOS 10.13 and later)

Hi,

HighSierra introduced support for named capture groups with NSTextCheckingResult.range(withName:).
I’m using this in some code and then noticed that it’s not available in swift-corelibs-foundation.

What’s the normal process adding APIs that are missing?:

A related questions is about the availability annotations. The API is available from macOS 10.13. It’s not tied to a specific swift version.
How are APIs like this supposed to be annotated in swift-corelibs-foundation?

Thanks,
Anders

Hi Anders,

Sorry I missed your PR. Thanks for tackling that missing implementation! I’ll kick off a test on that while we review it.

For now we’re not annotating availability with any API on Linux, since it’s available as long as you compile the library and not tied to the OS version.

Hi Tony,

Thanks for taking a look.
No worries about the PR. I was assuming it would take time to get looked at.
Because of that I just wanted to make sure I am following the correct process :slight_smile:

About availability annotations. I see that some API (like in JSONEncoder) do have annotations for which macOS/iOS/…/ version they are available in. I copied that style.

I’ll remove the animations if they shouldn’t be there.

Thanks!

The * at the end means always available on non-Darwin platforms. I guess if it’s building for Mac and uses some other library API that is OS-specific then we would need it. Maybe leave it in for now, and we should think about a consistent policy going forward.