microsoft / microsoft/vscode-cpptools

Default clang-format is bundled version not system version

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

Dieses Issue hat noch niemand übernommen.

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

Beschreibung

Type: LanguageService

Describe the bug

  • OS and Version: Ubuntu 18.-4
  • VS Code Version: 1.50.0
  • C/C++ Extension Version: 1.01
  • Other extensions you installed (and if the issue persists after disabling them):
  • Does this issue involve using SSH remote to run the extension on a remote machine?: NA
  • A clear and concise description of what the bug is, including information about the workspace (i.e. is the workspace a single project or multiple projects, size of the project, etc).

When using clang-format to format a document with no path set for the field "C_Cpp.clang_format_path" the bundled version is used instead of the system version.

"The full path of the clang-format executable. If not specified, and clang-format is available in the environment path, that is used. If not found in the environment path, a copy of clang-format bundled with the extension will be used."

The only way I can tell this is clang-format-10 reorders groups by default where clang-format-6(18.04 ubuntu default) preserves the group by default. This is checked by specify the path to clang-format and observing the changes.

~/.vscode/extensions/ms-vscode.cpptools-1.0.1/LLVM/bin/clang-format --version
clang-format version 10.0.0 (https://github.com/llvm/llvm-project d32170dbd5b0d54436537b6b75beaf44324e0c28)
clang-format --version
clang-format version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)

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

Beginnen Sie mit der Einstellung C_Cpp.clang_format_path und verfolgen Sie, wie die Erweiterung clang-format auflöst, wenn die Einstellung nicht gesetzt ist, wobei das gebündelte LLVM/bin/clang-format mit der System-Executable verglichen wird. Als erledigt gilt die Aufgabe, wenn die dokumentierte Bevorzugung des Umgebungspfads eingehalten wird und das Verhalten anhand der gemeldeten clang-format-Versionen überprüft ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cpp
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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