TypeFill
A cli tool to fill your swift source code's types.
Install / Use
/learn @yume190/TypeFillREADME
TypeFill

A little cli tool to help you fill your variables type.
~~And add private final attribute to @IBAction, @IBOutlet, and @objc.(Rewriting ...)~~
Installation
make
brew install make
make install
Swift Package Manager
swift build -c release
cp .build/release/typefill /usr/local/bin
mint
brew install mint
mint install yume190/TypeFill
Usage
typefill single --sdk macosx --file PATH/TO/sample.swift
typefill spm --module TypeFillKit --file .
typefill project --module YOUR_SCHEME --file PATH/TO/YOUR.xcodeproj
typefill workspace --module YOUR_SCHEME --file PATH/TO/YOUR.xcworkspace
The Support Part & Todolist
- [x] typefill variables like
let a = 1orvar a = "1". - [x] typefill keyword like
let ``default`` = 1. - [x] typefill
guard letandif let. - [x] typefill some closure input.
{ a, b in }{ (a, b) in }
- [x] typefill binding tuple
let (aa, bb) = (1, 2) - [ ] typefill
inout - [ ] typefill closure output.
- [ ] ~~add
private finalattribute to@IBAction/@IBOutlet/@objcby using--ibaction/--iboutlet/--objc.(Rewriting)~~
private lazy var chartHeight: [CGFloat] = {
return self.status.sensorData?.compactMap { sensor -> CGFloat in
guard let _chartType = sensor.chart?.type else { return 0 }
}
}()
Support
let/var
let a = 1
var b = a
let (c, d) = (1, 2)
struct Test {
let a, b: Int
let c = 1, d = 2
}
let a: Int = 1
var b: Int = a
let (c, d): (Int, Int) = (1, 2)
struct Test {
let a: Int, b: Int
let c: Int = 1, d: Int = 2
}
Option bind(if let/guard let)
let a: Int? = nil
if let aa = a {}
guard let aa = a else {return}
let a: Int? = nil
if let aa: Int = a {}
guard let aa: Int = a else {return}
Closure
let a: (Int, Int) -> String = { a, b -> String in
return ""
}
let b: (Int, Int) -> String = { (a, b) -> String in
return ""
}
let a: (Int, Int) -> String = { (a: Int, b: Int) -> String in
return ""
}
let b: (Int, Int) -> String = { (a: Int, b: Int) -> String in
return ""
}
Not Support
Closure(inout)
let a: (inout Int) -> Int = { i in
return i
}
Ref
License
MIT licensed.
Related Skills
node-connect
352.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
