language_server.h 993 B

123456789101112131415161718192021222324
  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. #ifndef CARBON_TOOLCHAIN_LANGUAGE_SERVER_LANGUAGE_SERVER_H_
  5. #define CARBON_TOOLCHAIN_LANGUAGE_SERVER_LANGUAGE_SERVER_H_
  6. #include "common/ostream.h"
  7. #include "toolchain/diagnostics/diagnostic_consumer.h"
  8. namespace Carbon::LanguageServer {
  9. // Start the language server. input_stream and output_stream are used by LSP;
  10. // error_stream is primarily for errors that don't fit into LSP. Returns true if
  11. // the server cleanly exits.
  12. //
  13. // This is thread-hostile because `clangd::LoggingSession` relies on a global.
  14. auto Run(FILE* input_stream, llvm::raw_ostream& output_stream,
  15. llvm::raw_ostream& error_stream, llvm::raw_ostream* vlog_stream,
  16. DiagnosticConsumer& consumer) -> bool;
  17. } // namespace Carbon::LanguageServer
  18. #endif // CARBON_TOOLCHAIN_LANGUAGE_SERVER_LANGUAGE_SERVER_H_