Each configuration in `c_cpp_properties.json` supports independent environment variables.

Offen
#14,866 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
45/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
typescript

Rechercherichtung

The issue describes c_cpp_properties.json configurations and proposes an environmentSetupScript setting, but names no implementation files or tests. Start by finding where configuration properties are defined and loaded, then trace how the selected configuration is applied. Done means each configuration can use its own environment setup script when selected; the issue does not specify test locations or exact behavior.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Feature Request Language Service
Feature Request

Some toolchains require environment variables to be set beforehand in order to compile successfully, such as QNX.

For example, changing the c_cpp_properties.json from

{
    "configurations": [
        {
            "name": "qnx710",
            "compileCommands": "qnx710_build/compile_commands.json",
            "browse": {
                "path": []
            }
        },
        {
            "name": "qnx800",
            "compileCommands": "qnx800_build/compile_commands.json",
            "browse": {
                "path": []
            }
        }
    ],
    "version": 4
}

to

{
    "configurations": [
        {
            "name": "qnx710",
            "environmentSetupScript": "/opt/qnx710/qnxsdp-env.sh",
            "compileCommands": "qnx710_build/compile_commands.json",
            "browse": {
                "path": []
            }
        },
        {
            "name": "qnx800",
            "environmentSetupScript": "/opt/qnx800/qnxsdp-env.sh",
            "compileCommands": "qnx800_build/compile_commands.json",
            "browse": {
                "path": []
            }
        }
    ],
    "version": 4
}

Requiring users to import environment variables before launching VS Code would be cumbersome, because a project may contain many configurations, not just the two mentioned above, and users may frequently switch between configurations.

Vorherrschende Sprache
TypeScript
Sterne
6.2k
Forks
1.7k
Ø Merge
1 T. 17 Std.
Gemergte PRs (30 T.)
12

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus microsoft/vscode-cpptools

Alle Issues in microsoft/vscode-cpptools

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.