Hierarchical 'My Extensions' possible?

So my long-term hope is getting #include/#load support like scriptcs/roslyn has per http://forum.linqpad.net/discussion/826/rfe-support-mixin-scripts

Barring that, since the problem I have with the current options is that it leaves me dumping everything into the single 'My Extensions', as a form of isolation, could linqpad support a hierarchical approach?

So instead of just the 'base' My Extensions being included in a given query, it would include all the ones from the directory the script is in all the way up to the root/base one.

This would allow me to have a mechanism to share code among a set of scripts (like the JSON POCO definitions from the original use case) without having to share it among the entire tree of scripts.

Since 'My Extensions' doesn't exist in the queries tree as-is I'm not sure how viable this is, and the #include/#load feature might be less trouble than this (not sure on the relative impl cost), but maybe a convention where files named _include.cs in the parent hierarchy are included?

Just trying to think of a possible workaround with less complexity until #include/#load support can be added. :)



  • Supporting #include/#load is likely to be less work, and will probably happen at some point. (Although there are still plenty of issues to work through, such as autocompletion, file watching, nested #includes, etc.)

  • Workaround: Put LINQPad.exe in a separate folder with extensions in Plugins folder, e.g.:
    Project 1\LINQPad.exe
    Project 1\Script 1.linq
    Project 1\Script 2.linq
    Project 1\Plugins\Framework 4.6\MyExtensions.FW46.linq
    Project 1\Plugins\Framework 4.6\MyExtensions.FW46.pdb
    Project 1\Plugins\Framework 4.6\MyExtensions.FW46.xml

    Project 2\LINQPad.exe
    Project 2\Script 3.linq
    Project 2\Script 4.linq
    Project 2\Plugins\Framework 4.6\MyExtensions.FW46.linq
    Project 2\Plugins\Framework 4.6\MyExtensions.FW46.pdb
    Project 2\Plugins\Framework 4.6\MyExtensions.FW46.xml
    (Copy Framework 4.6 directory from My Documents\LINQPad Plugins)

    You can execute scripts by dragging and dropping them on LINQPad.exe in the corresponding folder.

    Limitation: it's not possible to run LINQPad.exe more than once (found no option to allow mutiple instances).
  • nescafe - you can run multiple instances of LINQPad if you start LINQPad via the executable, rather than double-clicking a .linq file.
  • That worked. Thanks :smile:

    In addition to above, this workaround does not support hierarchical My Extensions, just separate My Extensions per project / folder.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!