microsoft / microsoft/vscode-cpptools

vcFormat: on-type formatting on Enter should not indent the next existing line

Open
#7,815 3 comments 0 reactions 1 assignee View on GitHub

@Colengms is already working on this.

Since Jul 14, 2021.

bug Feature: Code Formatting Language Service
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Bug type: Language Service

Describe the bug
Version: 1.57.1 (user setup)
Commit: 507ce72a4466fbb27b715c3722558bb15afa9f48
Date: 2021-06-17T13:28:07.755Z
Electron: 12.0.7
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Windows_NT x64 10.0.19042
C/C++ Extension Version: 1.5.1

Steps to reproduce

  1. Open a.cpp using the settings.json
  2. Set cursor after if (a < 10)
  3. Press Enter
  4. See that before return was inserted 4 spaces.
  5. Try this in VS and see that VS does not insert spaces in that case.

a.cpp

void f(int a) {
    if (a < 10)
    return;
}

settings.json

{
    "editor.formatOnType": true,
    "C_Cpp.formatting": "vcFormat",
}

Contributor guide

Open the contributing guide

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.