SUMMARY Working area change from Code to Debug or vise versa (but not from Code to Review and back) hides and makes inaccessible all untitled (unsaved) documents. Text entered in these documents is lost to the user, without any confirmation/save prompt. The open document counter is not decremented - new untitled documents contain greater numbers in their URLs after the older untitled documents disappear, so it appears the documents exist, but are inaccessible in the UI. Sometimes the few documents that became inaccessible most recently can be recovered from the Documents tool view or from the Most-Recently-Used Document Switcher. STEPS TO REPRODUCE 1. Create one or more documents, (optionally) type text into them, but do not save them. 2. Start debugging. 3. (optionally) Repeat step 1. 4. Stop debugging. OBSERVED RESULT The untitled document tabs disappear and are absent from the Active Working Set. KDevelop prints warnings like these: kdevplatform.workingset: Unable to find file "file:///Untitled" kdevplatform.workingset: Unable to find file "file:///Untitled (1)" EXPECTED RESULT The untitled document tabs are preserved when debugging is started or stopped. ADDITIONAL INFORMATION I suspect that this bug was introduced by the merge request that introduced the printed warning: https://invent.kde.org/kdevelop/kdevelop/-/merge_requests/213
This bug is sort of reverse of Bug 409858 fixed in the mentioned merge request. Documents with a non-Untitled URL that don't have corresponding files on disk disappear when starting/stopping debugging too: 1. A nonexistent file opened by double-clicking a row in Breakpoints tool view. 2. A file that was opened in KDevelop editor, then deleted from disk externally.
(In reply to Igor Kushnir from comment #1) > This bug is sort of reverse of Bug 409858 fixed in the mentioned merge request. A simple fix that does not reopen Bug 409858 might work: skip opening nonexistent files only on KDevelop start, not when that function is called during a switch to a different area. Hopefully those nonexistent documents would be (re)opened correctly then.
A possibly relevant merge request was started @ https://invent.kde.org/kdevelop/kdevelop/-/merge_requests/559
(In reply to Igor Kushnir from comment #2) > (In reply to Igor Kushnir from comment #1) > > This bug is sort of reverse of Bug 409858 fixed in the mentioned merge request. > A simple fix that does not reopen Bug 409858 might work: skip opening > nonexistent files only on KDevelop start, not when that function is called > during a switch to a different area. Hopefully those nonexistent documents > would be (re)opened correctly then. I did something similar: Check if the document controller might actually find something with the temporary untitled name. If it does, take that document, if not, skip it. At startup it will not find the document. When switching between areas, it actually does.
Git commit 9cc5682da37101b62eabd56437fd901c554b202c by Christoph Roick. Committed on 30/05/2024 at 21:47. Pushed by croick into branch 'master'. Keep unsaved documents open when switching areas The document controller can find unsaved files by specifying the "untitled" document name as long as the controller exists. Show the document if it is found. FIXED-IN: 5.15.240800 M +8 -0 kdevplatform/shell/tests/test_workingsets.cpp M +8 -2 kdevplatform/shell/workingsets/workingset.cpp https://invent.kde.org/kdevelop/kdevelop/-/commit/9cc5682da37101b62eabd56437fd901c554b202c