microsoft / microsoft/vscode-cpptools
Contents of `c_cpp_properties.json` file can get irrecoverably deleted
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 6.2k
- Forks
- 1.7k
- Ø Merge
- 14 Std. 46 Min.
- Gemergte PRs (30 T.)
- 61
Beschreibung
Environment
- OS and Version: Debian 6.1.0-32-amd64
- VS Code Version: 1.98.2
- C/C++ Extension Version: 1.24.5
- If using SSH remote, specify OS of remote machine: N/A
Bug Summary and Steps to Reproduce
Bug Summary:
After stashing and restoring .vscode/c_cpp_properties.json through git, cpptools will re-populate it's contents with default value deleting old contents.
Also works when temporarily moving or renaming .vscode directory.
Steps to reproduce:
- Create empty project and initialize git.
mkdir -p foo/.vscode cd foo touch main.c git init git add main.c git commit -m 'Initial commit' - Populate
c_cpp_properties.json. Just something that differs from the default.echo '{"configurations":[{"name":"Foo"}],"version":4}' > .vscode/c_cpp_properties.json - Open project folder in vscode and edit
main.c. You should see C/C++ configuration is "Foo". - Without closing vscode, stash untracked files and then restore them.
git stash -k -u git stash pop - Switch back to
main.c. You should see C/C++ configuration has changed to default ("Linux" in my case). - Click
C/C++: Edit Configurations (JSON)through bottom right corner or command palette. This action destroys contents ofc_cpp_properties.json. If you'd instead close and re-open vscode, you'd be safe.
Configuration and Logs
{"configurations":[{"name":"Foo"}],"version":4}
[C++.log](https://github.com/user-attachments/files/19702057/C%2B%2B.log)
[C++ Diagnostics.log](https://github.com/user-attachments/files/19702056/C%2B%2B.Diagnostics.log)
Other Extensions
- Vim
Additional context
No response
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere das Problem mit .vscode/c_cpp_properties.json anhand der aufgeführten Schritte git stash -k -u und git stash pop und verwende dann C/C++: Edit Configurations (JSON), um das Überschreiben zu bestätigen. Lies die verknüpften C++-Logs, während du das Verhalten der Erweiterung rund um die wiederhergestellte Konfiguration nachverfolgst. Als erledigt gilt die Aufgabe, wenn die benutzerdefinierte Foo-Konfiguration nach der Wiederherstellung und dem Bearbeiten der JSON-Konfiguration intakt bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100