Files
carbon-lang/toolchain/language_server/handle_initialize.cpp
T
Richard Smith 277815fd94 language-server: Stub out support for some messages we don't handle yet. (#7637)
This suppresses warnings for unhandled messages where we currently have
nothing to do. No functionality change, except for less spam in the VS
Code output tab.

Assisted-by: Claude Code
2026-08-14 20:15:42 +00:00

33 lines
1.3 KiB
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 <utility>
#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);
}
// Implements `initialized`:
// https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initialized
auto HandleInitialized(Context& /*context*/,
const clang::clangd::NoParams& /*params*/) -> void {
// Nothing to do, but every client sends this, so we handle it rather than
// warning about an unsupported notification.
// TODO: This is when we would use `client/registerCapability` for any
// capabilities we want to register dynamically.
}
} // namespace Carbon::LanguageServer