Implement lsp/formatting for Carbon::LanguageServer (#7688)

Implements formatting support within LSP. Current implementation
performs while file formatting, we just replace file with output of
Carbon::Format()

https://github.com/carbon-language/carbon-lang/pull/7687 independently
improves formatting so that this output is somewhat decent.

Assisted-With: Gemini / Antigravity
This commit is contained in:
DavidLoftus
2026-08-31 16:38:38 +00:00
committed by GitHub
parent f519cccaf2
commit dc2ee5bd5e
31 changed files with 379 additions and 25 deletions
@@ -76,6 +76,7 @@ IncomingMessages::IncomingMessages(clang::clangd::Transport* transport,
AddCallHandler("textDocument/declaration", &HandleDefinition);
AddCallHandler("textDocument/definition", &HandleDefinition);
AddCallHandler("textDocument/documentSymbol", &HandleDocumentSymbol);
AddCallHandler("textDocument/formatting", &HandleFormatting);
AddCallHandler("textDocument/hover", &HandleHover);
AddCallHandler("textDocument/references", &HandleReferences);
AddCallHandler("textDocument/typeDefinition", &HandleTypeDefinition);