Rename message files (e.g. ccls_call_hierarchy.cc -> ccls_callHierarchy.cc)

This commit is contained in:
Fangrui Song 2018-07-03 10:44:03 -07:00
parent 9852e618cd
commit 2682964039
24 changed files with 47 additions and 35 deletions

View File

@ -220,32 +220,32 @@ target_sources(ccls PRIVATE
target_sources(ccls PRIVATE
src/messages/ccls_base.cc
src/messages/ccls_call_hierarchy.cc
src/messages/ccls_callHierarchy.cc
src/messages/ccls_callers.cc
src/messages/ccls_file_info.cc
src/messages/ccls_freshen_index.cc
src/messages/ccls_inheritance_hierarchy.cc
src/messages/ccls_member_hierarchy.cc
src/messages/ccls_fileInfo.cc
src/messages/ccls_freshenIndex.cc
src/messages/ccls_inheritanceHierarchy.cc
src/messages/ccls_memberHierarchy.cc
src/messages/ccls_vars.cc
src/messages/exit.cc
src/messages/initialize.cc
src/messages/shutdown.cc
src/messages/text_document_code_lens.cc
src/messages/text_document_completion.cc
src/messages/text_document_definition.cc
src/messages/text_document_did_change.cc
src/messages/text_document_did_close.cc
src/messages/text_document_did_open.cc
src/messages/text_document_did_save.cc
src/messages/text_document_document_highlight.cc
src/messages/text_document_document_symbol.cc
src/messages/text_document_hover.cc
src/messages/text_document_implementation.cc
src/messages/text_document_references.cc
src/messages/text_document_rename.cc
src/messages/text_document_signature_help.cc
src/messages/text_document_type_definition.cc
src/messages/workspace_did_change_configuration.cc
src/messages/workspace_did_change_watched_files.cc
src/messages/textDocument_codeLens.cc
src/messages/textDocument_completion.cc
src/messages/textDocument_definition.cc
src/messages/textDocument_didChange.cc
src/messages/textDocument_didClose.cc
src/messages/textDocument_didOpen.cc
src/messages/textDocument_didSave.cc
src/messages/textDocument_documentHighlight.cc
src/messages/textDocument_documentSymbol.cc
src/messages/textDocument_hover.cc
src/messages/textDocument_implementation.cc
src/messages/textDocument_references.cc
src/messages/textDocument_rename.cc
src/messages/textDocument_signatureHelp.cc
src/messages/textDocument_typeDefinition.cc
src/messages/workspace_didChangeConfiguration.cc
src/messages/workspace_didChangeWatchedFiles.cc
src/messages/workspace_symbol.cc
)

View File

@ -20,6 +20,21 @@ struct In_TextDocumentDocumentSymbol : public RequestInMessage {
MAKE_REFLECT_STRUCT(In_TextDocumentDocumentSymbol, id, params);
REGISTER_IN_MESSAGE(In_TextDocumentDocumentSymbol);
struct lsSimpleLocation {
lsRange range;
};
MAKE_REFLECT_STRUCT(lsSimpleLocation, range);
struct lsSimpleSymbolInformation {
lsSimpleLocation location;
};
MAKE_REFLECT_STRUCT(lsSimpleSymbolInformation, location);
struct Out_SimpleDocumentSymbol
: public lsOutMessage<Out_SimpleDocumentSymbol> {
lsRequestId id;
std::vector<lsSimpleSymbolInformation> result;
};
MAKE_REFLECT_STRUCT(Out_SimpleDocumentSymbol, jsonrpc, id, result);
struct Out_TextDocumentDocumentSymbol
: public lsOutMessage<Out_TextDocumentDocumentSymbol> {
lsRequestId id;
@ -32,8 +47,6 @@ struct Handler_TextDocumentDocumentSymbol
MethodType GetMethodType() const override { return kMethodType; }
void Run(In_TextDocumentDocumentSymbol* request) override {
auto& params = request->params;
Out_TextDocumentDocumentSymbol out;
out.id = request->id;
QueryFile* file;
int file_id;
@ -42,17 +55,17 @@ struct Handler_TextDocumentDocumentSymbol
return;
if (params.all) {
Out_SimpleDocumentSymbol out;
out.id = request->id;
for (SymbolRef sym : file->def->all_symbols)
if (std::optional<lsSymbolInformation> info =
GetSymbolInfo(db, working_files, sym, false)) {
if (std::optional<lsLocation> location = GetLsLocation(
db, working_files,
Use{{sym.range, sym.usr, sym.kind, sym.role}, file_id})) {
info->location = *location;
out.result.push_back(*info);
}
}
if (std::optional<lsLocation> location = GetLsLocation(
db, working_files,
Use{{sym.range, sym.usr, sym.kind, sym.role}, file_id}))
out.result.push_back({{location->range}});
pipeline::WriteStdout(kMethodType, out);
} else {
Out_TextDocumentDocumentSymbol out;
out.id = request->id;
for (SymbolRef sym : file->def->outline)
if (std::optional<lsSymbolInformation> info =
GetSymbolInfo(db, working_files, sym, false)) {
@ -69,9 +82,8 @@ struct Handler_TextDocumentDocumentSymbol
out.result.push_back(*info);
}
}
pipeline::WriteStdout(kMethodType, out);
}
pipeline::WriteStdout(kMethodType, out);
}
};
REGISTER_MESSAGE_HANDLER(Handler_TextDocumentDocumentSymbol);