Skip to content

Clarify whether $0 can be a placeholder (${0:foo}) #1946

@DanTup

Description

@DanTup

Currently the spec says that snippets can use "tab stops and placeholders", where a tabstop looks like $1 and a placeholder looks like ${1:foo}.

It also says that "$0 defines the final tab stop" but it does not make it clear whether $0 can be used with placeholder text (like ${0:foo}).

Using it like this works fine in VS Code (it treats it as a final tabstop and a placeholder, so the text is selected and snippet mode is exited), however nevoim's LSP client is behaving differently and it could be argued that the spec doesn't say that $0 is allowed to be a placeholder.

@dbaeumer assuming VS Code's behaviour is desired, I can send a PR to change:

$0 defines the final tab stop

to

$0 defines the final tab stop or placeholder

Does this seem reasonable?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions