Home
Options

Feature Request: Auto Saved "Anonymous" Queries

In short, SublimeTexts's unsaved file behavior would be very welcome in Linqpad.

When I attempt to close Linqpad with unsaved queries, the "Save changes to the following queries?" dialog is never welcome. I know that Linqpad saves queries automatically in a temporary location, because when the process crashes, upon restarting I see a "LINQPad Auto Recover" dialog asking if I want to recover unsaved queries.

Ideally, I'd never see either of these dialogs. When exiting Linqpad, they'd be saved for auto recover and when opening, auto recover would happen by default.

I very often have many unsaved queries in linqpad. If I have to reboot my machine for some (usually inconvenient) reason, I will kill the linqpad process, so that I don't have to bother with saving a bunch of queries that I might not keep long-term anyway.

Honestly, I'm having trouble thinking of other applications with a tabbed interface that do not work this way already. All of my text editors and web browsers behave this way. To those that very heavily depend on Linqpad, this would be an incredibly welcome feature.

Thanks for you consideration!

Comments

  • Options

    This is very much on the radar - the difficulty is settling on a design. While there are plenty of users asking for this feature, I believe it will annoy plenty more unless it's implemented better than in most applications today.

    The main sticking point is how to handle files that are synced to the cloud (Dropbox, OneDrive), or saved to a network folder. Think about what happens should you close LINQPad with unsaved changes to those files (should it simply exit with no dialog) and then continue working on another device. You'll end up working on outdated copies, and upon returning to your original machine, have merge conflicts. LINQPad will need to detect that situation and display a dialog like this for each file that's in conflict:

    "Query 'foo.linq' has unsaved changes, but was also updated externally since you last ran LINQPad. Which version do you want to keep?"

    What makes this particularly bad is that it might happen days after the updates were made (when you next happen to run LINQPad on that machine), so you'll have no idea how to answer the question. Also, the Undo buffer will be empty, so you can't hit Ctrl+Z to see what edits you made on the current machine.

    A potential solution might be to treat unnamed queries differently to named queries. So, when you exit, a dialog appears that gives you the option of saving all named queries and shelving all unnamed queries. But this dialog could end up being confusing - especially if you're in a hurry to exit the application.

    Another option could be to write the auto-save files to the same folder as the query, so that it can self-recover on another machine. This approach would fail badly, though, if the folder was a network share with multiple users rather than a cloud-synced folder.

    Do you have any thoughts?

  • Options

    I hadn't considered the dropbox/network folder scenarios and I think you shouldn't either. :smile:

    The reason I say that is that I don't regard my folder of .linq files any differently than I would regard a folder full of .cs/.csproj/.sln files or a folder of .py files or a folder of .go files.

    What I mean is that a folder full of source code that is shared among people (or yourself on multiple machines) is necessarily going to have to deal with change conflicts.

    For the purposes of this discussion, Linqpad is nothing more than a text editor (though it's sooo much more than that :wink: ). And text editors don't solve this problem for their users. We have other tools for that: git or other version control.

    Hopefully that doesn't sound harsh and that I haven't misunderstood the issues you are bringing up.

Sign In or Register to comment.