I agree - this would really help me with my manual include handling, currently I am just migrating to program query mode.
This will be part of LINQPad 6.
In thinking about a cheap and easy way to implement this, I came up with automating the manual way I do this in one set of queries. I have a base statement query that sets up all my data variables. I copy and paste that in the top of each of my real queries that share the base data.
If LINQPad could automate the import, by finding a //#include query comment and then searching for the next //#end-include or //#include, and if it doesn't find //#end-include, insert the file contents after the include, and then insert //#end-include, and if it does find //#end-include, delete the lines after include and insert the file contents in-between.
Better still, add support for #region in statement mode and use #region include query and #endregion query and automatically close the query.
It could do this on opening a query, or a minor optimization, timestamp the end marker and compare to the include query end marker.
The inserted file would have any //#include or #region include modified to not work to prevent nesting issues. If you do nest, you would only get the latest update one level deep, so you'd have to update any include queries by opening and saving them as necessary.
I think this gets around most all of the issues I see with the rest of LINQPad, and yet still provides enough of the value of inclusion to be worthwhile.
I would like to see the actual per statement times as well somehow.
Would like this to work with the SQL window as well...
If there were just a method to easily convert a Connection in the connection window into the code for manually creating an additional context (have drag and drop handle this when cross servers / drivers?) that would be a nice start.