src/vs/workbench/contrib/debug/common/debugModel.ts/StackFrame/getScopes
class StackFrame:	getScopes(): Promise<IScope[]> {
		if (!this.scopes) {
			this.scopes = this.thread.session.scopes(this.frameId, this.thread.threadId).then(response => {
				if (!response || !response.body || !response.body.scopes) {
					return [];
				}

				const scopeNameIndexes = new Map<string, number>();
				return response.body.scopes.map(rs => {
					const previousIndex = scopeNameIndexes.get(rs.name);
					const index = typeof previousIndex === 'number' ? previousIndex + 1 : 0;
					scopeNameIndexes.set(rs.name, index);
					return new Scope(this, index, rs.name, rs.variablesReference, rs.expensive, rs.namedVariables, rs.indexedVariables,
						rs.line && rs.column && rs.endLine && rs.endColumn ? new Range(rs.line, rs.column, rs.endLine, rs.endColumn) : undefined);

				});
			}, err => [new ErrorScope(this, 0, err.message)]);
		}

		return this.scopes;
	}