//
//  XCSourceTextPosition.h
//  Xcode
//
//  Copyright © 2016-2022 Apple Inc. All rights reserved.
//

#import <XcodeKit/XcodeKitDefines.h>


NS_ASSUME_NONNULL_BEGIN

/// A zero-based position in a source editor, defined by a line number and column number.
typedef struct {
    /// The vertical component of a source text position.
    NSInteger line;
    /// The horizontal component of a source text position.
    NSInteger column;
} XCSourceTextPosition;


/// Creates a new text position for a specified line and column.
NS_INLINE XCSourceTextPosition XCSourceTextPositionMake(const NSInteger line, const NSInteger column) NS_SWIFT_UNAVAILABLE("Use the XCSourceTextPosition constructor instead.")
{
    XCSourceTextPosition position = { .line = line, .column = column };
    return position;
}


NS_ASSUME_NONNULL_END
