debugStorage.ts ×17

Frontier kind: Code frontier

unlabeled · c_0b632b1163e4

4 tests · 31669 LOC · 156 files · introduces 0 tests · 98 LOC · 4 files

Introduces — evidence that enters the hierarchy at this concept

Code
23 ranges98 lines · 4 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
3378 ranges31669 lines · 156 files · Browse complete extent
All tests (intent)
4 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

4 files ranked by introduced lines: 98 introduced LOC across 23 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/debug/common/debugStorage.ts 55 introduced LOC · 17 ranges

Open complete file

36
37 constructor(
38 > @IStorageService private readonly storageService: IStorageService, debugStorage.ts
39 > @ITextFileService private readonly textFileService: ITextFileService,
40 > @IUriIdentityService private readonly uriIdentityService: IUriIdentityService,
41 > @ILogService private readonly logService: ILogService
42 > ) {
43 > super();
44 > this.breakpoints = observableValue(this, this.loadBreakpoints());
45 > this.functionBreakpoints = observableValue(this, this.loadFunctionBreakpoints());
46 > this.exceptionBreakpoints = observableValue(this, this.loadExceptionBreakpoints());
47 > this.dataBreakpoints = observableValue(this, this.loadDataBreakpoints());
48 > this.watchExpressions = observableValue(this, this.loadWatchExpressions());
49 >
50 > this._register(storageService.onDidChangeValue(StorageScope.WORKSPACE, undefined, this._store)(e => {
51 if (e.external) {
52 switch (e.key) {
63 }
64 }
65 > })); debugStorage.ts
66 > }
67
68 loadDebugUxState(): 'simple' | 'default' {
75
76 private loadBreakpoints(): Breakpoint[] {
77 > let result: Breakpoint[] | undefined; debugStorage.ts
78 > try {
79 > result = JSON.parse(this.storageService.get(DEBUG_BREAKPOINTS_KEY, StorageScope.WORKSPACE, '[]')).map((breakpoint: ReturnType<Breakpoint['toJSON']>) => {
80 breakpoint.uri = URI.revive(breakpoint.uri);
81 return new Breakpoint(breakpoint, this.textFileService, this.uriIdentityService, this.logService, breakpoint.id);
82 > }); debugStorage.ts
83 > } catch (e) {
84 this.logService.error('Failed to load breakpoints from storage', e);
85 }
87 > return result || [];
88 > }
89
90 private loadFunctionBreakpoints(): FunctionBreakpoint[] {
91 > let result: FunctionBreakpoint[] | undefined; debugStorage.ts
92 > try {
93 > result = JSON.parse(this.storageService.get(DEBUG_FUNCTION_BREAKPOINTS_KEY, StorageScope.WORKSPACE, '[]')).map((fb: ReturnType<FunctionBreakpoint['toJSON']>) => {
94 return new FunctionBreakpoint(fb, fb.id);
95 > }); debugStorage.ts
96 > } catch (e) {
97 this.logService.error('Failed to load function breakpoints from storage', e);
98 }
100 > return result || [];
101 > }
102
103 private loadExceptionBreakpoints(): ExceptionBreakpoint[] {
104 > let result: ExceptionBreakpoint[] | undefined; debugStorage.ts
105 > try {
106 > result = JSON.parse(this.storageService.get(DEBUG_EXCEPTION_BREAKPOINTS_KEY, StorageScope.WORKSPACE, '[]')).map((exBreakpoint: ReturnType<ExceptionBreakpoint['toJSON']>) => {
107 return new ExceptionBreakpoint(exBreakpoint, exBreakpoint.id);
108 > }); debugStorage.ts
109 > } catch (e) {
110 this.logService.error('Failed to load exception breakpoints from storage', e);
111 }
113 > return result || [];
114 > }
115
116 private loadDataBreakpoints(): DataBreakpoint[] {
117 > let result: DataBreakpoint[] | undefined; debugStorage.ts
118 > try {
119 > result = JSON.parse(this.storageService.get(DEBUG_DATA_BREAKPOINTS_KEY, StorageScope.WORKSPACE, '[]')).map((dbp: ReturnType<DataBreakpoint['toJSON']>) => {
120 return new DataBreakpoint(dbp, dbp.id);
121 > }); debugStorage.ts
122 > } catch (e) {
123 this.logService.error('Failed to load data breakpoints from storage', e);
124 }
126 > return result || [];
127 > }
128
129 private loadWatchExpressions(): Expression[] {
130 > let result: Expression[] | undefined; debugStorage.ts
131 > try {
132 > result = JSON.parse(this.storageService.get(DEBUG_WATCH_EXPRESSIONS_KEY, StorageScope.WORKSPACE, '[]')).map((watchStoredData: { name: string; id: string }) => {
133 return new Expression(watchStoredData.name, watchStoredData.id);
134 > }); debugStorage.ts
135 > } catch (e) {
136 this.logService.error('Failed to load watch expressions from storage', e);
137 }
139 > return result || [];
140 > }
141
142 loadChosenEnvironments(): Record<string, IChosenEnvironment> {
src/vs/workbench/contrib/debug/common/debugModel.ts 31 introduced LOC · 2 ranges

Open complete file

1473
1474 constructor(
1475 > debugStorage: DebugStorage, debugModel.ts
1476 > @ITextFileService private readonly textFileService: ITextFileService,
1477 > @IUriIdentityService private readonly uriIdentityService: IUriIdentityService,
1478 > @ILogService private readonly logService: ILogService
1479 > ) {
1480 > super();
1481 >
1482 > this._register(autorun(reader => {
1483 > this.breakpoints = debugStorage.breakpoints.read(reader);
1484 > this.functionBreakpoints = debugStorage.functionBreakpoints.read(reader);
1485 > this.exceptionBreakpoints = debugStorage.exceptionBreakpoints.read(reader);
1486 > this.dataBreakpoints = debugStorage.dataBreakpoints.read(reader);
1487 > this._onDidChangeBreakpoints.fire(undefined);
1488 > }));
1489 >
1490 > this._register(autorun(reader => {
1491 > this.watchExpressions = debugStorage.watchExpressions.read(reader);
1492 > this._onDidChangeWatchExpressions.fire(undefined);
1493 > }));
1494 >
1495 > this._register(trackSetChanges(
1496 > () => new Set(this.watchExpressions),
1497 > this.onDidChangeWatchExpressions,
1498 > (we) => we.onDidChangeValue((e) => this._onDidChangeWatchExpressionValue.fire(e)))
1499 > );
1500 >
1501 > this.instructionBreakpoints = [];
1502 > this.sessions = [];
1503 > }
1504
1505 getId(): string {
1579
1580 get onDidChangeWatchExpressions(): Event<IExpression | undefined> {
1581 > return this._onDidChangeWatchExpressions.event; debugModel.ts
1582 > }
1583
1584 get onDidChangeWatchExpressionValue(): Event<IExpression | undefined> {
src/vs/base/common/event.ts 10 introduced LOC · 3 ranges

Open complete file

1921 */
1922 export function trackSetChanges<T>(getData: () => ReadonlySet<T>, onDidChangeData: Event<unknown>, handleItem: (d: T) => IDisposable): IDisposable {
1923 > const map = new DisposableMap<T, IDisposable>(); event.ts
1924 > let oldData = new Set(getData());
1925 > for (const d of oldData) {
1926 map.set(d, handleItem(d));
1927 }
1928 > event.ts
1929 > const store = new DisposableStore();
1930 > store.add(onDidChangeData(() => {
1931 const newData = getData();
1932 const diff = diffSets(oldData, newData);
1938 }
1939 oldData = new Set(newData);
1940 > })); event.ts
1941 > store.add(map);
1942 > return store;
1943 > }
1944
1945
src/vs/workbench/contrib/debug/test/common/mockDebug.ts 2 introduced LOC · 1 range

Open complete file

693
694 constructor(storageService: IStorageService) {
695 > super(storageService, undefined!, undefined!, new NullLogService()); mockDebug.ts
696 > }
697 }