@@ -828,7 +828,7 @@ class ProjectDataProvider implements vscode.TreeDataProvider<ProjTreeItem>, vsco
828828 break ;
829829 }
830830
831- prj . Save ( false , 1000 ) ; // save project file with a delay
831+ prj . Save ( false , 2500 ) ; // save project file with a delay
832832 }
833833
834834 LoadWorkspaceProject ( workspaceState : vscode . Memento ) {
@@ -3589,9 +3589,9 @@ export class ProjectExplorer implements CustomConfigurationProvider {
35893589 const uid = prj . getUid ( ) ;
35903590 const wsf = prj . getWorkspaceFile ( ) ;
35913591
3592- //
3592+ prj . clearPendingSave ( ) ;
3593+
35933594 // disable autosave
3594- //
35953595 this . enableAutoSave ( false ) ;
35963596
35973597 if ( this . __autosaveDisableTimeoutTimer ) {
@@ -3603,9 +3603,7 @@ export class ProjectExplorer implements CustomConfigurationProvider {
36033603 } , 5 * 60 * 1000 , this ) ;
36043604 }
36053605
3606- //
3607- // do something
3608- //
3606+ // ask user to reload project
36093607 const msg = view_str$prompt$need_reload_project . replace ( '{}' , prj . getProjectName ( ) ) ;
36103608 const ans = await vscode . window . showInformationMessage ( msg , 'Yes' , 'No' ) ;
36113609 if ( ans == 'Yes' ) {
@@ -3617,9 +3615,7 @@ export class ProjectExplorer implements CustomConfigurationProvider {
36173615 this . __autosaveDisableTimeoutTimer = undefined ;
36183616 }
36193617
3620- //
36213618 // enable auto save
3622- //
36233619 this . enableAutoSave ( true ) ;
36243620 }
36253621
@@ -5414,6 +5410,48 @@ export class ProjectExplorer implements CustomConfigurationProvider {
54145410 }
54155411 }
54165412
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+
54175455 private async showDisassemblyForElf ( elfPath : string , prj : AbstractProject ) {
54185456
54195457 try {
0 commit comments