Hello!
I have three suggestions for making improvements to the IDE.
Recent Files menu
I have set my IDE to load the files that where opened in the previous session on startup.
I have set the number of items in the Recent Files menu to 30.
I have around 25 files opened in the IDE.
Every time I launch the IDE, the Recent Files menu is spammed with the currently open files, so there are only 5 actually recent files left.
The other items are essentially useless, because they will only switch to the tab of an already opened file.
If a file can be open only once at a time in the IDE, it serves no purpose to have currently opened files appear in the Recent Files menu.
If the user wants to quickly access one of the open files, he or she could simply use the dropdown menu at the right end of the tab bar.
So here is my suggestion:
A file should only be added to the Recent Files menu at the time it is closed in the IDE.
When a file is opened, it should be removed from the menu.
In order to make sure the menu always contains the desired number of items set by the user, the IDE should store much more recent file names internally than it shows in the menu. One suggestion is to determine the number of stored files as follows, where NumRecentFiles is the value chosen by the user:
NumStoredFiles = NumRecentFiles + min(NumRecentFiles, 20)
In other words, store twice as many files as are displayed, but at least 20 extra files.
So if a user sets the number of recent files to 10, then 30 files will be stored internally.
With a number of 30, 60 files will be stored.
Windows jumplists
A similar thing happens with the Windows jumplists (the list of recent files for each application, displayed when right-clicking on a taskbar button).
I have set the jumplist size to 20 items, and whenever I open the IDE, it completely spams the jumplist with files open inside the IDE.
This makes the jumplist practically useless, because it contains only items that are open in the IDE anyway, so I could simply launch the IDE instead.
To resolve this issue, I suggest that files should only be added to the jumplist when they are opened because of the user's intent, such as:
- when using the File -> Open menu,
- when Ctrl-doubleclicking on an IncludeFile line,
- when doubleclicking a .pb file in the Explorer,
- when dragging and dropping a file into the IDE window.
A file should not be added to the jumplist when it is opened upon launching the IDE, or when the debugger detects an error in an included file and opens it to show the offending line.
Improving startup of the IDE
Like I said, I have 25 files opened in the IDE. Every time I launch it, it loads these files one after one.
This causes a lot of wait time, annoying screen flashes as every file is being displayed, and also a waste of CPU resources to render every file only to be overwritten by another file moments later.
My suggestion here is as follows:
When launching the IDE, instantly add tabs for all open files to the tab bar.
Activate the tab of the last file (it would actually be good if the IDE would remember the last active tab, instead of activating the last tab in the list).
Load this file first and display the source code.
Load and parse the other inactive files in a background thread, as necessary for the autocompletion to work.
Regards,
Nils
PureBasic IDE: Loading of files and handling of recent files
Re: PureBasic IDE: Loading of files and handling of recent files
All good suggestions.
1 sounds easiest, 3 sounds most difficult (multi-threading the loading and parsing of files).
These seem like opportunities for the community to submit to the open source IDE, I wouldn't expect the official team to focus on these soon. I think they're busy with major new features for 6.30
1 sounds easiest, 3 sounds most difficult (multi-threading the loading and parsing of files).
These seem like opportunities for the community to submit to the open source IDE, I wouldn't expect the official team to focus on these soon. I think they're busy with major new features for 6.30

Re: PureBasic IDE: Loading of files and handling of recent files
NilsH
If you do it yourself and offer a ready-made source code to insert it in the position you specify, removing the number of lines you specify, then you will get what you want.
If you do it yourself and offer a ready-made source code to insert it in the position you specify, removing the number of lines you specify, then you will get what you want.
Re: PureBasic IDE: Loading of files and handling of recent files
Interesting. I didn't know that the source for the IDE is publicly available now.
But indeed, here it is: https://github.com/fantaisie-software/p ... reBasicIDE
I only hope it never becomes "open contribution", because that seems to be the best way to make software quality race towards negative infinity.
It looks like there's no design documentation available, and everyone who wants to help developing has to reverse-engineer the code for himself?
It would be good to have documentation that explains how things work and why they are done this way and not another.
Should I ever participate in the development, I will probably make the start by writing a document on the recent files handling.
I think that number 2 is actually the easiest thing to do.
It seems that both the recent files list as well as the jumplist are handled by the RecentFiles_AddFile() function in RecentFiles.pb.
So the first thing would be to add a flag that controls whether to notify the Windows shell about the file being used:
Next, every call to this function needs to be updated to specify the new flag as necessary.
Among other places, RecentFiles_AddFile() is called from LoadSourceFile() and SaveSourceFile() in SourceManagement.pb.
For example, LoadSourceFile() could also be updated by adding a flag to indicate the if the file was loaded by the user's intent:
Now, all calls to LoadSourceFile() need to be updated to specify the flag whenever it's appropriate.
Number 1 seems more complicated, because the current implementation was just not designed for the suggested change in functionality.
I think it's best to remove RecentFiles_AddFile() completely and add a function called RecentFiles_FileEvent() that receives a combination of flags telling what's happened and then decides on its own how to handle it.
Maybe I will look into making the changes myself, but it won't happen anytime soon, because I have already buried myself under a dozen unfinished projects.
Regards,
Nils
But indeed, here it is: https://github.com/fantaisie-software/p ... reBasicIDE
I only hope it never becomes "open contribution", because that seems to be the best way to make software quality race towards negative infinity.
It looks like there's no design documentation available, and everyone who wants to help developing has to reverse-engineer the code for himself?
It would be good to have documentation that explains how things work and why they are done this way and not another.
Should I ever participate in the development, I will probably make the start by writing a document on the recent files handling.
I think that number 2 is actually the easiest thing to do.
It seems that both the recent files list as well as the jumplist are handled by the RecentFiles_AddFile() function in RecentFiles.pb.
So the first thing would be to add a flag that controls whether to notify the Windows shell about the file being used:
Code: Select all
EnumerationBinary
#RecentFiles_AddFile_ByUsersIntent
;#RecentFiles_AddFile_IsProject ; this could replace the IsProject parameter in future
EndEnumeration
Procedure RecentFiles_AddFile(FileName$, IsProject, Flags) ; Flags not optional to make compilation fail if call is not updated to new parameter scheme
...
If Flags & #RecentFiles_AddFile_ByUsersIntent
SHAddToRecentDocs_(#SHARD_PATH, @FileName$)
EndIf
...
Among other places, RecentFiles_AddFile() is called from LoadSourceFile() and SaveSourceFile() in SourceManagement.pb.
For example, LoadSourceFile() could also be updated by adding a flag to indicate the if the file was loaded by the user's intent:
Code: Select all
EnumerationBinary
#LoadSourceFile_ByUsersIntent
;#LoadSourceFile_Activate ; this could replace the Activate parameter in future
EndEnumeration
Procedure LoadSourceFile(FileName$, Activate = 1, Flags)
...
RecentFilesFlags = 0
If Flags & #LoadSourceFile_ByUsersIntent
RecentFilesFlags | #RecentFiles_AddFile_ByUsersIntent
EndIf
RecentFiles_AddFile(FileName$, #False, RecentFilesFlags)
...
Number 1 seems more complicated, because the current implementation was just not designed for the suggested change in functionality.
I think it's best to remove RecentFiles_AddFile() completely and add a function called RecentFiles_FileEvent() that receives a combination of flags telling what's happened and then decides on its own how to handle it.
Code: Select all
EnumerationBinary
#RecentFiles_FileEvent_Load
#RecentFiles_FileEvent_Save
#RecentFiles_FileEvent_Close
#RecentFiles_FileEvent_ByUsersIntent
EndEnumeration
Procedure RecentFiles_FileEvent(FileName$, Flags)
...
Maybe I will look into making the changes myself, but it won't happen anytime soon, because I have already buried myself under a dozen unfinished projects.
Regards,
Nils