Allow single chained methods to be placed on same line
See original GitHub issueI’d like an option to allow single chained methods to be placed on same line, as in if there is only two calls, then those two are placed on the same line. Here are some examples of code that doesn’t really look good with the current “break lines on chained methods” option:
this._foo = new Date()
.getTime();
$(document)
.ready(function () {
// function code here
});
Would this be feasible or is this just too much work for little gain?
Issue Analytics
- State:
- Created 10 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Wrapping chained method calls on a separate line in Intellij for ...
Go to Settings -> Editor -> Code style -> Java and select the Wrapping and Braces tab, then scroll to Chained method calls...
Read more >newline-per-chained-call - ESLint - Pluggable JavaScript Linter
This rule requires a newline after each call in a method chain or deep member access. Computed property accesses such as instance[something] are...
Read more >Method Chaining In Java with Examples - GeeksforGeeks
Method Chaining is the practice of calling different methods in a single line instead of calling other methods with the same object ...
Read more >Method chaining - Wikipedia
Method chaining, also known as named parameter idiom, is a common syntax for invoking multiple method calls in object-oriented programming languages.
Read more >Java Method Chaining Tutorial - Use Multiple Methods in One ...
Full Java Course: https://course.alexlorenlee.com/courses/learn-java-fastIf you're new to programming, I HIGHLY RECOMMEND solving challenges ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have the same issue and turning off “break lines on chained methods” is not possible for in my case. Input:
output:
desired output:
@joaobarcia - Sure. #809 would be the more flexible setting.