Sam McCall | c5a6ee1 | 2020-06-29 21:46:40 +0200 | [diff] [blame] | 1 | //===--- Config.cpp - User configuration of clangd behavior ---------------===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #include "Config.h" |
| 10 | #include "support/Context.h" |
| 11 | |
| 12 | namespace clang { |
| 13 | namespace clangd { |
| 14 | |
| 15 | Key<Config> Config::Key; |
| 16 | |
Sam McCall | 1f14287 | 2020-06-29 23:05:07 +0200 | [diff] [blame] | 17 | const Config &Config::current() { |
| 18 | if (const Config *C = Context::current().get(Key)) |
Sam McCall | c5a6ee1 | 2020-06-29 21:46:40 +0200 | [diff] [blame] | 19 | return *C; |
| 20 | static Config Default; |
| 21 | return Default; |
| 22 | } |
| 23 | |
| 24 | } // namespace clangd |
| 25 | } // namespace clang |