language_server.h 870 B

123456789101112131415161718192021
  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. auto Run(FILE* input_stream, llvm::raw_ostream& output_stream,
  13. llvm::raw_ostream& error_stream, DiagnosticConsumer& consumer) -> bool;
  14. } // namespace Carbon::LanguageServer
  15. #endif // CARBON_TOOLCHAIN_LANGUAGE_SERVER_LANGUAGE_SERVER_H_