clang-tools  8.0.0
Classes | Public Member Functions | List of all members
clang::clangd::ClangdLSPServer Class Reference

This class exposes ClangdServer's capabilities via Language Server Protocol. More...

#include <ClangdLSPServer.h>

Inheritance diagram for clang::clangd::ClangdLSPServer:
[legend]
Collaboration diagram for clang::clangd::ClangdLSPServer:
[legend]

Classes

class  MessageHandler
 

Public Member Functions

 ClangdLSPServer (Transport &Transp, const clangd::CodeCompleteOptions &CCOpts, llvm::Optional< Path > CompileCommandsDir, bool UseDirBasedCDB, const ClangdServer::Options &Opts)
 If CompileCommandsDir has a value, compile_commands.json will be loaded only from CompileCommandsDir. More...
 
 ~ClangdLSPServer ()
 
bool run ()
 Run LSP server loop, communicating with the Transport provided in the constructor. More...
 

Detailed Description

This class exposes ClangdServer's capabilities via Language Server Protocol.

MessageHandler binds the implemented LSP methods (e.g. onInitialize) to corresponding JSON-RPC methods ("initialize"). The server also supports $/cancelRequest (MessageHandler provides this).

Definition at line 34 of file ClangdLSPServer.h.

Constructor & Destructor Documentation

◆ ClangdLSPServer()

clang::clangd::ClangdLSPServer::ClangdLSPServer ( Transport Transp,
const clangd::CodeCompleteOptions CCOpts,
llvm::Optional< Path CompileCommandsDir,
bool  UseDirBasedCDB,
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. If UseDirBasedCDB is false, compile commands are not read from disk.

Definition at line 723 of file ClangdLSPServer.cpp.

◆ ~ClangdLSPServer()

clang::clangd::ClangdLSPServer::~ClangdLSPServer ( )
default

Member Function Documentation

◆ run()

bool clang::clangd::ClangdLSPServer::run ( )

Run LSP server loop, communicating with the Transport provided in the constructor.

This method must not be executed more than once.

Returns
Whether we shut down cleanly with a 'shutdown' -> 'exit' sequence.

Definition at line 764 of file ClangdLSPServer.cpp.


The documentation for this class was generated from the following files: