Skip to content

Commit

Permalink
Remove duplicates from kernel completions (#16176)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne authored Oct 29, 2024
1 parent 5665acf commit 68b3672
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/standalone/intellisense/kernelCompletionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ class NotebookCellSpecificKernelCompletionProvider implements CompletionItemProv
}

const existingCompletionItems = new Set(
(otherCompletions || []).map((item) => (typeof item.label === 'string' ? item.label : item.label.label))
(otherCompletions || [])
.map((item) => (typeof item.label === 'string' ? item.label : item.label.label))
// Jupyter kernel might return items prefixed with the `.` character.
.map((item) => [item, `.${item}`])
.flat()
);
return completions.filter(
(item) => !existingCompletionItems.has(typeof item.label === 'string' ? item.label : item.label.label)
Expand Down

0 comments on commit 68b3672

Please sign in to comment.