This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Propagate main context into ClangdServer
ClosedPublic

Authored by kadircet on Oct 15 2019, 2:59 AM.

Details

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.

Diff Detail

Event Timeline

kadircet created this revision.Oct 15 2019, 2:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 15 2019, 2:59 AM
Bulid results are available at http://results.llvm-merge-guard.org/Phabricator-35

See http://jenkins.llvm-merge-guard.org/job/Phabricator/35/ for more details.

sammccall added inline comments.Oct 15 2019, 6:57 AM
clang-tools-extra/clangd/ClangdLSPServer.cpp
463

As discussed offline: I think it'd be clearer to put this in a small block around the construction of clangd server. (Then we can avoid some ofthe Optional bits too)

sammccall accepted this revision.Oct 15 2019, 6:57 AM

Otherwise LG

This revision is now accepted and ready to land.Oct 15 2019, 6:57 AM
kadircet updated this revision to Diff 225027.Oct 15 2019, 7:03 AM
kadircet marked an inline comment as done.
  • Move context swapping next to server creation
This revision was automatically updated to reflect the committed changes.
Bulid results are available at http://results.llvm-merge-guard.org/Phabricator-39

See http://jenkins.llvm-merge-guard.org/job/Phabricator/39/ for more details.

ilya-biryukov added inline comments.Oct 15 2019, 7:44 AM
clang-tools-extra/clangd/ClangdLSPServer.h
135

NIT: Use tripple slash comments