Editing python code frequently output/insert misindented code

Example:

I asked Cody (using the edit command at the cursor to simply implement the function above. The cody output is the bottom part.

Using pycharm and the cody 7

1 Like

Hey @olejorgenb
Is the wrong indentation behavior a permanent problem, or does it only happen once in a while?

It doesn’t happen all the time, but frequently enough to be quite annoying.

Not sure about the “trigger”.

Another example:

    for (edge, deps) in c.deps.items():
        # Loop over all dependencies of the current node
        for dep in deps:
            # Get the dependency node
            <Cursor was here>
                        # Split deps into two series: one for max values and one for min values
                        max_series = deps.groupby(level=0).max()
                        min_series = deps.groupby(level=0).min()
            
                        # Plot the band using the max and min series
                        plot_band(depfig, min_series, max_series, f"{edge}-{dep}")
            
            plot_band(depfig, )

EDIT: if I select

       # Get the dependency node
       plot_band(depfig, )

Before issuing the edit command it works correctly

I’m seeing the same behavior. I see it happen more towards the late hours of my working/coding sessions, which probably is just by chance.

Does this means it happens if a chat session goes too long?

I just got a chat reply with the wrong indentation as well; the indentation was one level too low. The chat session wasn’t very long.

1 Like

Hey all,

there is now a new patch release 1.34.3 available for Cody in vs code.
Let me hear if this fixes the issue.