Workspace trust - update proposed APIs (#291408)

Workspace trust - add proposed API to check whether a URI is trusted and an event for when the list of trusted folders/workspaces change
This commit is contained in:
Ladislau Szomoru
2026-01-29 05:06:58 +01:00
committed by GitHub
parent c6c601febd
commit 748751e9f5
5 changed files with 43 additions and 0 deletions

View File

@@ -1271,6 +1271,14 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
checkProposedApiEnabled(extension, 'workspaceTrust');
return extHostWorkspace.requestWorkspaceTrust(options);
},
isResourceTrusted: (resource: vscode.Uri) => {
checkProposedApiEnabled(extension, 'workspaceTrust');
return extHostWorkspace.isResourceTrusted(resource);
},
onDidChangeWorkspaceTrustedFolders: (listener, thisArgs?, disposables?) => {
checkProposedApiEnabled(extension, 'workspaceTrust');
return _asExtensionEvent(extHostWorkspace.onDidChangeWorkspaceTrustedFolders)(listener, thisArgs, disposables);
},
onDidGrantWorkspaceTrust: (listener, thisArgs?, disposables?) => {
return _asExtensionEvent(extHostWorkspace.onDidGrantWorkspaceTrust)(listener, thisArgs, disposables);
},