Skip to content

Commit

Permalink
initialize: implement serverInfo (LSP 3.15.0)
Browse files Browse the repository at this point in the history
Return serverInfo for an initialize request. This helps clients to
identify ccls even when they just connect to a TCP port and allows them
to easily implement server specific functionalities like $ccls/navigate.
  • Loading branch information
nemethf authored and MaskRay committed Nov 11, 2019
1 parent bb0723e commit 3c8ecdf
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/messages/initialize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,6 @@ REFLECT_STRUCT(ServerCap, textDocumentSync, hoverProvider, completionProvider,
documentLinkProvider, foldingRangeProvider,
executeCommandProvider, workspace);

struct ServerInfo {
const char *name = "ccls";
const char *version = CCLS_VERSION;
};
REFLECT_STRUCT(ServerInfo, name, version);

struct DynamicReg {
bool dynamicRegistration = false;
};
Expand Down Expand Up @@ -227,8 +221,12 @@ REFLECT_STRUCT(InitializeParam, rootUri, capabilities, trace, workspaceFolders);

struct InitializeResult {
ServerCap capabilities;
ServerInfo serverInfo;
struct ServerInfo {
const char *name = "ccls";
const char *version = CCLS_VERSION;
} serverInfo;
};
REFLECT_STRUCT(InitializeResult::ServerInfo, name, version);
REFLECT_STRUCT(InitializeResult, capabilities, serverInfo);

struct FileSystemWatcher {
Expand Down

0 comments on commit 3c8ecdf

Please sign in to comment.