microsoft / microsoft/vscode-cpptools

clang-format won't use .clang-format file on UNC-style network share out of box

Open
#2,124 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug Language Service network drive
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Type: LanguageService

  • OS and Version: Windows 10 1803
  • VS Code Version: 1.23.1
  • C/C++ Extension Version: 0.17.4
  • The .clang-format file will not be used if the project resides on an UNC-style network share, unless the fallback style is forced to "none".
  • This does not occur on drive-letter mounted network shares or local drives.

To Reproduce
Steps to reproduce the behavior:

  1. Prepare a directory with a .clang-format file and some source on a network share like my \\10.0.1.15\zao\code\gggtools.
  2. Open the folder with VS Code.
  3. Open a C++ source file.
  4. Hit the formatting shortcut.
  5. Note that it doesn't use the .clang-format file, instead using the fallback style.
  6. Configure "C_Cpp.clang_format_fallbackStyle": "none" in settings.
  7. Format again.
  8. Note how the .clang-format file is used as intended.

Expected behavior
I expect the formatter to always find and use the .clang-format file in the tree regardless of fallback style.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the formatting failure using a .clang-format file on a UNC-style Windows network share, then compare it with a drive-letter share and a local drive. Trace the C/C++ extension's formatter and fallback-style handling; done means the tree's .clang-format file is used on UNC paths without requiring fallbackStyle to be set to "none".

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, typescript
Domain
operating-systems, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.