Skip to content

Incorrect indentation for if statements without curly braces #13968

@osalbahr

Description

@osalbahr

Environment

  • OS and Version: Fedora Linux 43 (Workstation Edition Prerelease) x86_64
  • VS Code Version: 1.105.0-insider
  • C/C++ Extension Version: 1.28.0
  • If using SSH remote, specify OS of remote machine: N/A

Bug Summary and Steps to Reproduce

Bug Summary:

In C/C++, creating an if/for/while without curly braces results in no further indentation.

Steps to reproduce:

  1. Open a directory and trust it
  2. Open a hello.c file
  3. Create an if statement
  4. Press enter

Expected behavior:

Further indentation.

Configuration and Logs

N/A

Other Extensions

Only the C/C++ extension pack on a newly installed code-insiders.

Additional context

#include <stdio.h>

int main()
{
    if (1)
    puts("Test");
}

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions