This repository has been archived by the owner on Jul 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#include "message_handler.h" | ||
#include "query_utils.h" | ||
#include "queue_manager.h" | ||
|
||
namespace { | ||
struct lsDocumentSymbolParams { | ||
lsTextDocumentIdentifier textDocument; | ||
}; | ||
MAKE_REFLECT_STRUCT(lsDocumentSymbolParams, textDocument); | ||
|
||
struct Ipc_CqueryFileInfo : public RequestMessage<Ipc_CqueryFileInfo> { | ||
const static IpcId kIpcId = IpcId::CqueryFileInfo; | ||
lsDocumentSymbolParams params; | ||
}; | ||
MAKE_REFLECT_STRUCT(Ipc_CqueryFileInfo, id, params); | ||
REGISTER_IPC_MESSAGE(Ipc_CqueryFileInfo); | ||
|
||
struct Out_CqueryFileInfo : public lsOutMessage<Out_CqueryFileInfo> { | ||
lsRequestId id; | ||
QueryFile::Def result; | ||
}; | ||
MAKE_REFLECT_STRUCT(Out_CqueryFileInfo, jsonrpc, id, result); | ||
|
||
struct CqueryFileInfoHandler : BaseMessageHandler<Ipc_CqueryFileInfo> { | ||
void Run(Ipc_CqueryFileInfo* request) override { | ||
QueryFile* file; | ||
if (!FindFileOrFail(db, project, request->id, | ||
request->params.textDocument.uri.GetPath(), &file)) { | ||
return; | ||
} | ||
|
||
Out_CqueryFileInfo out; | ||
out.id = request->id; | ||
// Expose some fields of |QueryFile::Def|. | ||
out.result.path = file->def->path; | ||
out.result.args = file->def->args; | ||
out.result.language = file->def->language; | ||
out.result.includes = file->def->includes; | ||
out.result.inactive_regions = file->def->inactive_regions; | ||
QueueManager::WriteStdout(IpcId::CqueryFileInfo, out); | ||
} | ||
}; | ||
REGISTER_MESSAGE_HANDLER(CqueryFileInfoHandler); | ||
} // namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters