@@ -423,12 +423,14 @@ class SCIPState {
423
423
424
424
private:
425
425
absl::Status saveDefinitionImpl (const core::GlobalState &gs, core::FileRef file, const string &symbolString,
426
- core::Loc occLoc) {
426
+ core::Loc occLoc, bool isLocal ) {
427
427
ENFORCE (!symbolString.empty ());
428
428
occLoc = trimColonColonPrefix (gs, occLoc);
429
- scip::SymbolInformation symbolInfo;
430
- symbolInfo.set_symbol (symbolString);
431
- this ->symbolMap [file].push_back (symbolInfo);
429
+ if (!isLocal) {
430
+ scip::SymbolInformation symbolInfo;
431
+ symbolInfo.set_symbol (symbolString);
432
+ this ->symbolMap [file].push_back (symbolInfo);
433
+ }
432
434
433
435
scip::Occurrence occurrence;
434
436
occurrence.set_symbol (symbolString);
@@ -496,7 +498,8 @@ class SCIPState {
496
498
if (this ->cacheOccurrence (gs, file, occ, scip::SymbolRole::Definition)) {
497
499
return absl::OkStatus ();
498
500
}
499
- return this ->saveDefinitionImpl (gs, file, occ.toString (gs, file), core::Loc (file, occ.offsets ));
501
+ return this ->saveDefinitionImpl (gs, file, occ.toString (gs, file), core::Loc (file, occ.offsets ),
502
+ /* isLocal*/ true );
500
503
}
501
504
502
505
// Save definition when you have a sorbet Symbol.
@@ -518,7 +521,7 @@ class SCIPState {
518
521
519
522
auto occLoc = loc.has_value () ? core::Loc (file, loc.value ()) : symRef.symbolLoc (gs);
520
523
521
- return this ->saveDefinitionImpl (gs, file, symbolString, occLoc);
524
+ return this ->saveDefinitionImpl (gs, file, symbolString, occLoc, /* isLocal */ false );
522
525
}
523
526
524
527
absl::Status saveReference (const core::GlobalState &gs, core::FileRef file, OwnedLocal occ, int32_t symbol_roles) {
0 commit comments