From 019431a5ddf7be4d841ed614bd70697bf285fec4 Mon Sep 17 00:00:00 2001 From: Varun Gandhi Date: Fri, 5 Aug 2022 21:53:25 +0800 Subject: [PATCH] cleanup: Simplify return type of saveReferenceImpl. --- scip_indexer/SCIPIndexer.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/scip_indexer/SCIPIndexer.cc b/scip_indexer/SCIPIndexer.cc index b30d6f0cd4..ecaec685f6 100644 --- a/scip_indexer/SCIPIndexer.cc +++ b/scip_indexer/SCIPIndexer.cc @@ -553,9 +553,8 @@ class SCIPState { return absl::OkStatus(); } - absl::Status saveReferenceImpl(const core::GlobalState &gs, core::FileRef file, const string &symbolString, - const vector &overrideDocs, core::LocOffsets occLocOffsets, - int32_t symbol_roles) { + void saveReferenceImpl(const core::GlobalState &gs, core::FileRef file, const string &symbolString, + const vector &overrideDocs, core::LocOffsets occLocOffsets, int32_t symbol_roles) { ENFORCE(!symbolString.empty()); auto occLoc = trimColonColonPrefix(gs, core::Loc(file, occLocOffsets)); scip::Occurrence occurrence; @@ -569,7 +568,6 @@ class SCIPState { } this->occurrenceMap[file].push_back(occurrence); // TODO(varun): When should we fill out the diagnostics field? - return absl::OkStatus(); } // Returns true if there was a cache hit. @@ -657,7 +655,8 @@ class SCIPState { ENFORCE(var.has_value(), "Failed to find source text for definition of local variable"); overrideDocs.push_back(fmt::format("```ruby\n{} = T.let(_, {})\n```", var.value(), overrideType->show(gs))); } - return this->saveReferenceImpl(gs, file, occ.toString(gs, file), overrideDocs, occ.offsets, symbol_roles); + this->saveReferenceImpl(gs, file, occ.toString(gs, file), overrideDocs, occ.offsets, symbol_roles); + return absl::OkStatus(); } absl::Status saveReference(const core::GlobalState &gs, core::FileRef file, NamedSymbolRef symRef, @@ -681,8 +680,8 @@ class SCIPState { overrideDocs = symRef.docStrings(gs, overrideType.value(), core::Loc(file, occLoc)); } } - - return this->saveReferenceImpl(gs, file, symbolString, overrideDocs, occLoc, symbol_roles); + this->saveReferenceImpl(gs, file, symbolString, overrideDocs, occLoc, symbol_roles); + return absl::OkStatus(); } void saveDocument(const core::GlobalState &gs, const core::FileRef file) {