Feedback needed: New AI Editor Integration Feature

I'm looking for feedback on a new feature in the latest LINQPad 9 build.

In LINQPad's AI Chat window, you can now click Enable Refactoring and the system prompt will change to tell the model to emit unified diffs when proposing changes to your code.

This results in the model emitting diffs, which LINQPad detects, enabling automatic source control-style diffs to appear in the editor, with deletions & insertions in red and green and Accept / Reject buttons. This makes it much easier to integrate changes.

LINQPad also creates automatic checkpoints, so you can safely hit Accept All and then edit the updated code, while being able to later revert all changes if it turns out the model was out of its depth or on acid.

The diffing engine is a bespoke project comprising thousands of lines of code and has been tested with most major models including GPT 5 Chat, GPT 5 Reasoning, GPT 4.1 and Sonnet 4.

Comments

  • Hi,

    In previewing this I hit a "'temperature' does not support 0" error (see screenshot). I found that changing the model from "gpt 5 chat" to "gpt 5 reasoning" (with think faster checked) gets around the issue.

  • Duplicate accept / reject buttons on diff item.

    It looks like there are multiple accept / reject buttons on each diff item, where I assume there should be one?

  • Restore checkpoint

    Button tooltips

    For restore checkpoint (but also all other controls like 'think deeper / faster' in the chat pane) it would be great to have a brief tooltip description. For restore checkpoint specifically, I'm not immediately clear on what I'll be restoring to (ie just this diff item or all of them). I appreciate the ellipsis, but a tooltip feels more reassuring.

    Restore action

    It's great to be able to roll back. My ideal would be to have a panel that displayed all of the current change sets or checkpoints and then as I select each one the diff would be displayed again. ie I'd like more reassurance that I know what I'm changing.

  • Incorrect insertion point

    One of my test diffs seems to insert the new code in the wrong place - above void Main().

    Here's the diff items code:

    *** Begin Patch
    *** Update File: LINQPadScript.cs
    @@
     void Main()
     {
    @@
        foreach (var animal in animals)
        {
            animal.Dump();
            var t = animal.GetType().Dump();
            t.GetInheritanceHierarchy().Dump();
            // 'is' can work for subtypes
            (animal is Bird).Dump($"{animal.Name} is a type of Bird");
            t.IsSubclassOf(typeof(Bird)).Dump($"{t.Name} IsSubClass of {typeof(Bird).Name}");
        }
    +
    +   // Alternative naming example: more generic class names
    +   var creatures = new List<Organism>()
    +   {
    +       new Raptor() { Label = "Rita Raptor", Wingspan = 95, FlightRange = 180 },
    +       new Canine() { Label = "Carl Canine", Wariness = 30 }
    +   }.Dump("Creatures");
    +
    +   foreach (var creature in creatures)
    +   {
    +       creature.Dump();
    +       var ct = creature.GetType().Dump();
    +       ct.GetInheritanceHierarchy().Dump();
    +       (creature is Avian).Dump($"{creature.Label} is a type of Avian");
    +       ct.IsSubclassOf(typeof(Avian)).Dump($"{ct.Name} IsSubClass of {typeof(Avian).Name}");
    +   }
     }
    *** End Patch
    
  • @JohnGoldsmith - the tooltips on the Accept/Reject buttons explains the difference between the buttons. I will add tooltips to Think Deeper / Think Faster as you suggested. Thanks for the bug report in the differ - this should be fixed in the next build in a week or so.

    Regarding the UI for the checkpoints, it's indeed not ideal right now and will be reworked. It will also become less important as a consequence of another change that I'm planning.

    That is, the diffing strategy will change from pessimistic to optimistic, i.e., the workflow will assume that want to at least test - if not accept - the changes. So instead of clicking Preview and then seeing proposed changes, you will click Apply and see actual changes.

    The diff tags will still be there, but the buttons will change from Accept/Reject into Accept/Undo. The benefit is that you can immediately press F5 to test the updated version, and if you don't like it, hit Undo or Undo All. Right now, to test the changes, you must first Accept All, and then if you don't like it, rely on the rollback feature.

  • Thanks very much for the insight. The optimistic approach sounds good and more in line with VS Code, which I really like. Looking forward to the next updates.