src/vs/workbench/api/common/extHostExtensionActivator.ts

454 LOC · 385 covered · 69 uncovered · 93 ranges · 63 concepts · 21 introducers · 42 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

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 related-file, concept, and source links on this page.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the filesrc/vs/workbench/services/extensions/common/extensionDescriptionRegistry.ts · 423 LOCcommon/extensionDescript…extHostMcp.test|title=ExtHostMcp IAuthMetadata properties should expose readonly properties|occurrence=1, extHostMcp.test|title=ExtHostMcp createAuthMetadata should create IAuthMetadata with fetched server metadata|occurrence=1 · 0 introduced LOCextHostMcp.test|title=Ex…extHostMcp.ts ×1 · 3 introduced LOCextHostMcp.ts ×1extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should handle multiple Bearer challenges and use first scope|occurrence=1 · 0 introduced LOCextHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should return false when scopes are the same|occurrence=1 · 0 introduced LOCextHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should return true and update scopes when WWW-Authenticate header contains new scopes|occurrence=1 · 0 introduced LOCextHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should return false when scopes are same but in different order|occurrence=1 · 0 introduced LOCextHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should return true when updating from defined scopes to undefined (no scope in header)|occurrence=1 · 0 introduced LOCextHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp createAuthMetadata should handle non-401 status codes in update()|occurrence=1 · 0 introduced LOCextHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should ignore non-Bearer schemes|occurrence=1 · 0 introduced LOCextHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should return true when updating from undefined scopes to defined scopes|occurrence=1 · 0 introduced LOCextHostMcp.test|title=Ex…extHostMcp.ts ×1 · 1 introduced LOCextHostMcp.ts ×1extHostMcp.ts ×1 · 2 introduced LOCextHostMcp.ts ×1extHostMcp.ts ×1 · 6 introduced LOCextHostMcp.ts ×1extHostMcp.ts ×1 · 4 introduced LOCextHostMcp.ts ×1extHostMcp.ts ×2 · 4 introduced LOCextHostMcp.ts ×2extHostMcp.ts ×1 · 1 introduced LOCextHostMcp.ts ×1extHostMcp.test|title=ExtHostMcp createAuthMetadata should fall back to default metadata when server metadata fetch fails|occurrence=1 · 0 introduced LOCextHostMcp.test|title=Ex…extHostMcp.ts ×4 · 6 introduced LOCextHostMcp.ts ×4extHostMcp.test|title=ExtHostMcp createAuthMetadata should use scopes from WWW-Authenticate header when resource metadata has none|occurrence=1, extHostMcp.test|title=ExtHostMcp createAuthMetadata should use scopes from WWW-Authenticate header even when resource metadata has scopes_supported|occurrence=1 · 0 introduced LOCextHostMcp.test|title=Ex…extHostMcp.ts ×1 · 2 introduced LOCextHostMcp.ts ×1extHostMcp.ts ×1 · 6 introduced LOCextHostMcp.ts ×1extHostMcp.ts ×4 · 13 introduced LOCextHostMcp.ts ×4extHostMcpNode.ts ×8 · 45 introduced LOCextHostMcpNode.ts ×8extHostMcp.test|title=ExtHostMcp createAuthMetadata should pass launch headers when fetching metadata from same origin|occurrence=1 · 0 introduced LOCextHostMcp.test|title=Ex…extHostMcp.ts ×5 · 25 introduced LOCextHostMcp.ts ×5extHostMcp.test|title=ExtHostMcp createAuthMetadata should handle invalid JSON in resource metadata response|occurrence=1 · 0 introduced LOCextHostMcp.test|title=Ex…extHostMcp.ts ×3 · 23 introduced LOCextHostMcp.ts ×3extHostMcp.ts ×1 · 2 introduced LOCextHostMcp.ts ×1extHostMcp.ts ×8 · 60 introduced LOCextHostMcp.ts ×8extHostMcp.ts ×43 · 874 introduced LOCextHostMcp.ts ×43extensionHostMain.ts ×1 · 2 introduced LOCextensionHostMain.ts ×1reset prepareStackTrace-callback|occurrence=1, extensionHostMain.test|title=ExtensionHostMain#ErrorHandler - Wrapping prepareStackTrace can cause slowdown and eventual stack overflow #184926 prevent rewrapping|occurrence=1 · 0 introduced LOCreset prepareStackTrace-…extensionHostMain.ts ×5 · 26 introduced LOCextensionHostMain.ts ×5f0f2e182082072efdaf0f8e1537d2cce Restored, too many uses before restoration|occurrence=1 · 0 introduced LOCf0f2e182082072efdaf0f8e1…extensionHostMain.ts ×1 · 3 introduced LOCextensionHostMain.ts ×1extensionHostMain.ts ×1 · 3 introduced LOCextensionHostMain.ts ×1extensionHostMain.ts ×11 · 164 introduced LOCextensionHostMain.ts ×11extHostExtensionService.ts ×64 · 1246 introduced LOCextHostExtensionService.…extHostExtensionActivator.test|title=ExtensionsActivator activates dependencies first|occurrence=1 · 0 introduced LOCextHostExtensionActivato…extHostExtensionActivator.ts ×2 · 9 introduced LOCextHostExtensionActivato…extHostExtensionActivator.test|title=ExtensionsActivator issue #144518: Problem with git extension and vscode-icons|occurrence=1 · 0 introduced LOCextHostExtensionActivato…extHostExtensionActivator.ts ×1 · 5 introduced LOCextHostExtensionActivato…extHostExtensionActivator.ts ×5 · 31 introduced LOCextHostExtensionActivato…extHostExtensionActivator.ts ×2 · 9 introduced LOCextHostExtensionActivato…extHostExtensionActivator.ts ×3 · 14 introduced LOCextHostExtensionActivato…extHostExtensionActivator.ts ×1 · 3 introduced LOCextHostExtensionActivato…extHostExtensionActivator.ts ×1 · 1 introduced LOCextHostExtensionActivato…extHostExtensionActivator.ts ×3 · 9 introduced LOCextHostExtensionActivato…extHostExtensionActivator.ts ×1 · 2 introduced LOCextHostExtensionActivato…extHostExtensionActivator.test|title=ExtensionsActivator calls activate only once with parallel activations|occurrence=1 · 0 introduced LOCextHostExtensionActivato…extHostExtensionActivator.ts ×1 · 3 introduced LOCextHostExtensionActivato…extHostExtensionActivator.ts ×1 · 2 introduced LOCextHostExtensionActivato…extHostExtensionActivator.ts ×1 · 2 introduced LOCextHostExtensionActivato…extHostExtensionActivator.ts ×2 · 5 introduced LOCextHostExtensionActivato…extHostExtensionActivator.ts ×1 · 2 introduced LOCextHostExtensionActivato…extHostExtensionActivator.ts ×4 · 14 introduced LOCextHostExtensionActivato…extHostExtensionActivator.ts ×5 · 10 introduced LOCextHostExtensionActivato…extHostExtensionActivator.ts ×1 · 2 introduced LOCextHostExtensionActivato…extHostExtensionActivator.ts ×20 · 71 introduced LOCextHostExtensionActivato…extHostExtensionActivator.ts ×2 · 5 introduced LOCextHostExtensionActivato…extensionDescriptionRegistry.ts ×4 · 10 introduced LOCextensionDescriptionRegi…extHostExtensionActivator.ts ×3 · 16 introduced LOCextHostExtensionActivato…extHostExtensionActivator.ts ×33 · 176 introduced LOCextHostExtensionActivato…extHostExtensionActivator.test|title=ExtensionsActivator Error: activateById with missing extension|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostExtensionActivator.test|title=ExtensionsActivator Error: activateById with missing extension|occurrence=1extHostExtensionActivato…extHostExtensionActivator.test|title=ExtensionsActivator Error: dependency activation failed|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostExtensionActivator.test|title=ExtensionsActivator Error: dependency activation failed|occurrence=1extHostExtensionActivato…extHostExtensionActivator.test|title=ExtensionsActivator Error: dependency missing|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostExtensionActivator.test|title=ExtensionsActivator Error: dependency missing|occurrence=1extHostExtensionActivato…extHostExtensionActivator.test|title=ExtensionsActivator Supports having external extensions|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostExtensionActivator.test|title=ExtensionsActivator Supports having external extensions|occurrence=1extHostExtensionActivato…extHostExtensionActivator.test|title=ExtensionsActivator Supports having resolved extensions|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostExtensionActivator.test|title=ExtensionsActivator Supports having resolved extensions|occurrence=1extHostExtensionActivato…extHostExtensionActivator.test|title=ExtensionsActivator activates dependencies first|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostExtensionActivator.test|title=ExtensionsActivator activates dependencies first|occurrence=1extHostExtensionActivato…extHostExtensionActivator.test|title=ExtensionsActivator calls activate only once with parallel activations|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostExtensionActivator.test|title=ExtensionsActivator calls activate only once with parallel activations|occurrence=1extHostExtensionActivato…extHostExtensionActivator.test|title=ExtensionsActivator calls activate only once with sequential activations|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostExtensionActivator.test|title=ExtensionsActivator calls activate only once with sequential activations|occurrence=1extHostExtensionActivato…extHostExtensionActivator.test|title=ExtensionsActivator issue #144518: Problem with git extension and vscode-icons|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostExtensionActivator.test|title=ExtensionsActivator issue #144518: Problem with git extension and vscode-icons|occurrence=1extHostExtensionActivato…extHostMcp.test|title=ExtHostMcp IAuthMetadata properties should allow undefined scopes|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostMcp.test|title=ExtHostMcp IAuthMetadata properties should allow undefined scopes|occurrence=1extHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp IAuthMetadata properties should expose readonly properties|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostMcp.test|title=ExtHostMcp IAuthMetadata properties should expose readonly properties|occurrence=1extHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should handle multiple Bearer challenges and use first scope|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should handle multiple Bearer challenges and use first scope|occurrence=1extHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should ignore non-Bearer schemes|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should ignore non-Bearer schemes|occurrence=1extHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should return false when no WWW-Authenticate header and scopes are already undefined|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should return false when no WWW-Authenticate header and scopes are already undefined|occurrence=1extHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should return false when scopes are same but in different order|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should return false when scopes are same but in different order|occurrence=1extHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should return false when scopes are the same|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should return false when scopes are the same|occurrence=1extHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should return true and update scopes when WWW-Authenticate header contains new scopes|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should return true and update scopes when WWW-Authenticate header contains new scopes|occurrence=1extHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should return true when updating from defined scopes to undefined (no scope in header)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should return true when updating from defined scopes to undefined (no scope in header)|occurrence=1extHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should return true when updating from undefined scopes to defined scopes|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostMcp.test|title=ExtHostMcp IAuthMetadata update() should return true when updating from undefined scopes to defined scopes|occurrence=1extHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp createAuthMetadata should create IAuthMetadata with fetched server metadata|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostMcp.test|title=ExtHostMcp createAuthMetadata should create IAuthMetadata with fetched server metadata|occurrence=1extHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp createAuthMetadata should fall back to default metadata when server metadata fetch fails|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostMcp.test|title=ExtHostMcp createAuthMetadata should fall back to default metadata when server metadata fetch fails|occurrence=1extHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp createAuthMetadata should handle empty scope string in WWW-Authenticate header|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostMcp.test|title=ExtHostMcp createAuthMetadata should handle empty scope string in WWW-Authenticate header|occurrence=1extHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp createAuthMetadata should handle invalid JSON in resource metadata response|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostMcp.test|title=ExtHostMcp createAuthMetadata should handle invalid JSON in resource metadata response|occurrence=1extHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp createAuthMetadata should handle malformed WWW-Authenticate header gracefully|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostMcp.test|title=ExtHostMcp createAuthMetadata should handle malformed WWW-Authenticate header gracefully|occurrence=1extHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp createAuthMetadata should handle non-401 status codes in update()|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostMcp.test|title=ExtHostMcp createAuthMetadata should handle non-401 status codes in update()|occurrence=1extHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp createAuthMetadata should pass launch headers when fetching metadata from same origin|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostMcp.test|title=ExtHostMcp createAuthMetadata should pass launch headers when fetching metadata from same origin|occurrence=1extHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp createAuthMetadata should use resource_metadata challenge URL from WWW-Authenticate header|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostMcp.test|title=ExtHostMcp createAuthMetadata should use resource_metadata challenge URL from WWW-Authenticate header|occurrence=1extHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp createAuthMetadata should use scopes from WWW-Authenticate header even when resource metadata has scopes_supported|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostMcp.test|title=ExtHostMcp createAuthMetadata should use scopes from WWW-Authenticate header even when resource metadata has scopes_supported|occurrence=1extHostMcp.test|title=Ex…extHostMcp.test|title=ExtHostMcp createAuthMetadata should use scopes from WWW-Authenticate header when resource metadata has none|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extHostMcp.test|title=ExtHostMcp createAuthMetadata should use scopes from WWW-Authenticate header when resource metadata has none|occurrence=1extHostMcp.test|title=Ex…extensionHostMain.test|title=ExtensionHostMain#ErrorHandler - Wrapping prepareStackTrace can cause slowdown and eventual stack overflow #184926 basics|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extensionHostMain.test|title=ExtensionHostMain#ErrorHandler - Wrapping prepareStackTrace can cause slowdown and eventual stack overflow #184926 basics|occurrence=1extensionHostMain.test|t…f0f2e182082072efdaf0f8e1537d2cce Never restored, separate operations|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extensionHostMain.test|title=ExtensionHostMain#ErrorHandler - Wrapping prepareStackTrace can cause slowdown and eventual stack overflow #184926 https://gist.github.com/thecrypticace/f0f2e182082072efdaf0f8e1537d2cce Never restored, separate operations|occurrence=1f0f2e182082072efdaf0f8e1…f0f2e182082072efdaf0f8e1537d2cce Restored, separate operations|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extensionHostMain.test|title=ExtensionHostMain#ErrorHandler - Wrapping prepareStackTrace can cause slowdown and eventual stack overflow #184926 https://gist.github.com/thecrypticace/f0f2e182082072efdaf0f8e1537d2cce Restored, separate operations|occurrence=1f0f2e182082072efdaf0f8e1…f0f2e182082072efdaf0f8e1537d2cce Restored, too many uses before restoration|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extensionHostMain.test|title=ExtensionHostMain#ErrorHandler - Wrapping prepareStackTrace can cause slowdown and eventual stack overflow #184926 https://gist.github.com/thecrypticace/f0f2e182082072efdaf0f8e1537d2cce Restored, too many uses before restoration|occurrence=1f0f2e182082072efdaf0f8e1…extensionHostMain.test|title=ExtensionHostMain#ErrorHandler - Wrapping prepareStackTrace can cause slowdown and eventual stack overflow #184926 prevent rewrapping|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extensionHostMain.test|title=ExtensionHostMain#ErrorHandler - Wrapping prepareStackTrace can cause slowdown and eventual stack overflow #184926 prevent rewrapping|occurrence=1extensionHostMain.test|t…reset prepareStackTrace-callback|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extensionHostMain.test|title=ExtensionHostMain#ErrorHandler - Wrapping prepareStackTrace can cause slowdown and eventual stack overflow #184926 set/reset prepareStackTrace-callback|occurrence=1reset prepareStackTrace-…extensionHostMain.test|title=ExtensionHostMain#ErrorHandler - Wrapping prepareStackTrace can cause slowdown and eventual stack overflow #184926 wrap prepareStackTrace-callback|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/common/extensionHostMain.test|title=ExtensionHostMain#ErrorHandler - Wrapping prepareStackTrace can cause slowdown and eventual stack overflow #184926 wrap prepareStackTrace-callback|occurrence=1extensionHostMain.test|t…extHostMcpNode.test|title=extHostMcpNode - escapeCmdArg does not add stray ^ to argument values|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/node/extHostMcpNode.test|title=extHostMcpNode - escapeCmdArg does not add stray ^ to argument values|occurrence=1extHostMcpNode.test|titl…extHostMcpNode.test|title=extHostMcpNode - escapeCmdArg doubles embedded double quotes (cmd.exe convention)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/node/extHostMcpNode.test|title=extHostMcpNode - escapeCmdArg doubles embedded double quotes (cmd.exe convention)|occurrence=1extHostMcpNode.test|titl…extHostMcpNode.test|title=extHostMcpNode - escapeCmdArg neutralizes cmd.exe metacharacters inside quotes (CVE-2024-27980)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/node/extHostMcpNode.test|title=extHostMcpNode - escapeCmdArg neutralizes cmd.exe metacharacters inside quotes (CVE-2024-27980)|occurrence=1extHostMcpNode.test|titl…extHostMcpNode.test|title=extHostMcpNode - escapeCmdArg preserves paths with parentheses without injecting ^|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/node/extHostMcpNode.test|title=extHostMcpNode - escapeCmdArg preserves paths with parentheses without injecting ^|occurrence=1extHostMcpNode.test|titl…extHostMcpNode.test|title=extHostMcpNode - escapeCmdArg preserves paths with spaces|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/node/extHostMcpNode.test|title=extHostMcpNode - escapeCmdArg preserves paths with spaces|occurrence=1extHostMcpNode.test|titl…extHostMcpNode.test|title=extHostMcpNode - escapeCmdArg wraps simple values in double quotes|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/node/extHostMcpNode.test|title=extHostMcpNode - escapeCmdArg wraps simple values in double quotes|occurrence=1extHostMcpNode.test|titl…Focused file · src/vs/workbench/api/common/extHostExtensionActivator.ts · 454 LOCcommon/extHostExtensionA…

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 > /*--------------------------------------------------------------------------------------------- extHostExtensionActivator.ts ×33
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import type * as vscode from 'vscode';
7 > import * as errors from '../../../base/common/errors.js';
8 > import { Disposable, IDisposable } from '../../../base/common/lifecycle.js';
9 > import { ExtensionDescriptionRegistry } from '../../services/extensions/common/extensionDescriptionRegistry.js';
10 > import { ExtensionIdentifier, ExtensionIdentifierMap } from '../../../platform/extensions/common/extensions.js';
11 > import { ExtensionActivationReason, MissingExtensionDependency } from '../../services/extensions/common/extensions.js';
12 > import { ILogService } from '../../../platform/log/common/log.js';
13 > import { Barrier } from '../../../base/common/async.js';
14 >
15 > /**
16 > * Represents the source code (module) of an extension.
17 > */
18 > export interface IExtensionModule {
19 > activate?(ctx: vscode.ExtensionContext): Promise<IExtensionAPI>;
20 > deactivate?(): void;
21 > }
22 >
23 > /**
24 > * Represents the API of an extension (return value of `activate`).
25 > */
26 > export interface IExtensionAPI {
27 > // _extensionAPIBrand: any;
28 > }
29 >
30 > export type ExtensionActivationTimesFragment = {
31 > startup?: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'Activation occurred during startup' };
32 > codeLoadingTime?: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'Time it took to load the extension\'s code' };
33 > activateCallTime?: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'Time it took to call activate' };
34 > activateResolvedTime?: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'Time it took for async-activation to finish' };
35 > };
36 >
37 > export class ExtensionActivationTimes {
38 >
39 > public static readonly NONE = new ExtensionActivationTimes(false, -1, -1, -1);
40 >
41 > public readonly startup: boolean;
42 > public readonly codeLoadingTime: number;
43 > public readonly activateCallTime: number;
44 > public readonly activateResolvedTime: number;
45 >
46 > constructor(startup: boolean, codeLoadingTime: number, activateCallTime: number, activateResolvedTime: number) {
47 > this.startup = startup;
48 > this.codeLoadingTime = codeLoadingTime;
49 > this.activateCallTime = activateCallTime;
50 > this.activateResolvedTime = activateResolvedTime;
51 > }
52 > }
53 >
54 > export class ExtensionActivationTimesBuilder {
55 >
56 > private readonly _startup: boolean;
57 > private _codeLoadingStart: number;
58 > private _codeLoadingStop: number;
59 > private _activateCallStart: number;
60 > private _activateCallStop: number;
61 > private _activateResolveStart: number;
62 > private _activateResolveStop: number;
63 >
64 > constructor(startup: boolean) {
65 this._startup = startup;
66 this._codeLoadingStart = -1;
67 this._codeLoadingStop = -1;
68 this._activateCallStart = -1;
69 this._activateCallStop = -1;
70 this._activateResolveStart = -1;
71 this._activateResolveStop = -1;
72 }
74 > private _delta(start: number, stop: number): number {
75 if (start === -1 || stop === -1) {
76 return -1;
77 }
78 return stop - start;
79 }
81 > public build(): ExtensionActivationTimes {
82 return new ExtensionActivationTimes(
83 this._startup,
84 this._delta(this._codeLoadingStart, this._codeLoadingStop),
85 this._delta(this._activateCallStart, this._activateCallStop),
86 this._delta(this._activateResolveStart, this._activateResolveStop)
87 );
88 }
90 > public codeLoadingStart(): void {
91 this._codeLoadingStart = Date.now();
92 }
94 > public codeLoadingStop(): void {
95 this._codeLoadingStop = Date.now();
96 }
98 > public activateCallStart(): void {
99 this._activateCallStart = Date.now();
100 }
102 > public activateCallStop(): void {
103 this._activateCallStop = Date.now();
104 }
106 > public activateResolveStart(): void {
107 this._activateResolveStart = Date.now();
108 }
110 > public activateResolveStop(): void {
111 this._activateResolveStop = Date.now();
112 }
114 >
115 > export class ActivatedExtension {
116 >
117 > public readonly activationFailed: boolean;
118 > public readonly activationFailedError: Error | null;
119 > public readonly activationTimes: ExtensionActivationTimes;
120 > public readonly module: IExtensionModule;
121 > public readonly exports: IExtensionAPI | undefined;
122 > public readonly disposable: IDisposable;
123 >
124 > constructor(
125 > activationFailed: boolean, extHostExtensionActivator.ts ×20
126 > activationFailedError: Error | null,
127 > activationTimes: ExtensionActivationTimes,
128 > module: IExtensionModule,
129 > exports: IExtensionAPI | undefined,
130 > disposable: IDisposable
131 > ) {
132 > this.activationFailed = activationFailed;
133 > this.activationFailedError = activationFailedError;
134 > this.activationTimes = activationTimes;
135 > this.module = module;
136 > this.exports = exports;
137 > this.disposable = disposable;
138 > }
140 >
141 > export class EmptyExtension extends ActivatedExtension {
142 > constructor(activationTimes: ExtensionActivationTimes) {
143 > super(false, null, activationTimes, { activate: undefined, deactivate: undefined }, undefined, Disposable.None); extHostExtensionActivator.ts ×1
144 > }
146 >
147 > export class HostExtension extends ActivatedExtension {
148 > constructor() {
149 super(false, null, ExtensionActivationTimes.NONE, { activate: undefined, deactivate: undefined }, undefined, Disposable.None);
150 }
152 >
153 > class FailedExtension extends ActivatedExtension {
154 > constructor(activationError: Error) {
155 > super(true, activationError, ExtensionActivationTimes.NONE, { activate: undefined, deactivate: undefined }, undefined, Disposable.None); extHostExtensionActivator.ts ×1
156 > }
158 >
159 > export interface IExtensionsActivatorHost {
160 > onExtensionActivationError(extensionId: ExtensionIdentifier, error: Error | null, missingExtensionDependency: MissingExtensionDependency | null): void;
161 > actualActivateExtension(extensionId: ExtensionIdentifier, reason: ExtensionActivationReason): Promise<ActivatedExtension>;
162 > }
163 >
164 > type ActivationIdAndReason = { id: ExtensionIdentifier; reason: ExtensionActivationReason };
165 >
166 > export class ExtensionsActivator implements IDisposable {
167 >
168 > private readonly _registry: ExtensionDescriptionRegistry;
169 > private readonly _globalRegistry: ExtensionDescriptionRegistry;
170 > private readonly _host: IExtensionsActivatorHost;
171 > private readonly _operations: ExtensionIdentifierMap<ActivationOperation>;
172 > /**
173 > * A map of already activated events to speed things up if the same activation event is triggered multiple times.
174 > */
175 > private readonly _alreadyActivatedEvents: { [activationEvent: string]: boolean };
176 >
177 > constructor(
178 > registry: ExtensionDescriptionRegistry, extHostExtensionActivator.ts ×3
179 > globalRegistry: ExtensionDescriptionRegistry,
180 > host: IExtensionsActivatorHost,
181 > @ILogService private readonly _logService: ILogService
182 > ) {
183 > this._registry = registry;
184 > this._globalRegistry = globalRegistry;
185 > this._host = host;
186 > this._operations = new ExtensionIdentifierMap<ActivationOperation>();
187 > this._alreadyActivatedEvents = Object.create(null);
188 > }
190 > public dispose(): void {
191 > for (const [_, op] of this._operations) { extHostExtensionActivator.ts ×3
192 > op.dispose(); extHostExtensionActivator.ts ×20
193 > }
196 > public async waitForActivatingExtensions(): Promise<void> {
197 const res: Promise<boolean>[] = [];
198 for (const [_, op] of this._operations) {
199 res.push(op.wait());
200 }
201 await Promise.all(res);
202 }
204 > public isActivated(extensionId: ExtensionIdentifier): boolean {
205 > const op = this._operations.get(extensionId); extHostExtensionActivator.ts ×20
206 > return Boolean(op && op.value);
207 > }
209 > public getActivatedExtension(extensionId: ExtensionIdentifier): ActivatedExtension {
210 const op = this._operations.get(extensionId);
211 if (!op || !op.value) {
212 throw new Error(`Extension '${extensionId.value}' is not known or not activated`);
213 }
214 return op.value;
215 }
217 > public async activateByEvent(activationEvent: string, startup: boolean): Promise<void> {
218 > if (this._alreadyActivatedEvents[activationEvent]) { extHostExtensionActivator.ts ×20
220 > }
222 > const activateExtensions = this._registry.getExtensionDescriptionsForActivationEvent(activationEvent);
223 > await this._activateExtensions(activateExtensions.map(e => ({
224 > id: e.identifier,
225 > reason: { startup, extensionId: e.identifier, activationEvent }
226 > })));
228 > this._alreadyActivatedEvents[activationEvent] = true;
231 > public activateById(extensionId: ExtensionIdentifier, reason: ExtensionActivationReason): Promise<void> {
232 > const desc = this._registry.getExtensionDescription(extensionId); extHostExtensionActivator.ts ×2
233 > if (!desc) {
234 > throw new Error(`Extension '${extensionId.value}' is not known`);
235 > }
236 return this._activateExtensions([{ id: desc.identifier, reason }]);
239 > private async _activateExtensions(extensions: ActivationIdAndReason[]): Promise<void> {
240 > const operations = extensions extHostExtensionActivator.ts ×20
241 > .filter((p) => !this.isActivated(p.id))
242 > .map(ext => this._handleActivationRequest(ext));
243 > await Promise.all(operations.map(op => op.wait()));
244 > }
246 > /**
247 > * Handle semantics related to dependencies for `currentExtension`.
248 > * We don't need to worry about dependency loops because they are handled by the registry.
249 > */
250 > private _handleActivationRequest(currentActivation: ActivationIdAndReason): ActivationOperation {
251 > if (this._operations.has(currentActivation.id)) { extHostExtensionActivator.ts ×20
252 > return this._operations.get(currentActivation.id)!; extHostExtensionActivator.ts ×1
253 > }
255 > if (this._isHostExtension(currentActivation.id)) {
256 > return this._createAndSaveOperation(currentActivation, null, [], null); extHostExtensionActivator.ts ×2
257 > }
259 > const currentExtension = this._registry.getExtensionDescription(currentActivation.id);
260 > if (!currentExtension) {
261 // Error condition 0: unknown extension
262 const error = new Error(`Cannot activate unknown extension '${currentActivation.id.value}'`);
263 const result = this._createAndSaveOperation(currentActivation, null, [], new FailedExtension(error));
264 this._host.onExtensionActivationError(
265 currentActivation.id,
266 error,
267 new MissingExtensionDependency(currentActivation.id.value)
268 );
269 return result;
270 }
272 > const deps: ActivationOperation[] = [];
273 > const depIds = (typeof currentExtension.extensionDependencies === 'undefined' ? [] : currentExtension.extensionDependencies);
274 > for (const depId of depIds) {
276 > if (this._isResolvedExtension(depId)) {
277 > // This dependency is already resolved extHostExtensionActivator.ts ×1
278 > continue;
279 > }
281 > const dep = this._operations.get(depId);
282 > if (dep) {
283 deps.push(dep);
284 continue;
285 }
287 > if (this._isHostExtension(depId)) {
288 > // must first wait for the dependency to activate extHostExtensionActivator.ts ×2
289 > deps.push(this._handleActivationRequest({
290 > id: this._globalRegistry.getExtensionDescription(depId)!.identifier,
291 > reason: currentActivation.reason
292 > }));
293 > continue;
294 > }
296 > const depDesc = this._registry.getExtensionDescription(depId);
297 > if (depDesc) {
298 > if (!depDesc.main && !depDesc.browser) { extHostExtensionActivator.ts ×2
299 // this dependency does not need to activate because it is descriptive only
300 continue;
301 }
303 > // must first wait for the dependency to activate
304 > deps.push(this._handleActivationRequest({
305 > id: depDesc.identifier,
306 > reason: currentActivation.reason
307 > }));
308 > continue;
309 > }
311 > // Error condition 1: unknown dependency
312 > const currentExtensionFriendlyName = currentExtension.displayName || currentExtension.identifier.value;
313 > const error = new Error(`Cannot activate the '${currentExtensionFriendlyName}' extension because it depends on unknown extension '${depId}'`); extHostExtensionActivator.ts ×4
314 > const result = this._createAndSaveOperation(currentActivation, currentExtension.displayName, [], new FailedExtension(error));
315 > this._host.onExtensionActivationError(
316 > currentExtension.identifier,
317 > error,
318 > new MissingExtensionDependency(depId)
319 > );
320 > return result;
321 > }
323 > return this._createAndSaveOperation(currentActivation, currentExtension.displayName, deps, null);
326 > private _createAndSaveOperation(activation: ActivationIdAndReason, displayName: string | null | undefined, deps: ActivationOperation[], value: ActivatedExtension | null): ActivationOperation {
327 > const operation = new ActivationOperation(activation.id, displayName, activation.reason, deps, value, this._host, this._logService); extHostExtensionActivator.ts ×20
328 > this._operations.set(activation.id, operation);
329 > return operation;
330 > }
332 > private _isHostExtension(extensionId: ExtensionIdentifier | string): boolean {
333 > return ExtensionDescriptionRegistry.isHostExtension(extensionId, this._registry, this._globalRegistry); extHostExtensionActivator.ts ×20
334 > }
336 > private _isResolvedExtension(extensionId: ExtensionIdentifier | string): boolean {
337 > const extensionDescription = this._globalRegistry.getExtensionDescription(extensionId); extHostExtensionActivator.ts ×4
338 > if (!extensionDescription) {
339 > // unknown extension extHostExtensionActivator.ts ×3
340 > return false;
341 > }
342 > return (!extensionDescription.main && !extensionDescription.browser); extHostExtensionActivator.ts ×1
345 >
346 > class ActivationOperation {
347 >
348 > private readonly _barrier = new Barrier();
349 > private _isDisposed = false;
350 >
351 > public get value(): ActivatedExtension | null {
352 > return this._value;
353 > }
354 >
355 > public get friendlyName(): string {
356 > return this._displayName || this._id.value; extHostExtensionActivator.ts ×5
357 > }
359 > constructor(
360 > private readonly _id: ExtensionIdentifier, extHostExtensionActivator.ts ×20
361 > private readonly _displayName: string | null | undefined,
362 > private readonly _reason: ExtensionActivationReason,
363 > private readonly _deps: ActivationOperation[],
364 > private _value: ActivatedExtension | null,
365 > private readonly _host: IExtensionsActivatorHost,
366 > @ILogService private readonly _logService: ILogService
367 > ) {
368 > this._initialize();
369 > }
371 > public dispose(): void {
372 > this._isDisposed = true; extHostExtensionActivator.ts ×20
373 > }
375 > public wait() {
376 > return this._barrier.wait(); extHostExtensionActivator.ts ×20
377 > }
379 > private async _initialize(): Promise<void> {
380 > await this._waitForDepsThenActivate(); extHostExtensionActivator.ts ×20
381 > this._barrier.open();
382 > }
384 > private async _waitForDepsThenActivate(): Promise<void> {
385 > if (this._value) { extHostExtensionActivator.ts ×20
386 > // this operation is already finished extHostExtensionActivator.ts ×3
387 > return;
388 > }
390 > while (this._deps.length > 0) {
391 > // remove completed deps extHostExtensionActivator.ts ×3
392 > for (let i = 0; i < this._deps.length; i++) {
393 > const dep = this._deps[i];
394 >
395 > if (dep.value && !dep.value.activationFailed) {
396 > // the dependency is already activated OK extHostExtensionActivator.ts ×1
397 > this._deps.splice(i, 1);
398 > i--;
399 > continue;
400 > }
402 > if (dep.value && dep.value.activationFailed) {
403 > // Error condition 2: a dependency has already failed activation extHostExtensionActivator.ts ×5
404 > const error = new Error(`Cannot activate the '${this.friendlyName}' extension because its dependency '${dep.friendlyName}' failed to activate`);
405 > // eslint-disable-next-line local/code-no-any-casts
406 > (<any>error).detail = dep.value.activationFailedError;
407 > this._value = new FailedExtension(error);
408 > this._host.onExtensionActivationError(this._id, error, null);
409 > return;
410 > }
412 >
413 > if (this._deps.length > 0) {
414 > // wait for one dependency
415 > await Promise.race(this._deps.map(dep => dep.wait()));
416 > }
417 > }
419 > await this._activate();
422 > private async _activate(): Promise<void> {
424 > this._value = await this._host.actualActivateExtension(this._id, this._reason);
425 > } catch (err) {
427 > const error = new Error();
428 > if (err && err.name) {
429 > error.name = err.name;
430 > }
431 > if (err && err.message) {
432 > error.message = `Activating extension '${this._id.value}' failed: ${err.message}.`;
433 > } else {
434 error.message = `Activating extension '${this._id.value}' failed: ${err}.`;
435 }
436 > if (err && err.stack) { extHostExtensionActivator.ts ×5
437 > error.stack = err.stack;
438 > }
439 >
440 > // Treat the extension as being empty
441 > this._value = new FailedExtension(error);
442 >
443 > if (this._isDisposed && errors.isCancellationError(err)) {
444 // It is expected for ongoing activations to fail if the extension host is going down
445 // So simply ignore and don't log canceled errors in this case
446 return;
447 }
449 > this._host.onExtensionActivationError(this._id, error, null);
450 > this._logService.error(`Activating extension ${this._id.value} failed due to an error:`);
451 > this._logService.error(err);
452 > }