@@ -5410,6 +5410,48 @@ export class ProjectExplorer implements CustomConfigurationProvider {
54105410 }
54115411 }
54125412
5413+ async copyPath ( type : 'abs' | 'relative' , item : ProjTreeItem ) {
5414+
5415+ const project = this . getProjectByTreeItem ( item ) ;
5416+ let copiedPath : string | undefined ;
5417+
5418+ if ( item . type === TreeItemType . FOLDER ||
5419+ item . type === TreeItemType . FOLDER_ROOT ||
5420+ item . type === TreeItemType . EXCFOLDER ) {
5421+ const dir = < File > item . val . obj ;
5422+ if ( type === 'abs' ) {
5423+ copiedPath = dir . path ;
5424+ } else {
5425+ copiedPath = project ?. toRelativePath ( dir . path ) || dir . path ;
5426+ }
5427+ }
5428+ else if ( item . type === TreeItemType . V_FOLDER ||
5429+ item . type === TreeItemType . V_FOLDER_ROOT ||
5430+ item . type === TreeItemType . V_EXCFOLDER ) {
5431+ const vinfo = < VirtualFolderInfo > item . val . obj ;
5432+ copiedPath = vinfo . path ;
5433+ }
5434+ else if ( item . type === TreeItemType . V_FILE_ITEM ||
5435+ item . type === TreeItemType . V_EXCFILE_ITEM ) {
5436+ const vinfo = < VirtualFileInfo > item . val . obj ;
5437+ if ( type === 'abs' ) {
5438+ copiedPath = project ?. toAbsolutePath ( vinfo . vFile . path ) || vinfo . vFile . path ;
5439+ } else {
5440+ copiedPath = vinfo . path ;
5441+ }
5442+ }
5443+ else if ( item . val . value instanceof File ) { // if value is a file, use it
5444+ if ( type === 'abs' ) {
5445+ copiedPath = item . val . value . path ;
5446+ } else {
5447+ copiedPath = project ?. toRelativePath ( item . val . value . path ) || item . val . value . path ;
5448+ }
5449+ }
5450+
5451+ if ( copiedPath )
5452+ vscode . env . clipboard . writeText ( copiedPath ) ;
5453+ }
5454+
54135455 private async showDisassemblyForElf ( elfPath : string , prj : AbstractProject ) {
54145456
54155457 try {
0 commit comments