microsoft / microsoft/vscode-cpptools

Extra indent after acces specifier

Open
#8,614 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Bug/feature request type: Language Service

Describe the bug

  • OS and Version: Windows 10
  • VS Code Version: 1.63.2
  • C/C++ Extension Version: 1.7.1

Not sure if its a bug or more a question/feature request. But I noticed the option cpp_indent_access_specifiers for indenting the acces specifiers, but is there an option to indent content under a access specifier a second time (python-style-like)?

Example:


class Test {
    private:
        int myPrivateVar = 0;
    public:
        int getPrivate()
        {
            return myPrivateVar;
        }
}

Maybe I missed an option, otherwise this would be a feature-request for the Language Service.
Thanks in advance!

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.

Research direction

Start by reviewing the C/C++ Language Service formatting behavior around the existing cpp_indent_access_specifiers option. Confirm whether a second indentation level for declarations and method bodies under private: or public: is already supported; done means the requested style is consistently produced, with appropriate coverage added wherever the formatter is tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.