You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
clang-format won't use .clang-format file on UNC-style network share out of box #2124
This is because we try to search for the .clang-format up the path -- our path iteration code might be buggy for UNC-style paths, although I would expect other scenarios to be buggy as well. That manual checking only gets used if the fall back style is the default of "Visual Studio", so using "none" bypasses it.
This occurs for me when using the remote dev feature with WSL2.
1. Does not use .clang-format file
My paths are of the form: /home/sketch34/Dev/project/src/subdir/test.cpp
I cannot make vscode use the .clang-format file located at /home/sketch34/Dev/project with any combination of options. I have tried setting the fallback style to "none". I also tried moving the .clang-format file into the /src directory.
Activity
sean-mcmanus commentedon Jun 12, 2018
This is because we try to search for the .clang-format up the path -- our path iteration code might be buggy for UNC-style paths, although I would expect other scenarios to be buggy as well. That manual checking only gets used if the fall back style is the default of "Visual Studio", so using "none" bypasses it.
sketch34 commentedon Sep 27, 2021
This occurs for me when using the remote dev feature with WSL2.
1. Does not use .clang-format file
My paths are of the form:
/home/sketch34/Dev/project/src/subdir/test.cppI cannot make vscode use the
.clang-formatfile located at/home/sketch34/Dev/projectwith any combination of options. I have tried setting the fallback style to"none". I also tried moving the .clang-format file into the/srcdirectory.2. Empty fallbackStyle disables clang_format_style
Additionally if the fallback style is empty
"C_Cpp.clang_format_fallbackStyle": ""then theC_Cpp.clang_format_stylehas no effect.E.g. This works and applies the LLVM style:
This has no effect and will not apply any formatting:
Version: 1.60.1 (user setup)
Commit: 83bd43bc519d15e50c4272c6cf5c1479df196a4d
Date: 2021-09-10T17:07:10.714Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19042
sean-mcmanus commentedon Sep 28, 2021
Jarrod Smith (@sketch34) Your issue is not the same as the original issue (you're not using UNC-style paths). I'll move it to a new issue.