This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Delay binding LSP methods until initialize. NFC
ClosedPublic

Authored by sammccall on Feb 12 2021, 7:24 AM.

Details

Summary

This is NFC because the MessageHandler refused to dispatch to them until the
server is initialized anyway.

This is a more natural time to bind them - it's when they become callable, and
it's when client capabalities are available and server ones can be set.

One module-lifecycle function will be responsible for all three.

Diff Detail

Event Timeline

sammccall created this revision.Feb 12 2021, 7:24 AM
sammccall requested review of this revision.Feb 12 2021, 7:24 AM
kadircet accepted this revision.Feb 12 2021, 9:36 AM
kadircet added inline comments.
clang-tools-extra/clangd/ClangdLSPServer.cpp
165

this one is a functional change though , previously we would say notification X before initialization for cancellations that arrived before init, now we are going to say "bad cancellation request". not that it is bad, but it makes me wonder if it is intentional :D

173

you mean just else ?

This revision is now accepted and ready to land.Feb 12 2021, 9:36 AM
sammccall marked 2 inline comments as done.Feb 15 2021, 10:26 AM
sammccall added inline comments.
clang-tools-extra/clangd/ClangdLSPServer.cpp
165

Oops, yes - unintentional.
(now the structure of onNotify and onCall looks more similar, thanks!)

sammccall marked an inline comment as done.

address comments & rebase

This revision was landed with ongoing or failed builds.Feb 15 2021, 10:33 AM
This revision was automatically updated to reflect the committed changes.