Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code - How to put User Snippets at the top of the list

I have created a JavaScript 'user snippet' in the Visual Studio Code to make it slightly faster to call the console.log() method (a line of code that I write very frequently).

"Console Log": {
    "prefix": "log",
    "body": [
        "console.log($0);"
    ],
    "description": "JavaScript Console.log()"
}

The user snippet works, but when I type log into the editor, my custom snippet is at the bottom of the list.

'log' is at the bottom of the list

Is there any way I can make this the first suggestion, rather than the last?

like image 764
AdamMcquiff Avatar asked May 08 '17 15:05

AdamMcquiff


People also ask

Where do I put code snippet?

With a code file open in the editor, choose Snippets > Insert Snippet from the right-click menu, then My Code Snippets. You should see a snippet named Square Root. Double-click it. The snippet code is inserted in the code file.

Where are user snippets stored VS Code?

Depending on your plaform, your user snippets file is located here: Windows %APPDATA%\Code\User\snippets\(language).

How do I keep VS Code on top?

Once you've opened Visual Studio Code, just press alt + space and the system menu will appear, then you just have to select the Always on top option.

How do I move a lineup code in Visual Studio?

Move Code Alt+Up/Down If you put the cursor on a line of code and use the Alt+Up Arrow keys, the line of code you've selected moves up. If you use the Alt+Down Arrow keys, the line of code selected moves down.


1 Answers

Try setting:

"editor.snippetSuggestions": "top"

enter image description here

like image 116
Matt Bierner Avatar answered Nov 03 '22 01:11

Matt Bierner