File tree Expand file tree Collapse file tree
src/vs/workbench/contrib/extensions/browser Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1709,6 +1709,23 @@ class ExtensionsContributions extends Disposable implements IWorkbenchContributi
17091709 run : async ( accessor : ServicesAccessor , id : string ) => accessor . get ( IClipboardService ) . writeText ( id )
17101710 } ) ;
17111711
1712+ this . registerExtensionAction ( {
1713+ id : 'workbench.extensions.action.copyExtensionVersion' ,
1714+ title : localize2 ( 'workbench.extensions.action.copyExtensionVersion' , 'Copy Extension Version' ) ,
1715+ menu : {
1716+ id : MenuId . ExtensionContext ,
1717+ group : '1_copy'
1718+ } ,
1719+ run : async ( accessor : ServicesAccessor , extensionId : string ) => {
1720+ const clipboardService = accessor . get ( IClipboardService ) ;
1721+ const extension = this . extensionsWorkbenchService . local . filter ( e => areSameExtensions ( e . identifier , { id : extensionId } ) ) [ 0 ]
1722+ || ( await this . extensionsWorkbenchService . getExtensions ( [ { id : extensionId } ] , CancellationToken . None ) ) [ 0 ] ;
1723+ if ( extension ) {
1724+ await clipboardService . writeText ( extension . version ) ;
1725+ }
1726+ }
1727+ } ) ;
1728+
17121729 this . registerExtensionAction ( {
17131730 id : 'workbench.extensions.action.copyLink' ,
17141731 title : localize2 ( 'workbench.extensions.action.copyLink' , 'Copy Link' ) ,
You can’t perform that action at this time.
0 commit comments