-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserve script state (breakpoints, bookmarks, folding) after closing a script in the editor #37
Comments
Was this implemented by godotengine/godot#27979? Still, if you wish your breakpoints to be stored in a more reliable way, you can write the var x = 5
# Condition is true, will enter the block and break
if x == 5:
breakpoint
# Evaluates to `true`, won't break
assert(x == 5) |
Hi Calinou, I've seen that PR and it does not implement what I am asking for. Paul keeps track of breakpoints in open tabs section in config file (as explained in post). If tab is closed it is gone from this section and so are the breakpoints. Here I do following:
Check it out in pretty much any other IDE you can name - add breakpoint, close file, open it and breakpoint will be there (from the ones I've used Intellij, QTCreator and Eclispe work like this). Regarding breakpoint keyword I know that you can argue that it is substitute for real breakpoint feature (or even for conditional breakpoints) but in my opinion you should not be forced to modify your source code to do the job IDE fails to do - in this case to preserve breakpoints after closing files. |
This makes sense, I would extend it out to include the rest of the metadata already stored, not just breakpoints and bookmarks. For implementation, as the user could have quite a lot of scripts, I would lean towards storing this in a separate The difficulty comes in trying to handle built-in scripts (if we even should?) as they are not currently restored on load. In addition to this, preventing the |
Hi Paul, thanks for answer and guidance on this. Regarding update of script_editor_states I will try to update metadata when scripts are renamed/removed by godot. However, this will not prevent situation in which something is changed directly in filesystem (not via godot). Perhaps we could put some process in place that will analyze contents of I will start working on PR for this but scope seems big so it will take some time. Perhaps for starters I will move only metadata of bookmarks and breakpoints to |
What is proposed
Right now when editor code tab closes information about breakpoints and bookmarks is erased. I would like those data to be kept somewhere so that when you reopen closed tab bookmarks and breakpoints are still there. This is very basic feature of any IDE and Godot should support it too.
Describe implementation detail for your proposal (in code), if possible:
So long story short - information about breakpoints and bookmarks is kept in godot configuration fie editor_layout.cfg as a part of script metadata in open_scripts section. When you close editor this section remains intact therefore when you open godot again breakpoints/bookmarks get reloaded correctly. However when you close tab it gets deleted form open_scripts section and info about breakpoints/bookmarks is lost.
I think we sould keep this information at all times - either separate section could be added to one of config files (and removed from open_scripts section) or separate config file could be kept for this. After opening script then we could do lookup in this section to find breakpoints for the file.
Describe the project you are working on:
2D card game, irrelevant to the task.
Describe how this feature / enhancement will help your project:
Will improve debugging and bookmark usage
Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
don't have any
If this enhancement will not be used often, can it be worked around with a few lines of script?:
No it can't. Workaround is not using Godot code editor or not closing code tabs at all.
Is there a reason why this should be core and not an add-on in the asset library?:
Quite obvious - its an build-in editor feature.
Am I willing to work on this?
Yes I'd gladly provide PR for this, all I need is to consult with some core dev about how to implement it as I fear tinkering with config files can break backwards compatibility.
Ps. please add to the proposal template some point like 'explain feature' (like I added at the top) I feel like I could fill current template and provide 0 information about what I want to do.
The text was updated successfully, but these errors were encountered: