@@ -258,15 +258,6 @@ class ClangdLSPServer::MessageHandler : public Transport::MessageHandler {
258
258
};
259
259
}
260
260
261
- template <typename Result>
262
- void bind (const char *Method,
263
- void (ClangdLSPServer::*Handler)(Callback<Result>)) {
264
- Calls[Method] = [Handler, this ](llvm::json::Value RawParams,
265
- ReplyOnce Reply) {
266
- (Server.*Handler)(std::move (Reply));
267
- };
268
- }
269
-
270
261
// Bind a reply callback to a request. The callback will be invoked when
271
262
// clangd receives the reply from the LSP client.
272
263
// Return a call id of the request.
@@ -310,20 +301,6 @@ class ClangdLSPServer::MessageHandler : public Transport::MessageHandler {
310
301
};
311
302
}
312
303
313
- void bind (const char *Method, void (ClangdLSPServer::*Handler)()) {
314
- Notifications[Method] = [Handler, this ](llvm::json::Value RawParams) {
315
- (Server.*Handler)();
316
- };
317
- }
318
-
319
- template <>
320
- void bind<NoParams>(const char *Method,
321
- void (ClangdLSPServer::*Handler)(const NoParams &)) {
322
- Notifications[Method] = [Handler, this ](llvm::json::Value RawParams) {
323
- (Server.*Handler)(NoParams{});
324
- };
325
- }
326
-
327
304
private:
328
305
// Function object to reply to an LSP call.
329
306
// Each instance must be called exactly once, otherwise:
@@ -670,15 +647,17 @@ void ClangdLSPServer::onInitialize(const InitializeParams &Params,
670
647
671
648
void ClangdLSPServer::onInitialized (const InitializedParams &Params) {}
672
649
673
- void ClangdLSPServer::onShutdown (Callback<std::nullptr_t > Reply) {
650
+ void ClangdLSPServer::onShutdown (const ShutdownParams &Params,
651
+ Callback<std::nullptr_t > Reply) {
674
652
// Do essentially nothing, just say we're ready to exit.
675
653
ShutdownRequestReceived = true ;
676
654
Reply (nullptr );
677
655
}
678
656
679
657
// sync is a clangd extension: it blocks until all background work completes.
680
658
// It blocks the calling thread, so no messages are processed until it returns!
681
- void ClangdLSPServer::onSync (Callback<std::nullptr_t > Reply) {
659
+ void ClangdLSPServer::onSync (const NoParams &Params,
660
+ Callback<std::nullptr_t > Reply) {
682
661
if (Server->blockUntilIdleForTest (/* TimeoutSeconds=*/ 60 ))
683
662
Reply (nullptr );
684
663
else
@@ -1466,7 +1445,8 @@ void ClangdLSPServer::onSemanticTokensDelta(
1466
1445
});
1467
1446
}
1468
1447
1469
- void ClangdLSPServer::onMemoryUsage (Callback<MemoryTree> Reply) {
1448
+ void ClangdLSPServer::onMemoryUsage (const NoParams &,
1449
+ Callback<MemoryTree> Reply) {
1470
1450
llvm::BumpPtrAllocator DetailAlloc;
1471
1451
MemoryTree MT (&DetailAlloc);
1472
1452
profile (MT);
0 commit comments