Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while formatting C++ code with clang-format.exe intergrated in the extension #12289

Open
andywowws opened this issue May 8, 2024 · 2 comments
Labels
bug Feature: Code Formatting investigate This issue needs to be investigated/confirmed Language Service

Comments

@andywowws
Copy link

Environment

  • OS and Version: Win10
  • VS Code Version: 1.89.0
  • C/C++ Extension Version: 1.20.5
  • If using SSH remote, specify OS of remote machine:

Bug Summary and Steps to Reproduce

Bug Summary:Have an error while formatting:
Formatting failed:
c:\Users\Administrator.vscode\extensions\ms-vscode.cpptools-1.20.5-win32-x64/bin/../LLVM/bin/clang-format.exe -style=file -fallback-style=google -sort-includes=0 --Wno-error=unknown -assume-filename=D:\lgtm\P3612.cpp D:\LGTM\P3612.CPP

Steps to reproduce:

  1. Press "Shift+Alt+F"
  2. See error

Expected behavior:
No such error just as version 1.19.9 of the extension
.clang-format

---
# 语言: None, Cpp, Java, JavaScript, ObjC, Proto, TableGen, TextProto
Language: Cpp
# 基于某一主题上的修改
BasedOnStyle: Google
# 缩进宽度
IndentWidth: 4
# 缩进case标签
IndentCaseLabels: true
# 访问说明符(public、private等)的偏移
AccessModifierOffset: -4
# 括号之前不断行
BreakBeforeBraces: Attach
#
AllowShortIfStatementsOnASingleLine: false
#
AllowShortLoopsOnASingleLine: false

Configuration and Logs

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "compilerPath": "D:/mingw64/bin/g++.exe",
            "cStandard": "c17",
            "cppStandard": "c++17"
        }
    ],
    "version": 4
}

log
Formatting failed:
c:\Users\Administrator\.vscode\extensions\ms-vscode.cpptools-1.20.5-win32-x64/bin/../LLVM/bin/clang-format.exe -style=file -fallback-style=google -sort-includes=0 --Wno-error=unknown -assume-filename=D:\lgtm\P3612.cpp D:\LGTM\P3612.CPP

Other Extensions

No response

Additional context

No response

@sean-mcmanus sean-mcmanus added bug Language Service investigate This issue needs to be investigated/confirmed Feature: Code Formatting labels May 10, 2024
@andywowws
Copy link
Author

andywowws commented May 12, 2024

The bug seems to only appear on Windows 10, not Windows 11.

@andywowws
Copy link
Author

These are two clang-format.exe intergrated in 1.19.9 and 1.20.5
1.19.9:
clang-format_1.19.9.zip
1.20.5:
clang-format_1.20.5.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Feature: Code Formatting investigate This issue needs to be investigated/confirmed Language Service
Projects
None yet
Development

No branches or pull requests

2 participants