Skip to content

Commit 1c7073d

Browse files
Revert "fix: Don't emit SymbolInformation for local defs. (#32)"
This reverts commit ab00072.
1 parent 39514fa commit 1c7073d

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

scip_indexer/SCIPIndexer.cc

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -423,14 +423,12 @@ class SCIPState {
423423

424424
private:
425425
absl::Status saveDefinitionImpl(const core::GlobalState &gs, core::FileRef file, const string &symbolString,
426-
core::Loc occLoc, bool isLocal) {
426+
core::Loc occLoc) {
427427
ENFORCE(!symbolString.empty());
428428
occLoc = trimColonColonPrefix(gs, occLoc);
429-
if (!isLocal) {
430-
scip::SymbolInformation symbolInfo;
431-
symbolInfo.set_symbol(symbolString);
432-
this->symbolMap[file].push_back(symbolInfo);
433-
}
429+
scip::SymbolInformation symbolInfo;
430+
symbolInfo.set_symbol(symbolString);
431+
this->symbolMap[file].push_back(symbolInfo);
434432

435433
scip::Occurrence occurrence;
436434
occurrence.set_symbol(symbolString);
@@ -498,8 +496,7 @@ class SCIPState {
498496
if (this->cacheOccurrence(gs, file, occ, scip::SymbolRole::Definition)) {
499497
return absl::OkStatus();
500498
}
501-
return this->saveDefinitionImpl(gs, file, occ.toString(gs, file), core::Loc(file, occ.offsets),
502-
/*isLocal*/ true);
499+
return this->saveDefinitionImpl(gs, file, occ.toString(gs, file), core::Loc(file, occ.offsets));
503500
}
504501

505502
// Save definition when you have a sorbet Symbol.
@@ -521,7 +518,7 @@ class SCIPState {
521518

522519
auto occLoc = loc.has_value() ? core::Loc(file, loc.value()) : symRef.symbolLoc(gs);
523520

524-
return this->saveDefinitionImpl(gs, file, symbolString, occLoc, /*isLocal*/ false);
521+
return this->saveDefinitionImpl(gs, file, symbolString, occLoc);
525522
}
526523

527524
absl::Status saveReference(const core::GlobalState &gs, core::FileRef file, OwnedLocal occ, int32_t symbol_roles) {

0 commit comments

Comments
 (0)