Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for rangeStart/rangeEnd #487

Open
jhaber opened this issue Jun 19, 2021 · 1 comment
Open

Support for rangeStart/rangeEnd #487

jhaber opened this issue Jun 19, 2021 · 1 comment

Comments

@jhaber
Copy link
Contributor

jhaber commented Jun 19, 2021

Prettier-Java 1.2.0

# Options (if any):
--range-start 19
--range-end 98

Input:

package com.test;

public class Test {
  public void sayHello() { System.out.println("hello"); }
}

Output:

package com.test;

public class Test {
  public void sayHello() { System.out.println("hello"); }
}

Expected Output:

package com.test;

public class Test {

  public void sayHello() {
    System.out.println("hello");
  }
}

Expected behavior:

It seems like passing range start/end cause nothing to get formatted, even though the code that should get reformatted is within the specified range. Is this just something that isn't implemented yet?

For some context, I was trying to speed up formatting within our IntelliJ integration by only formatting modified lines (although maybe it won't make a huge difference if we still need to parse the whole file)

@clementdessoude
Copy link
Contributor

This functionality is indeed not implemented, as I was completely unaware of its existence in Prettier !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants