microsoft / microsoft/vscode-cpptools

Support for vcxproj/sln projects

Offen
#10,140 6 Kommentare 53 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Feature Request Feature: Configuration Language Service
Vorherrschende Sprache
TypeScript
Sterne
6.2k
Forks
1.7k
Ø Merge
14 Std. 46 Min.
Gemergte PRs (30 T.)
61

Beschreibung

Environment
  • OS and Version: Windows 11
  • VS Code Version: 1.74.0-insider
  • C/C++ Extension Version: v1.13.3

I'm trying to use vscode with C++ projects originally created in Visual Studio. These projects are configured via .sln and .vcxproj files. The code navigation is very limited. I cannot "go to definition" or "go to delcaration" when those definitions and declarations are in other files. I believe this is because cpptools doesn't parse vcxproj and sln files in the same way that it parses compile_commands.json databases or other similar files.

Bug Summary and Steps to Reproduce

Bug Summary:
"go to definition" or "go to delcaration" does not work when those definitions and declarations are in other files. This occurs in projects based on .vcxproj files

Steps to reproduce:

  1. Open a vcxproj/sln based project
  2. Click "Go To Declaration"
  3. editor doesnt show dclaration
Expected behavior

Ability to fully use all features that rely on cpptools knowing how the project is compiled.

Code sample and Logs
`c_cpp_properties.json`:

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.22621.0",
            "compilerPath": "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "mergeConfigurations": true
        }
    ],
    "version": 4
}


### Screenshots

_No response_

### Additional context

_No response_

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, den Fehler mit dem gemeldeten .sln- und .vcxproj-Projekt und der gezeigten c_cpp_properties.json-Konfiguration zu reproduzieren, indem du die Schritte für Go To Declaration befolgst. Vergleiche, wie diese Projekte Kompilierungsinformationen im Vergleich zur Unterstützung von compile_commands.json bereitstellen. Fertig ist die Aufgabe, wenn Deklarationen und Definitionen in anderen Dateien gefunden werden und die relevanten cpptools-Features für Visual Studio-Projekte funktionieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cpp, vscode
Bereich
compilers, developer-experience, tooling
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

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