This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Add caching behaviour for clang-format config
Needs ReviewPublic

Authored by njames93 on Dec 24 2020, 3:26 AM.

Details

Summary

Create a clang format configuration provider to be used when getting the FormatStyle for any features which require formatting behaviour.
Create a provider that searches the directory for configuration files, according to how clang-format searches, and stores the parsed styles in a cache.
Create a provider that just returns the LLVM style designed for use in tests where directory based formatting isn't required.

Diff Detail

Event Timeline

njames93 created this revision.Dec 24 2020, 3:26 AM
njames93 requested review of this revision.Dec 24 2020, 3:26 AM
njames93 updated this revision to Diff 320301.Jan 30 2021, 7:36 AM

Refactor alot of the implementation.

njames93 retitled this revision from [clangd][WIP] Add caching behaviour for clang-format config to [clangd] Add caching behaviour for clang-format config.Jan 30 2021, 7:44 AM
njames93 edited the summary of this revision. (Show Details)
njames93 updated this revision to Diff 320309.Jan 30 2021, 9:29 AM

Tests pass on my machine, rebasing on main and trigger a fresh rebuild.

njames93 updated this revision to Diff 320319.Jan 30 2021, 11:34 AM

Hopefully fix the build failing. ASAN said it was a use-after-scope issue which seemed suspicious.

njames93 updated this revision to Diff 320333.Jan 30 2021, 5:03 PM

Small fix

njames93 updated this revision to Diff 321988.Feb 7 2021, 7:26 AM

Add unittests for provider.

njames93 updated this revision to Diff 325267.Feb 20 2021, 6:10 PM

Update to support inheriting configurations from D93844