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
{{ message }}
Repository navigation
A completion snippet does not link a tab stop to the placeholder with its index: ${1:name} = $1 inserts name = #2073
A completion snippet whose tab stop has the same index as a placeholder inserts the tab stop empty, and doesn't link it to the placeholder.
Snippet
Inserted
After typing x at the first stop
Expected
${1:name} = $1
name =
x =
name = name, then x = x
$1 = ${1:name}
= name (the first stop is the empty $1)
x = name
name = name, then x = x
The LSP specification (3.17 and 3.18, Snippet Syntax) says: "Multiple tab stops are linked and updated in sync." InsertTextFormat.Snippet says: "Placeholders with equal identifiers are linked, that is typing in one will update others too."
SnippetTemplateLoader links template variables by placeholder text, not by index. tabstop(int) adds a new empty variable for every tab stop other than $0. startPlaceholder declares a variable named after its text, which variable reuses only for a later placeholder with the same text. So ${1:name} = ${1:name} is linked, but ${1:name} = $1 isn't, and neither is ${1:a} ${1:b}.
#2070 uses the same loader for the live template of a snippet edit, so it has the same gap in the selected editor. The plain text #2070 inserts in another file already repeats the default at the tab stop.
Activity
fix: link the tab stops and placeholders of a snippet by their index,…