[clangd] Propagate main context into ClangdServer
authorKadir Cetinkaya <kadircet@google.com>
Tue, 15 Oct 2019 14:20:52 +0000 (14:20 +0000)
committerKadir Cetinkaya <kadircet@google.com>
Tue, 15 Oct 2019 14:20:52 +0000 (14:20 +0000)
commit9d66247e9b78ceb821fba12a1d2ff66839911163
treea1d1fb78709187599c9b09c91f538bb2a5cb154a
parentab5025654448ad0c93af18727f9b0698f451bd94
[clangd] Propagate main context into ClangdServer

Summary:
Currently clangd initializes the ClangdServer lazily during
onInitialize request, and it results in propagation of caller's context rather
than the main context created ClangdLSPServer.

This patch changes the logic to store main context that created ClangdLSPServer
and pass it onto to ClangdServer and other objects like CDBs.

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68978

llvm-svn: 374892
clang-tools-extra/clangd/ClangdLSPServer.cpp
clang-tools-extra/clangd/ClangdLSPServer.h