palantir / palantir/palantir-java-format

[Feature Request] Temporarily turn off save actions

Open
#1,111 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
907
Forks
101
Avg merge
1d 3h
Merged PRs (30d)
19

Description

What happened?

Quite often I find myself commenting out chunks of of code while developing, and when I run my tests or leave focus, intellij automatically saves the file, and then that triggers the formatter and optimizing the imports. It's rather inconvenient for me sometimes because when I uncomment the chunk of code, the imports that got automatically optimized out, don't come back, and so I have to individually import them all again.

I'm also not always a fan of my code constantly going from single line to multi line in the middle of developing something, when the line length is around the single line length amount (thus small changes can lead to the thing I just edited being moved to a different spot).

Manually turning off the save actions doesn't work as when the formatter is run, it automatically reenables those options.

What did you want to happen?

I'd love to be able to configure 2 settings (one for the formatting, and one for the import optimization) in the intellij plugin to disable the save actions autoconfiguration so that it doesn't prematurely optimize my source code. The biggest benefit to me would be that I don't have to worry about things being moved behind my back when I might not care about the appearance of the code at the moment (for instance, when I'm trying out multiple ideas and don't want to fully get rid of the others while I explore one).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the IntelliJ plugin code that configures formatter and import-optimization save actions. Check how manual settings are overwritten when formatting runs, then define and test separate settings that prevent each action from being automatically enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
developer-experience
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.