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