Skip to content

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

Open

Description

@intxff

Please reopen this issue.

The current definition is very vague, with the following 4 scenarios:

  1. $0 as the final endpoint (implemented in Neovim)
  2. ${0:placeholder} as the final endpoint
  3. $0 as the starting point
  4. ${0:placeholder} as the starting point (implemented in Dart LSP).

Although the other two scenarios have not been encountered in my practice, they still comply with the protocol. Using Dart on Neovim is very frustrating for me. Due to the overly broad protocol definition, I am not even sure if this issue should be addressed by Dart or Neovim.

If you close this issue without any reply, I will assume that you acknowledge the 4 scenarios, and I can use this issue as reference to report to Neovim. Otherwise, please provide a clear definition before closing this issue.

Activity

  1. DanTup commented on Jun 12, 2025

    @DanTup
    Contributor

    ${0:placeholder} as the starting point (implemented in Dart LSP).

    This isn't quite right. What Dart does (which is apparently contentious) is include a placeholder string for a 0th (final) tabstop (that is, it may produce ${0:placeholder} whereas some editors apparently only support ${0} without a placeholder.

    VS Code supports this, although their response was that it is not officially supported, but won't be removed for compatibility reasons (I'm not sure how that is different to supporting it though). The reason given was that TextMate does not support this (and the syntax came from textmate) however in my testing, it does.

    I'm currently reluctant to remove this from Dart when a) VS Code supports it, b) TextMate supports it and c) the LSP PR to forbid it was reverted. I do feel it's really important this is clarified so all servers and clients can be on the same page either way though. I don't entirely understand the reluctance of clients to support this, it is very useful to support this as is shown by both Dart and VS Code's own built-in snippets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions