language_server.h 1.0 KB

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