Re: [swift-dev] [SourceKit] NSRange, Swift.String, and NSString

2017-04-06 Thread Tyler Stromberg via swift-dev
> On Mar 24, 2017, at 12:08 PM, Ben Langmuir <blangm...@apple.com> wrote: > > >> On Mar 24, 2017, at 10:59 AM, Tyler Stromberg via swift-dev >> <swift-dev@swift.org> wrote: >> >> I'm currently working on integrating SourceKit with a macOS applicat

[swift-dev] [SourceKit] NSRange, Swift.String, and NSString

2017-03-24 Thread Tyler Stromberg via swift-dev
I'm currently working on integrating SourceKit with a macOS application. AppKit APIs (e.g. NSAttributedString, NSLayoutManager, etc) deal in terms of NSRange (UTF-16 code units?). SourceKit, however, deals in terms of integer offsets and lengths (UTF-8 code units?). Is there a more efficient

[swift-dev] KVO Context Param

2016-10-07 Thread Tyler Stromberg via swift-dev
Hey everyone, One of the things that came up in a code review today was the type of KVO's context param. If you look at the function signature it gets imported as UnsafeMutableRawPointer?. Is there ever a need to mutate this parameter, and if not can we change it to be UnsafeRawPointer?