@@ -40,7 +40,7 @@ public struct CompletionKind {
40
40
case file( extensions: [ String ] )
41
41
case directory
42
42
case shellCommand( String )
43
- case custom( @Sendable ( [ String ] , Int , Int ) -> [ String ] )
43
+ case custom( @Sendable ( [ String ] , Int , String ) -> [ String ] )
44
44
case customDeprecated( @Sendable ( [ String ] ) -> [ String ] )
45
45
}
46
46
@@ -126,11 +126,11 @@ public struct CompletionKind {
126
126
/// passed to Swift as `"abc\\""def"` (i.e. the Swift String's contents would
127
127
/// include all 4 of the double quotes and the 2 consecutive backslashes).
128
128
///
129
- /// The first of the two `Int` arguments is the 0-based index of the word
130
- /// for which completions are being requested within the given `[String]`.
129
+ /// The second argument (an `Int`) is the 0-based index of the word for which
130
+ /// completions are being requested within the given `[String]`.
131
131
///
132
- /// The second of the two `Int` arguments is the 0-based index of the shell
133
- /// cursor within the word for which completions are being requested.
132
+ /// The third argument (a `String`) is the prefix of the word for which
133
+ /// completions are being requested that precedes the cursor .
134
134
///
135
135
/// ### bash
136
136
///
@@ -171,21 +171,21 @@ public struct CompletionKind {
171
171
/// character, not as after the backslash.
172
172
@preconcurrency
173
173
public static func custom(
174
- _ completion: @Sendable @escaping ( [ String ] , Int , Int ) -> [ String ]
174
+ _ completion: @Sendable @escaping ( [ String ] , Int , String ) -> [ String ]
175
175
) -> CompletionKind {
176
176
CompletionKind ( kind: . custom( completion) )
177
177
}
178
178
179
179
/// Deprecated; only kept for backwards compatibility.
180
180
///
181
- /// The same as `custom(@Sendable @escaping ([String], Int, Int ) -> [String])`,
182
- /// except that index arguments are not supplied.
181
+ /// The same as `custom(@Sendable @escaping ([String], Int, String ) -> [String])`,
182
+ /// except that the last two closure arguments are not supplied.
183
183
@preconcurrency
184
184
@available (
185
185
* ,
186
186
deprecated,
187
187
message:
188
- " Provide a three-parameter closure instead. See custom(@Sendable @escaping ([String], Int, Int ) -> [String]). "
188
+ " Provide a three-parameter closure instead. See custom(@Sendable @escaping ([String], Int, String ) -> [String]). "
189
189
)
190
190
public static func custom(
191
191
_ completion: @Sendable @escaping ( [ String ] ) -> [ String ]
0 commit comments