mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[json] IJPL-63669: fix adding comma at the end of the last item while reformating json with too long lines
(cherry picked from commit b0bbe0e292849ffe85e96d337e05efc42c3cd234) IJ-MR-189563 GitOrigin-RevId: 8d5be58453f3c4ddfdb36ab3faa985107c46f306
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f5a587d304
commit
9ff51f73c7
@@ -40,6 +40,12 @@ public class JsonFormattingTest extends JsonTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testWrappingWhenLineIsTooLong() {
|
||||
getCodeStyleSettings().setRightMargin(JsonLanguage.INSTANCE, 20);
|
||||
getCodeStyleSettings().getCommonSettings(JsonLanguage.INSTANCE).WRAP_LONG_LINES = true;
|
||||
doTest();
|
||||
}
|
||||
|
||||
// WEB-13587
|
||||
public void testAlignPropertiesOnColon() {
|
||||
checkPropertyAlignment(PropertyAlignment.ALIGN_ON_COLON);
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"test": "very very very very very very very looooong line"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"test": "very very very very very very very looooong line"
|
||||
}
|
||||
@@ -132,7 +132,8 @@ public final class LineWrappingUtil {
|
||||
// No point in splitting line when its left part contains only white spaces, example:
|
||||
// line start -> | | <- right margin
|
||||
// | aaaaaaaaaaaaaaaa|aaaaaaaaaaaaaaaaaaaa() <- don't want to wrap this line even if it exceeds right margin
|
||||
|| CharArrayUtil.shiftBackward(text, startLineOffset, wrapOffset - 1, " \t") < startLineOffset) {
|
||||
|| CharArrayUtil.shiftBackward(text, startLineOffset, wrapOffset - 1, " \t") < startLineOffset
|
||||
|| wrapOffset <= startLineOffset || wrapOffset >= endLineOffset) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user