Search code examples
visual-studio-codecode-snippets

little information about snippets


When trying to insert a snippet, be it custom or provided by vscode, I don't have enough info to choose from the suggestions.

For example, I have custom snippet for "template" :

    "template js": {
        "prefix": "template",
        "body": ["<template>", "    $0", "</template>"],
        "description": "template js description"
    }

If I enter "templ" (for "template"), I will see 3 suggestions : my custum snippet, and 2 by vscode.

But next to each suggestions I see this :

Snippet 1 :

Provider: snippetCompletions

score: 48, compared 'template vue' with 'templ'
distance: 0, see localityBonus-setting
index: 17, based on sortText: "a-template vue"

Snippet 2 :

Provider: snippetCompletions

score: 40, compared 'template, template' with 'templ'
distance: 0, see localityBonus-setting
index: 18, based on sortText: "z-template"

Snippet 3 :

Provider: snippetCompletions

score: 48, compared 'template, template' with 'templ'
distance: 0, see localityBonus-setting
index: 19, based on sortText: "z-template"

How can I know which one to choose ? It would help if I could see the snippet's body or description next to the suggestion.


Solution

  • The provider: ... score: ... information indicates that you are in VS Code's IntelliSense explain mode. This mode is only useful while developing an extension that provides suggestions and should not be used normally as it hides important information, including the snippet content.

    To exit explain mode, just open some suggestions and trigger the toggleExplainMode command (cmd/ is the default keybinding on MacOS)

    Also make sure you expand the completion details (click the little (i) to the right side):