handle_initialize.cpp 774 B

12345678910111213141516171819202122
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #include <utility>
  5. #include "toolchain/language_server/handle.h"
  6. namespace Carbon::LanguageServer {
  7. auto HandleInitialize(
  8. Context& /*context*/,
  9. const clang::clangd::NoParams& /*client_capabilities*/,
  10. llvm::function_ref<auto(llvm::Expected<llvm::json::Object>)->void> on_done)
  11. -> void {
  12. llvm::json::Object capabilities{{"documentSymbolProvider", true},
  13. {"textDocumentSync", /*Incremental=*/2}};
  14. llvm::json::Object reply{{"capabilities", std::move(capabilities)}};
  15. on_done(reply);
  16. }
  17. } // namespace Carbon::LanguageServer