private VariablesMessageResult DoGetVariablesByScope(Scope scope) { EnsureIsCurrentScope(scope); IDebugSymbolGroup2 group; IDebugSymbolGroup2 oldGroup = State.GetSymbolsForScope(scope.Id); uint oldItemsCount = 0; if (oldGroup != null) { oldGroup.GetNumberSymbols(out oldItemsCount); } var hr = _symbols.GetScopeSymbolGroup2(Scopes.GetScopeByName(scope.Name), oldGroup, out group); if (hr != HResult.Ok) { return(new VariablesMessageResult(Enumerable.Empty <Variable>())); } State.UpdateSymbolGroup(scope.Id, group); uint newItemsCount = 0; group.GetNumberSymbols(out newItemsCount); if (oldItemsCount == newItemsCount) { return(new VariablesMessageResult(State.GetVariablesByScope(scope.Id))); } var result = DoGetVariablesFromSymbols(group, 0, Defaults.NoParent, scope.Id); return(new VariablesMessageResult(result)); }