The redundancy around work-done-progress is annoying but ok for now.
There's a weirdness with context lifetimes around outgoing method calls, which
I've preserved to keep this NFC. We should probably fix it though.
Paths
| Differential D96717
[clangd] Bind outgoing calls through LSPBinder too. NFC ClosedPublic Authored by sammccall on Feb 15 2021, 8:36 AM.
Details Summary The redundancy around work-done-progress is annoying but ok for now. There's a weirdness with context lifetimes around outgoing method calls, which
Diff Detail
Event TimelineComment Actions mostly LG. some comments around the way we set up outgoinmethod stubs though.
sammccall added inline comments.
sammccall marked an inline comment as done. Comment Actionsrebase & address comments (except bind out API, still to come) Comment Actions OK, the awful proxy object thing works :-) Comment Actions thanks! can't wait for the unique_function sfinae fix :)
This revision is now accepted and ready to land.Feb 16 2021, 9:21 AM sammccall added a parent revision: D96794: [ADT] Add SFINAE guards to unique_function constructor..Feb 16 2021, 1:52 PM Closed by commit rG7b83837af6f4: [clangd] Bind outgoing calls through LSPBinder too. NFC (authored by sammccall). · Explain WhyFeb 17 2021, 1:57 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 324237 clang-tools-extra/clangd/ClangdLSPServer.h
clang-tools-extra/clangd/ClangdLSPServer.cpp
clang-tools-extra/clangd/LSPBinder.h
clang-tools-extra/clangd/Module.h
clang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp
clang-tools-extra/clangd/unittests/LSPBinderTests.cpp
|
well this one filling an out-parameter definitely tripped me over while reading the code a couple times, and once more on the tests.
what about making this return the handler instead? E.g. Edit = Bind.outgoingMethod<EditParams, EditResult>("edit"), I know it is ugly that we duplicate template params on declaration + here now. Maybe we can get away by making OutgoingMethod a class with a call operator and a RawOutgoing *Out member that can be bound later on ? e.g:
then we either make LSPBinder a friend of OutgoingMethod and set Out through it, or the other way around and have a OutgoingMethod::bindOut(LSPBinder&) ?
not sure if it is any better though, as we still construct a somewhat invalid object :/