Does the intelliJ plugin for toolchain save the fi...
# kotlin-toolchain
j
Does the intelliJ plugin for toolchain save the file periodically? If I do the following sequence: • Press enter • Press tab • Press
-
• Press space And wait for a short second, it triggers the formatting action (which triggers on save). I have only tried this in Markdown files and in project.yaml, module.yaml, and *.module-template.yaml, and it only happens in module.yaml and .module-template.yaml. This also happens for example when writing:
Copy code
description:
After I press : and space, after a short second it triggers the reformat again
j
I think the auto-sync of the project triggers on change with some debounce, and it's possible that it triggers a save, but don't take my word for it. @utikeev probably knows better
👍 1
j
message has been deleted
j
Oh wow, now that's 100% a bug. I have never seen this behavior
Could you please share which IDEA version you're using?
j
2026.2.2 With dprint and ktfmt plugins installed: dprint config:
Copy code
{
  "json": {},
  "markdown": {
    "textWrap": "always"
  },
  "toml": {},
  "dockerfile": {},
  "yaml": {},
  "excludes": [
    "**/*-lock.json"
  ],
  "plugins": [
    "npm:@dprint/json@0.23.0",
    "npm:@dprint/markdown@0.23.3",
    "npm:@dprint/toml@0.8.0",
    "npm:@dprint/dockerfile@0.6.0",
    "npm:dprint-plugin-yaml@0.6.0"
  ]
}
j
Ah so maybe dprint is the thing that interacts with auto-sync in a strange way
It would be worth trying without it and see
j
Oh, yes, it is 100% dprint - the problem is that the kotlin toolchain plugin is saving the file, which triggers "format on save" actions
It's saving the file when/while I type things
j
As a workaround, you might try to disable auto-sync to see if that's the real cause
j
This solved it! THANK YOU!
yay 1
j
Ok so at least we know that. Now you'll have to click the sync button, Gradle-style, when you want to change the config (which is a pity given the speed of the sync 😆), but better than having this crazy reformat.
👍 1
j
Yep, I prefer doing Cmd+Shift+A and find the Sync action manually anyways, it's okay 🙂
😆 1
j
For tracking, I opened this: KTC-5835 Auto-sync interacts very poorly with format-on-save
🙌 1
o
FWIW, I’m seeing the same thing with Kotlin source files and Ktlint auto-formatting.
j
😞
j
Oh sorry, the issue was automatically turned private because one of the slack links was a JetBrains internal link. I forced the issue to be public now
❤️ 1
j
Thanks! 😄