Home
Options

LINQPad 8 early preview now available

edited January 17

https://www.linqpad.net/linqpad8.aspx

This includes a number of internal architectural improvements, as well as new features.

Let me know your thoughts!

«1

Comments

  • Options

    Looks good.

    LINQPad now restores both modified and unmodified queries after closing and shelving. There's also now an Always Shelve button directly on the Exit dialog.

    Probably the feature that will benefit me the most, providing I can get rid of some bad habits that I have gotten into. I have been abusing the autosave feature of Linqpad by not saving my changes until I am finished with a script in order to get Linqpad to re-open it automatically. Also until the introduction of the shelve feature, I was deliberately killing Linqpad rather than closing it down properly.

  • Options
    edited October 2023

    One request I have is a way to better call and or send to LINQPad/LPrun 5. I have workarounds but a way to send a query from LP 8 to LP 5 would be great.

    Another, is it possible to label/tag the version of LINQPad a query is designed for? So you could know when the file is opened it was a LINQPad 5 query. I have some ways I made this work, but a built-in version checking or similar feature for queries would be better.

    And can we have multiple Samples tabs?

    Samples - Bulit-In
    Samples 1 - more NuGets
    Samples 2 - local NuGets

    Thanks.

  • Options

    Are you aware of the predefined compilation symbols?

    #if NET8
    // Code that requires .NET 8 or later
    #endif
    
    #if NET7
    // Code that requires .NET 7 or later
    #endif
    
    #if NET6
    // Code that requires .NET 6 or later
    #endif
    
    #if NETCORE
    // Code that requires .NET Core or later
    #else
    // Code that runs under .NET Framework (LINQPad 5)
    #endif
    
  • Options

    No. I will test this and report back. Thanks.

  • Options

    I tried several examples and COM object code throws NullReferenceException.

  • Options


    I just raised this issue, please check.

  • Options

    It didn't get through. Can you post details from the log file?
    %localappdata%\LINQPad\logs.LINQPad8\log.txt

  • Options

    @JoeAlbahari Sure, there it is the log.txt, but it is not a 100% issue, it appears sometimes. It occurs when I click "Go to..." link in "My Queries" section.

  • Options


    @JoeAlbahari another issue, for reason unknown, LINQPad 8 consumes LOTS of memory in my Azure HBv4 machine, as you can see in screenshot, it's > 200GB memory, and keeps increasing, it reduced into ~0GB after 2~3 minutes, it's a fresh machine, I only installed .NET 8 RC2 and LINQPad 8.0.3, strange.

  • Options

    Thanks for the report. I spent a fair bit of time on this several days ago. Turns out, it's a known issue with the JIT's tired compilation engine in .NET 8 RC-1/RC-2, and has been fixed in the most recent builds.

    https://github.com/dotnet/runtime/issues/93966

  • Options

    Love the new DumpTell feature and especially the option to make it the default.

    Two questions :

    1) What is the difference between the green dashes versus the green dots?

    2) Why does the following sample produce different results on the second dump?

    void Main()
    {
        Split("Line1\nLine2");
        Split("Line3\nLine4");
    }
    
    private void Split(string x)
    {
        (from r in  x.Split('\n') select r).DumpTell();
    }
    

    Output is :

  • Options

    This occurs when the same heading is dumped twice in a row. Rather than repeating the heading, it uses dots.

    Without this feature, it gets pretty cluttered when you execute code such as the following:

    for (int i = 0; i < 100; i++)
        i.Dump();
    
  • Options
    edited November 2023

    @JoeAlbahari when I ask the AI what model is in use it states gpt-3 even if I set gpt-4 to be used in the settings. When I ask ChatGPT/OpenAI API the same question it answers correctly based on which model I set. Is this a bug or user error?

    Also, can you support the update to gpt-4-turbo? It would be great if we could configure any model we want with a custom template json request with our own settings.
    https://platform.openai.com/docs/models

    [Edit]
    [ gpt-4-1106-preview ]
    It appear to work intermittently, the responses are very inconsistent. This might be the model itself not LINQPad. Another thought:
    What is included in the request you send to OpenAI? Do you add any additional instructions we don't see inside LINQPad? Can we have access to the request parameters to add our own instructions/settings?

  • Options

    Possible to enable horizontal scrolling on the rendered Grid and Html viewer?

  • Options

    Amazing and super useful tool. I can't program without it anymore.
    Dump() and HTML output in the browser are the winner.
    You are the number one 👍
    Thank you ❤️

  • Options

    @knave - you mean with Shift+Scrollwheel on DataGrids? I can add that. This is already supported with HTML output.

    It's also possible to scroll any result window in any direction with Alt+Arrow (or Alt+Home, Alt+End, Alt+PageUp, Alt+PageDown).

  • Options
    edited November 2023

    Would it be possible to have the editor support more collapsible code segments?

    For a while, LINQPad only supported collapsing top-level and local functions and regions. Sadly other more common types are not collapsible that ought to be: enabled/disabled #if blocks, multiline comments, generally any other blocked code (initializers, lambdas, if/else, for/foreach, using blocks, switch statements/expressions, class/struct/record definitions, etc.).

    Would be great if you could add it to the non-conventional code "blocks" such as expressions that span multiple lines and linq queries.

    It would make navigating larger scripts more patatable.

  • Options

    Really need better IntelliSense support for C# attributes

    I wrote these annotations almost everyday, Visual Studio is good in this case:

  • Options

    Another (easier) issue (compared to the IntelliSense "tricky one" above):

    LINQPad 8's JsonDocument dump support seems broken compares to LINQPad 7.

  • Options

    Thanks - there's a fix out now for the JsonDocument issue in 8.0.11. Will look at the other requests later.

  • Options
    edited November 2023

    LINQPad 8 is amazing!

    Any feedback on this:

    What is included in the request you send to OpenAI? Do you add any additional instructions we don't see inside LINQPad? Can we have access to the request parameters to add our own instructions/settings?

  • Options

    Possible to enable horizontal scrol> @JoeAlbahari said:

    @knave - you mean with Shift+Scrollwheel on DataGrids? I can add that. This is already supported with HTML output.

    It's also possible to scroll any result window in any direction with Alt+Arrow (or Alt+Home, Alt+End, Alt+PageUp, Alt+PageDown).

    Yes. Seems its a little known feature.
    Not sure if you've only just added the DataGrid horizontal scrolling feature but I just tested it and it works. :smile: Thanks!

    Though its not working for my mouse's horizontal scrollwheel (I'm using MX Master 3, so it has a horizontal wheel).

  • Options

    Meanwhile would love if you can add a keyboard shortcut that allows us to jump straight into Edit mode for the DataGrid.

  • Options

    Meanwhile would love if you can add a keyboard shortcut that allows us to jump straight into Edit mode for the DataGrid.

    Check out 8.0.15

  • Options

    V8 seems to have some mix-up with between Default Queries and Custom Style sheets.

    i.e. if you use the 'Save as default for new queries' option it creates a xml file which appears in the Edit/Preferences/Results/Style sheet for text (HTML) results/Custom/Launch Editor' and overwrites whatever was there previously.

    Screenshots :

  • Options

    Thanks - this should now be fixed.

  • Options

    @JoeAlbahari said:

    Meanwhile would love if you can add a keyboard shortcut that allows us to jump straight into Edit mode for the DataGrid.

    Check out 8.0.15

    Many thanks! Can't believe this was finally done!

  • Options

    I do extensive prototyping in LINQPad. I am dealing with 3 pet peaves that I wanted to check if LINQPad 8 made any improvements. It looks like all 3 issues are still there, sadly :(

    1. Reparse jumping.. if you scroll too quickly after typing or pasting in code, the editor 'jumps' back to your edit about 0.5-1 second later after it does some sort of background parse/compile. This is very annoying in a large file when you're making lots of edits that are not right near each other.

    2. Accidental language switch.. I've gotten really used to using CTRL+- for navigate backwards, which is very effective when doing keyboard work. Press F12 to jump to definition, make a tweak, then CTRL+- to get back to your location. Except... when you accidentally hit CTRL+0 and change the language from C# Program to F# Program which immediately and destructively modifies your entire script. And further you can't undo this, it is permanent - either have to fix manually or reload the file. I would LOVE for ability to undo language switch (CTRL+Z) and restore previous state, or remap shortcuts to avoid entirely.

    3. Intellisense popup hangs on certain types. When you are rapidly typing lines of code back-to-back that require intellisense popups, I regularly get some type of weird 'hang' where the popup takes 1-2 seconds to popup and animates very slowly. A good example is the Stopwatch class - if the method name is 'above the fold' there is no issue, but if it requires scroll, it seems to be weirdly slow.

    https://i.imgur.com/xO6Lzae.gif

    It may sound odd to be so picky on micro-timings, except when you are typing 100's lines of code very quickly on a regular basis, every small inefficiency that disrupts the flow is noticeable and distracting.

    Just my 2¢... Thanks as always!

  • Options
    edited December 2023

    Regarding the first issue, does the caret move, or just the scroll position?

    To help diagnose the third issue, could you please run the following code and let me know whether it helps the problem:

    void Main()
    {
        EnableSmoothScrolling (false).Dump ("successful");
    }
    
    bool EnableSmoothScrolling (bool value)
        => SystemParametersInfo (SPI_SETLISTBOXSMOOTHSCROLLING, 0, value ? 1 : 0, 0);
    
    const int SPI_SETLISTBOXSMOOTHSCROLLING = 0x1007;
    
    [DllImport ("user32", CharSet = CharSet.Auto)]
    static extern bool SystemParametersInfo (int uAction, int uParam, int lpvParam, int fuWinIni);
    

    This will disable smooth scrolling for listboxes in Windows. You can re-enable it by calling EnableSmoothScrolling (true).

  • Options
    edited December 2023

    Just the scroll position. Here is an example to demonstrate - I change the number and simply scroll away, and you see in a bit the window jumps back to the location of the caret.

    https://i.imgur.com/odRlWab.gif

    For 3rd issue - YES, that works wonders thanks! With smooth scrolling disabled it does not have any freeze on responsiveness.


    While we're on the topic of pain points, let me just mention one more :) Tuples. I use them a LOT for quick types, and they are very annoying in LINQPad. Anytime you are trying to write for example

    var (r, c) = (0, 0);
    var coord = (c:0, r:0);

    The intellisense constantly gets in the way trying to fill out names in scope. I understand it may be difficult to handle ambiguous context, but at least in the first example above "var (" pretty much will be followed by new variable names. In the second case I would say when typing colon ':' it should ignore intellisense and assume that is a tuple item name.

    Demonstration: https://i.imgur.com/7B5adNV.gif

Sign In or Register to comment.