microsoft / microsoft/language-server-protocol

SnippetTextEdit doesn't have an option for preserving whitespace

Open
#2,290 5 comments 2 reactions 1 assignee View on GitHub

@dbaeumer is already working on this.

Since Jul 15, 2026.

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

Description

VS Code's SnippetTextEdit has a keepWhitespace: boolean, which is not present in LSP.

After migrating some server code to use SnippetTextEdits, we found that VS Code is messing up the whitespace (trying to compensate for the lines indentation, even though the server had already done it correctly, resulting in duplicated indentation).

@dbaeumer should keepWhitespace be an option here, or should the VS Code LSP client just always set it to true?

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.