We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 933535a commit d6372aeCopy full SHA for d6372ae
src/index.ts
@@ -337,21 +337,24 @@ export class Completion {
337
previousArgs: string[],
338
toComplete: string
339
) {
340
- const commandParts = [...previousArgs];
+ const commandParts = [...previousArgs].filter(Boolean);
341
342
for (const [k, command] of this.commands) {
343
if (k === '') continue;
344
+
345
const parts = k.split(' ');
- let match = true;
346
347
+ let match = true;
348
let i = 0;
349
350
while (i < commandParts.length) {
351
if (parts[i] !== commandParts[i]) {
352
match = false;
353
break;
354
}
355
i++;
356
357
358
if (match && parts[i]?.startsWith(toComplete)) {
359
this.completions.push({
360
value: parts[i],
0 commit comments