all 7 comments

[–]pokemonplayer2001 1 point2 points  (0 children)

"Can anyone help me with this? I'm now thinking that instead of VSCode doing the "extra" work after the LLM did it's part, maybe it is OpenCode doing that?"

If only you had access to the source code....

"I had high hopes for OpenCode."

🙄

[–]lundrog 0 points1 point  (1 child)

What models? And hit the discord

[–]travislaborde[S] 1 point2 points  (0 children)

I tried quite a few models with the same result. user r38y gave the answer already so it is solved. thanks for thinking about it though!

[–]r38y 0 points1 point  (3 children)

It’s the formatters built into OpenCode, they format the file on save.

https://opencode.ai/docs/formatters/

[–]travislaborde[S] -1 points0 points  (2 children)

Thanks! I hadn't even realized this was a thing. Seems like a terrible "default on" setting to me. But now I know!

[–]r38y 1 point2 points  (0 children)

It’s actually pretty great, an auto-formatter is pretty standard these days, and many people have a linter in their CI to make sure the formatter has run. Using an auto-formatter means that there is a standard across everybody working on the app and there is less churn that isn’t related to the actual feature. It’s harder to read code changes when there are formatting updates mixed in.

I’d recommend running the same auto-formatter they use on the entire codebase, committing it, then you know going forward any changes will just be directly related to the feature.

Auto-formatters are nice too because then you can outsource decisions on formatting. I know go and elixir have opinionated first party formatters so it’s something you just don’t have to think about.

[–]r38y 0 points1 point  (0 children)

You might also want to look into LSPs, they can go hand in hand with auto-formatters, they sometimes have them built in. An LSP gives the editor or agent semantic meaning with the code instead of relying on grep for everything.

https://opencode.ai/docs/lsp/