News for hackers. Stuff that matters.
Re:Zed now predicts your next edit with Zeta, our new open m... by rfoo on Friday February 14, 2025 @05:06AM (#43046803)
For example, you have

    if check_something():
        wall_of_text = textwrap.dedent("""
    this
    is
    a
    multiline
    string
    """.strip("\n"))
I hope you agree it's ugly. And you want to make it

    if check_something():
        wall_of_text = textwrap.dedent("""\
            this
            is
            a
            multiline
            string
        """.strip("\n"))
But I don't know any formatter which does this automatically. Because the change here not only changes the looking, it changes semantic. The formatter has to understand that after `textwrap.dedent(_.strip("\n"))` the result does not change and that's hard. So formatter just leave it alone. But it's extremely obvious to a human. Or maybe extremely obvious to a LLM too.
Re:Zed now predicts your next edit with Zeta, our new open m... by Mashimo on Friday February 14, 2025 @05:33AM (#43046996)
Yeah, string """ blocks I also have to do manually. Though that example never interfered with AI autocomplete in my experience.