Skip to content

Linting: Method arguments with long name are not shown in multiple line. #945

@kumarchandresh

Description

@kumarchandresh

Although this extension performs linting but there is no way to configure it. If I put multiple arguments with long names on different lines, it automatically compresses them in one or two lines when "formatOnSave: true".

Environment
  • Operating System: Windows 10 version:1903
  • JDK version: 11.0.3
  • Visual Studio Code version: 1.34.0
  • Java extension version: 0.45.0
Steps To Reproduce
  1. Edit setting formatOnSave: true
  2. Create a new class file Foo.java
  3. Add the following method to class Foo:
public class Foo {
  void bar(boolean booleanWithVeryLoneName, 
           int intergerValueWithVeryLongName,
           double decimalValueWithVeryLongName,
           String stringValueWithVeryLongName) {
    return;
  }
}
4. Save the file.

[attach a sample project reproducing the error]
attach logs

Current Result

Method arguments are compressed into 1 or 2 lines depending upon the number of characters in name of arguments:

  void bar(boolean booleanWithVeryLoneName, int intergerValueWithVeryLongName, double decimalValueWithVeryLongName,
      String stringValueWithVeryLongName) {
    return;
  }
Expected Result

Method should stay like:

  void bar(boolean booleanWithVeryLoneName, 
           int intergerValueWithVeryLongName,
           double decimalValueWithVeryLongName,
           String stringValueWithVeryLongName) {
    return;
  }

OR

  void bar(boolean booleanWithVeryLoneName, 
    int intergerValueWithVeryLongName,
    double decimalValueWithVeryLongName,
    String stringValueWithVeryLongName) {
    return;
  }
Additional Informations

There should be a setting to override such behavior of the extension.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions