microsoft / microsoft/language-server-protocol

Invalid snippet example in nested placeholder snippet

Open
#2,194 6 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

clarification
Dominant language
TypeScript
Stars
13k
Forks
1k
Avg merge
6d 1h
Merged PRs (30d)
10

Description

Related discussions

${1:another ${2:placeholder}} (a snippet example provided here) isn't a valid snippet according to the LSP grammar.

A placeholder node is defined as placeholder ::= '${' int ':' any '}' where any ::= tabstop | placeholder | choice | variable | text. In the provided snippet the any (after the colon) would match another (as a text node) and then parsing crashes (as expected) because the placeholder value incorrectly consists of multiple nodes.

In order to ensure consistency across editors (as a primary goal of LSP) we need to clarify the feature descriptions and/or grammar to reflect the expected capabilities.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the LSP 3.17 snippet syntax specification and the related discussion, then compare the nested placeholder example with the stated grammar. The work is done when the specification clearly defines the expected behavior and grammar consistently across editors.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.