visual-studio-codevscode-extensions

How to use file icons inside suggest CompletionItem?


I want to use icons from active file icon them inside the suggest widget, like it shows when writing import:

enter image description here


Solution

  • Just create a CompletionItem with CompletionItemKind.File and vscode will try to set an icon based on the text of your label (filename):

    new CompletionItem("index.ts", CompletionItemKind.File)