(match)
| 164 | } |
| 165 | |
| 166 | function completeFSFunctions(match) { |
| 167 | let baseName = ''; |
| 168 | let filePath = match[1]; |
| 169 | let fileList = gracefulReaddir(filePath, { withFileTypes: true }); |
| 170 | |
| 171 | if (!fileList) { |
| 172 | baseName = path.basename(filePath); |
| 173 | filePath = path.dirname(filePath); |
| 174 | fileList = gracefulReaddir(filePath, { withFileTypes: true }) || []; |
| 175 | } |
| 176 | |
| 177 | const completions = ArrayPrototypeMap( |
| 178 | ArrayPrototypeFilter( |
| 179 | fileList, |
| 180 | (dirent) => StringPrototypeStartsWith(dirent.name, baseName), |
| 181 | ), |
| 182 | (d) => d.name, |
| 183 | ); |
| 184 | |
| 185 | return [[completions], baseName]; |
| 186 | } |
| 187 | |
| 188 | // Provide a list of completions for the given leading text. This is |
| 189 | // given to the readline interface for handling tab completion. |
no test coverage detected
searching dependent graphs…