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 integrated in the extension (Windows 10) #12289

Closed
andywowws opened this issue May 8, 2024 · 7 comments
Assignees
Labels
bug Feature: Code Formatting fixed Check the Milestone for the release in which the fix is or will be available. Language Service regression A bug that didn't exist in a previous release
Milestone

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: repro This issue's repro steps 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

@bobbrow bobbrow added this to cpptools Jun 17, 2024
@github-project-automation github-project-automation bot moved this to Triage in cpptools Jun 17, 2024
@bobbrow bobbrow removed the status in cpptools Jun 20, 2024
@noor-uddin-sheikh
Copy link

i am also facing this problem since long time now, in version 1.19.9 it is working totally fine, but not int he latest versions.

@bobbrow
Copy link
Member

bobbrow commented Jul 29, 2024

@noor-uddin-sheikh are you also using Windows 10?

@noor-uddin-sheikh
Copy link

noor-uddin-sheikh commented Jul 29, 2024 via email

@bobbrow
Copy link
Member

bobbrow commented Jul 29, 2024

Thank you for confirming.

@bobbrow bobbrow changed the title Error while formatting C++ code with clang-format.exe intergrated in the extension Error while formatting C++ code with clang-format.exe integrated in the extension (Windows 10) Jul 29, 2024
@sean-mcmanus sean-mcmanus added the regression A bug that didn't exist in a previous release label Jul 29, 2024
@bobbrow bobbrow moved this to Todo in cpptools Jul 29, 2024
@bobbrow bobbrow moved this from Todo to In progress in cpptools Jul 30, 2024
@Colengms Colengms moved this from In progress to Done in cpptools Jul 31, 2024
@sean-mcmanus sean-mcmanus added fixed Check the Milestone for the release in which the fix is or will be available. and removed investigate: repro This issue's repro steps needs to be investigated/confirmed labels Jul 31, 2024
@sean-mcmanus sean-mcmanus added this to the 1.21.5 milestone Jul 31, 2024
@sean-mcmanus
Copy link
Contributor

@github-actions github-actions bot locked and limited conversation to collaborators Sep 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Feature: Code Formatting fixed Check the Milestone for the release in which the fix is or will be available. Language Service regression A bug that didn't exist in a previous release
Projects
Status: Done
Development

No branches or pull requests

5 participants