You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{
// Place your snippets for Elixir here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, ${id} and ${id:label} and ${1:label} for variables. Variables with the same id are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [
"console.log('$1');",
"$2"
],
"description": "Log output to console"
},
"Print to Somethjing": {
"prefix": "Lassa",
"body": [
"console.log('$1');",
"$2"
],
"description": "Log output to console"
},
"Supervisor Template": {
"prefix": "sup",
"body": [
"defmodule $1.Supervisor do",
"\tuse Supervisor",
"",
"\tdef start_link do",
"\t\tSupervisor.start_link(__MODULE__, [])",
"\tend",
"",
"\tdef init(_) do",
"\t\tchildren = [",
"\t\t\tworker($1.Server, [])",
"\t\t]",
"",
"\t\tsupervise(children, strategy: :one_for_one)",
"\tend",
"",
"end",
"$2"
],
"description": "Creates a skeleton supervisor"
},
"GenServer Template": {
"prefix": "gens",
"body": [
"defmodule $1 do",
"\tuse GenServer",
"",
"\tdef start_link do",
"\t\tGenServer.start_link(__MODULE__, :ok, [name: __MODULE__])",
"\tend",
"",
"end",
"$2"
],
"description": "Creates a minimal skeleton genserver"
}
}
Understood. It is like this because we compare suggestions against their label, codeSnippet, and filterText. The first and last are clear to me but I don't remember why we filter against the codeSnippet...
This also affects "inbuilt" snippets: when working in Typescript, typing "c" shows the completion for the "class" snippet -- however, finishing out to "const" leaves the "class" snippet still selected, so an keypress to move to the next line for a bunch of consts gets me a class snippet.
So this isn't so much a case of "the wrong snippet selected" as "no snippet actually matches the word, but last last matching snippet is still selected".
I stumbled across this report from searching GitHub issues for vscode and snippets -- if this addition should be put somewhere else, please advise.
Activity
jrieken commentedon May 12, 2016
Peter Bruinsma (@23min) Can you share your snippet with us? Trying this with the
classsnippet in JavaScript doesn't allow me to repo23min commentedon May 13, 2016
jrieken commentedon May 17, 2016
Understood. It is like this because we compare suggestions against their
label,codeSnippet, andfilterText. The first and last are clear to me but I don't remember why we filter against thecodeSnippet...don't filter on `codeSnippet` but only on `label` and `filterText`, f…
jrieken commentedon May 23, 2016
Reopening and reverting this due to #6620
5 remaining items
jrieken commentedon Jul 4, 2016
Sorry, need to revert again due to #8531. There is still something wrong with the
jsonlanguage which doesn't allow me to make this changeaeschli commentedon Jul 4, 2016
Thanks Johannes Rieken (@jrieken) !
fluffynuts commentedon Jul 25, 2016
This also affects "inbuilt" snippets: when working in Typescript, typing "c" shows the completion for the "class" snippet -- however, finishing out to "const" leaves the "class" snippet still selected, so an keypress to move to the next line for a bunch of consts gets me a class snippet.
So this isn't so much a case of "the wrong snippet selected" as "no snippet actually matches the word, but last last matching snippet is still selected".
I stumbled across this report from searching GitHub issues for vscode and snippets -- if this addition should be put somewhere else, please advise.
Revert "Revert "don't filter on `codeSnippet` but only on `label` and…
Revert "Revert "Revert "don't filter on `codeSnippet` but only on `la…
Revert "Revert "Revert "Revert "don't filter on `codeSnippet` but onl…