handle_initialize.cpp 741 B

1234567891011121314151617181920
  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 "toolchain/language_server/handle.h"
  5. namespace Carbon::LanguageServer {
  6. auto HandleInitialize(
  7. Context& /*context*/,
  8. const clang::clangd::NoParams& /*client_capabilities*/,
  9. llvm::function_ref<void(llvm::Expected<llvm::json::Object>)> on_done)
  10. -> void {
  11. llvm::json::Object capabilities{{"documentSymbolProvider", true},
  12. {"textDocumentSync", /*Full=*/1}};
  13. llvm::json::Object reply{{"capabilities", std::move(capabilities)}};
  14. on_done(reply);
  15. }
  16. } // namespace Carbon::LanguageServer