75
76
private loadBreakpoints(): Breakpoint[] {
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);
83
>
} catch (e) {
84
this.logService.error('Failed to load breakpoints from storage', e);
85
}
87
>
return result || [];
88
>
}
89
90
private loadFunctionBreakpoints(): FunctionBreakpoint[] {
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);
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[] {
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);
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[] {
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);
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[] {
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);
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> {