Page MenuHomePhabricator

[clangd] Propagate main context into ClangdServer

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



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

See for more details.

sammccall added inline comments.Oct 15 2019, 6:57 AM

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

See for more details.

ilya-biryukov added inline comments.Oct 15 2019, 7:44 AM

NIT: Use tripple slash comments