Files
carbon-lang/toolchain/language_server/handle_initialize.cpp
T
a881e21432 Language Server - implement incremental document sync (#4926)
The language server is now able to subscribe to and apply incremental
changes to the document. Source code is assumed to be utf-8. It does not
currently handle utf-16 code points.

---------

Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2025-02-15 02:05:56 +00:00

21 lines
754 B
C++

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