microsoft / microsoft/vscode-cpptools

clang-format add option to ignore unknown keys

Open
#8,683 3 comments 15 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request 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: General

Describe the bug

  • OS and Version: Doesn't matter
  • VS Code Version: Doesn't matter
  • C/C++ Extension Version: v1.7.1
  • Other extensions you installed (and if the issue persists after disabling them): Doesn't matter
  • A clear and concise description of what the bug is.

I added some clang-format 13 specific formatting keys and then I got unknown key ... because the bundled clang-format is only v12

My suggestion would be add a switch for this extension for ignoring unknown keys. To be specific, add an input field to pass custom args to clang-format or add a switch so that the extension automatically passes -Wno-error=unknown to clang-format if checked.

Similar #7867

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 locating where the extension invokes the bundled clang-format and review the related discussion in issue #7867. Determine how a custom argument or the -Wno-error=unknown option could be exposed, then verify that clang-format 13 keys no longer produce an error while existing formatting continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.