microsoft / microsoft/vscode-cpptools

Add support for specifying separate C and C++ compiler paths and args

Open
#9,266 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

configuration revision Feature Request Feature: Configuration Language Service
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Feature Request

Currently, we have compilerPath and compilerArgs fields in c_cpp_properties.json. Arguments (i.e. -std=c++20 vs -std=c17), and perhaps even the compiler itself (i.e. XC16), can be C or C++ specific. These field may be insufficient for users who want to mix C and C++ sources. The same issue exists for fields in custom configuration provider interfaces.

This feature request tracks separating compilerPath and compilerArgs into C and C++, so separate values for each can be provided. One backwards compatible approach would be to allow the existing fields to be overloaded with an object containing a separate value per language. For example:

"compilerPath": {
    "c": "/usr/bin/gcc",
    "cpp": "/usr/bin/g++"
},
"compilerArgs": {
    "c": [ "-std=c17" ],
    "cpp": [ "-std=c++20" ]
}

Related: https://github.com/microsoft/vscode-cpptools/issues/7534

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 with the c_cpp_properties.json fields and the custom configuration provider interfaces described in the issue. Determine how separate C and C++ compiler paths and arguments can be represented while preserving existing fields; done means C and C++ sources can receive distinct values with backward compatibility.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp, typescript
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.