clang-tools
7.0.0
|
This class provides implementation of an LSP server, glueing the JSON dispatch and ClangdServer together. More...
#include <ClangdLSPServer.h>
Public Member Functions | |
ClangdLSPServer (JSONOutput &Out, const clangd::CodeCompleteOptions &CCOpts, llvm::Optional< Path > CompileCommandsDir, const ClangdServer::Options &Opts) | |
If CompileCommandsDir has a value, compile_commands.json will be loaded only from CompileCommandsDir . More... | |
bool | run (std::FILE *In, JSONStreamStyle InputStyle=JSONStreamStyle::Standard) |
Run LSP server loop, receiving input for it from In . More... | |
This class provides implementation of an LSP server, glueing the JSON dispatch and ClangdServer together.
Definition at line 31 of file ClangdLSPServer.h.
ClangdLSPServer::ClangdLSPServer | ( | JSONOutput & | Out, |
const clangd::CodeCompleteOptions & | CCOpts, | ||
llvm::Optional< Path > | CompileCommandsDir, | ||
const ClangdServer::Options & | Opts | ||
) |
If CompileCommandsDir
has a value, compile_commands.json will be loaded only from CompileCommandsDir
.
Otherwise, clangd will look for compile_commands.json in all parent directories of each file.
Definition at line 422 of file ClangdLSPServer.cpp.
bool ClangdLSPServer::run | ( | std::FILE * | In, |
JSONStreamStyle | InputStyle = JSONStreamStyle::Standard |
||
) |
Run LSP server loop, receiving input for it from In
.
In
must be opened in binary mode. Output will be written using Out variable passed to class constructor. This method must not be executed more than once for each instance of ClangdLSPServer.
Definition at line 430 of file ClangdLSPServer.cpp.
References clang::clangd::ClangdServer::addDocument(), clang::clangd::Array, clang::clangd::Auto, clang::clangd::File, clang::clangd::DraftStore::getActiveFiles(), clang::clangd::DraftStore::getDraft(), clang::clangd::Diagnostic::message, clang::clangd::MethodNotFound, clang::clangd::Object, clang::clangd::Diagnostic::range, clang::clangd::registerCallbackHandlers(), clang::clangd::replyError(), clang::clangd::runLanguageServerLoop(), clang::clangd::Diagnostic::severity, clang::clangd::toLSPDiags(), clang::clangd::Value, and clang::clangd::JSONOutput::writeMessage().