(self: Instruction)
| 1031 | |
| 1032 | /** @internal */ |
| 1033 | export const getFishCompletions = (self: Instruction): Array<string> => { |
| 1034 | switch (self._tag) { |
| 1035 | case "Empty": { |
| 1036 | return Arr.empty() |
| 1037 | } |
| 1038 | case "Single": { |
| 1039 | const description = getShortDescription(self) |
| 1040 | return pipe( |
| 1041 | InternalPrimitive.getFishCompletions( |
| 1042 | self.primitiveType as InternalPrimitive.Instruction |
| 1043 | ), |
| 1044 | Arr.appendAll( |
| 1045 | description.length === 0 |
| 1046 | ? Arr.empty() |
| 1047 | : Arr.of(`-d '${description}'`) |
| 1048 | ), |
| 1049 | Arr.join(" "), |
| 1050 | Arr.of |
| 1051 | ) |
| 1052 | } |
| 1053 | case "Both": { |
| 1054 | return pipe( |
| 1055 | getFishCompletions(self.left as Instruction), |
| 1056 | Arr.appendAll(getFishCompletions(self.right as Instruction)) |
| 1057 | ) |
| 1058 | } |
| 1059 | case "Map": |
| 1060 | case "Variadic": |
| 1061 | case "WithDefault": |
| 1062 | case "WithFallbackConfig": { |
| 1063 | return getFishCompletions(self.args as Instruction) |
| 1064 | } |
| 1065 | } |
| 1066 | } |
| 1067 | |
| 1068 | interface ZshCompletionState { |
| 1069 | readonly multiple: boolean |
nothing calls this directly
no test coverage detected