workspaceTrust.ts ×8
Frontier kind: Joint frontier
unlabeled · c_b47d0f083fab
1 test · 25718 LOC · 136 files · introduces 1 test · 31 LOC · 1 file
Introduces — evidence that enters the hierarchy at this concept
Code
8 ranges 31 lines · 1 files
Tests
1 test
Contains — complete concept membership
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.
Focus concept
Ancestors (broader)
Descendants (narrower)
Introduced files
Introduced tests
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.
JavaScript is disabled; use the native relationship evidence on this page to explore the same evidence.
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.
1 test introduced at this concept.
Introduced code
Every collected source range enters the hierarchy at exactly one concept.
1 file ranked by introduced lines: 31 introduced LOC across 8 ranges.
Expand a file to inspect source; the > gutter marks introduced lines.
src/vs/workbench/services/workspaces/common/workspaceTrust.ts 31 introduced LOC · 8 ranges
Open complete file
191
this . _register ( this . workspaceService . onDidChangeWorkspaceFolders ( async () => await this . updateWorkspaceTrust ()));
192
this . _register ( this . storageService . onDidChangeValue ( StorageScope . APPLICATION_SHARED , this . storageKey , this . _store )( async () => {
193
>
/* This will only execute if storage was changed by a user action in a separate window */
workspaceTrust.ts
194
>
if ( JSON . stringify ( this . _trustStateInfo ) !== JSON . stringify ( this . loadTrustInfo ())) {
195
this . _trustStateInfo = this . loadTrustInfo ();
196
this . _onDidChangeTrustedFolders . fire ();
277
278
private async saveTrustInfo () : Promise < void > {
279
>
this . storageService . store ( this . storageKey , JSON . stringify ( this . _trustStateInfo ), StorageScope . APPLICATION_SHARED , StorageTarget . MACHINE );
workspaceTrust.ts
280
>
this . _onDidChangeTrustedFolders . fire ();
281
>
282
>
await this . updateWorkspaceTrust ();
283
>
}
284
285
private getWorkspaceUris () : URI [] {
313
// Use memento if present
314
if ( this . _storedTrustState . isEmptyWorkspaceTrusted !== undefined ) {
316
>
}
317
318
// Startup files
403
404
private async doSetUrisTrust ( uris : URI [], trusted : boolean ) : Promise < void > {
406
>
407
>
for ( const uri of uris ) {
408
>
if ( trusted ) {
409
>
if ( this . isTrustedVirtualResource ( uri )) {
410
continue ;
411
}
413
>
if ( this . isTrustedByRemote ( uri )) {
414
continue ;
415
}
417
>
const foundItem = this . _trustStateInfo . uriTrustInfo . find ( trustInfo => this . uriIdentityService . extUri . isEqual ( trustInfo . uri , uri ));
418
>
if ( ! foundItem ) {
419
>
this . _trustStateInfo . uriTrustInfo . push ({ uri , trusted : true });
420
>
changed = true ;
421
>
}
422
>
} else {
423
const previousLength = this . _trustStateInfo . uriTrustInfo . length ;
424
this . _trustStateInfo . uriTrustInfo = this . _trustStateInfo . uriTrustInfo . filter ( trustInfo => ! this . uriIdentityService . extUri . isEqual ( trustInfo . uri , uri ));
427
}
428
}
430
>
431
>
if ( changed ) {
432
>
await this . saveTrustInfo ();
433
>
}
434
>
}
435
436
private isEmptyWorkspace () : boolean {
626
627
async setUrisTrust ( uris : URI [], trusted : boolean ) : Promise < void > {
628
>
this . doSetUrisTrust ( await Promise . all ( uris . map ( uri => this . getCanonicalUri ( uri ))), trusted );
workspaceTrust.ts
629
>
}
630
631
getTrustedUris () : URI [] {