-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Feature: Code FormattingLanguage ServicebugexternalfixedCheck the Milestone for the release in which the fix is or will be available.Check the Milestone for the release in which the fix is or will be available.
Milestone
Description
Environment
- OS and Version: macOS Sequoia 15.2
- VS Code Version: 1.95.3 (Universal)
- C/C++ Extension Version: v1.22.11
- If using SSH remote, specify OS of remote machine: N/A
Bug Summary and Steps to Reproduce
Bug Summary: When using Format Document from the (right click) context menu, the active file is formatted when that file is listed in .clang-format-ignore.
Steps to reproduce:
- Create test.cpp in root of project with contents of
#include <iostream>
int main(int argc, char *argv[])
{
int value = 5;
int x = 0;
return 0;
}
- Create
.clang-formatfile in root of project with contents ofAlignConsecutiveAssignments: true - Create
.clang-format-ignorefile in the root of the project with the absolute path totest.cpp - Open
test.cppin editor, right click and selectFormat Document - Notice that file has been updated with the formatting specified in
.clang-format
If you run clang-format -i test.cpp in the integrated kernel, the file's format is not updated.
Expected behavior: File should not be formatted
Configuration and Logs
I have no c_cpp_properties.json. Log diagnostics show the clang-format command as:
/Users/jeff/.vscode/extensions/ms-vscode.cpptools-1.22.11-darwin-arm64/bin/../LLVM/bin/clang-format -style=file -fallback-style=LLVM --Wno-error=unknown -assume-filename=/Users/jeff/Development/clang-format/test.cppOther Extensions
No response
Additional context
No response
escherstair, existedinnettw, SharonVEC and dhebbeker
Metadata
Metadata
Assignees
Labels
Feature: Code FormattingLanguage ServicebugexternalfixedCheck the Milestone for the release in which the fix is or will be available.Check the Milestone for the release in which the fix is or will be available.
Type
Projects
Status
Done