From 23ca662f37f356853d784f70fc680ea0fb1a4124 Mon Sep 17 00:00:00 2001 From: 0xLeif Date: Mon, 5 Jan 2026 16:28:54 -0700 Subject: [PATCH] Update documentation style to use block comments for 3+ lines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- Sources/TerminalCore/Logger.swift | 8 +++++--- Sources/TerminalCore/Terminal.swift | 8 +++++--- Sources/TerminalGraphics/ITerm2Image.swift | 8 +++++--- Sources/TerminalGraphics/KittyImage.swift | 8 +++++--- Sources/TerminalInput/Terminal+Input.swift | 8 +++++--- 5 files changed, 25 insertions(+), 15 deletions(-) diff --git a/Sources/TerminalCore/Logger.swift b/Sources/TerminalCore/Logger.swift index 5f38abe..ee51729 100644 --- a/Sources/TerminalCore/Logger.swift +++ b/Sources/TerminalCore/Logger.swift @@ -1,8 +1,10 @@ import Foundation -/// Simple file logger for debugging crashes. -/// Logs are written synchronously to ensure they persist before crashes. -/// No initialization required - just call `debugLog("message")` anywhere. +/** + Simple file logger for debugging crashes. + Logs are written synchronously to ensure they persist before crashes. + No initialization required - just call `debugLog("message")` anywhere. + */ public func debugLog(_ message: String, file: String = #file, line: Int = #line, function: String = #function) { let logDir = FileManager.default.homeDirectoryForCurrentUser .appendingPathComponent(".swift-cli/logs") diff --git a/Sources/TerminalCore/Terminal.swift b/Sources/TerminalCore/Terminal.swift index 7d016b6..74986f4 100644 --- a/Sources/TerminalCore/Terminal.swift +++ b/Sources/TerminalCore/Terminal.swift @@ -320,9 +320,11 @@ public actor Terminal { // MARK: - Input - /// Wait for input to be available using poll(2). - /// Returns true if input is available, false on timeout. - /// This is much faster than polling with sleep loops. + /** + Wait for input to be available using poll(2). + Returns true if input is available, false on timeout. + This is much faster than polling with sleep loops. + */ public func waitForInput(timeoutMs: Int) -> Bool { var pfd = pollfd(fd: inputFD, events: Int16(POLLIN), revents: 0) let result = poll(&pfd, 1, Int32(timeoutMs)) diff --git a/Sources/TerminalGraphics/ITerm2Image.swift b/Sources/TerminalGraphics/ITerm2Image.swift index 94e6dba..9a69891 100644 --- a/Sources/TerminalGraphics/ITerm2Image.swift +++ b/Sources/TerminalGraphics/ITerm2Image.swift @@ -2,9 +2,11 @@ import Foundation import ANSI import TerminalCore -/// iTerm2 inline image protocol. -/// -/// Reference: https://iterm2.com/documentation-images.html +/** + iTerm2 inline image protocol. + + Reference: https://iterm2.com/documentation-images.html + */ public struct ITerm2Image: TerminalImageProtocol, Sendable { /// Raw image data (PNG, JPEG, GIF, etc.). public let data: Data diff --git a/Sources/TerminalGraphics/KittyImage.swift b/Sources/TerminalGraphics/KittyImage.swift index cb60f99..606523f 100644 --- a/Sources/TerminalGraphics/KittyImage.swift +++ b/Sources/TerminalGraphics/KittyImage.swift @@ -2,9 +2,11 @@ import Foundation import ANSI import TerminalCore -/// Kitty graphics protocol implementation. -/// -/// Reference: https://sw.kovidgoyal.net/kitty/graphics-protocol/ +/** + Kitty graphics protocol implementation. + + Reference: https://sw.kovidgoyal.net/kitty/graphics-protocol/ + */ public struct KittyImage: TerminalImageProtocol, Sendable { /// Raw image data (PNG recommended). public let data: Data diff --git a/Sources/TerminalInput/Terminal+Input.swift b/Sources/TerminalInput/Terminal+Input.swift index 180068d..5aea3e1 100644 --- a/Sources/TerminalInput/Terminal+Input.swift +++ b/Sources/TerminalInput/Terminal+Input.swift @@ -5,9 +5,11 @@ import TerminalStyle /// Terminal extensions for input handling. extension Terminal { - /// Read a single key with timeout (requires raw mode). - /// Returns nil if no input is received within the timeout period. - /// Uses poll(2) for sub-millisecond latency on local terminals. + /** + Read a single key with timeout (requires raw mode). + Returns nil if no input is received within the timeout period. + Uses poll(2) for sub-millisecond latency on local terminals. + */ public func readKeyWithTimeout(milliseconds: Int) async throws -> KeyCode? { // Use poll(2) to wait for input - returns immediately when data arrives guard waitForInput(timeoutMs: milliseconds) else {