mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The projection these were generated from predated the compute migration, so they described /v1/visor — which the API serves at zero paths now. No /v1/visor path survives here.
36 lines
1.1 KiB
Swift
36 lines
1.1 KiB
Swift
//
|
|
// Position.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Position: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Character is a 0-based UTF-16 code-unit offset within Line, per the LSP specification: not a byte offset and not a rune index. An emoji before the cursor counts as one here and as two in Go's arithmetic. */
|
|
public var character: Int64?
|
|
/** Line is 0-BASED, per the LSP specification — one less than the line an editor shows a human. */
|
|
public var line: Int64?
|
|
|
|
public init(character: Int64? = nil, line: Int64? = nil) {
|
|
self.character = character
|
|
self.line = line
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case character
|
|
case line
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(character, forKey: .character)
|
|
try container.encodeIfPresent(line, forKey: .line)
|
|
}
|
|
}
|
|
|