mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[Java. Code Formatting] IDEA-378318 remove spaces between module declarations if they exists
GitOrigin-RevId: 4358baab3482ff4c6ccd0037764cb35e179610f8
This commit is contained in:
committed by
intellij-monorepo-bot
parent
84526c727c
commit
2464cb6dd2
@@ -204,7 +204,7 @@ public abstract class AbstractJavaBlock extends AbstractBlock implements JavaBlo
|
||||
InjectedLanguageUtil.hasInjections((PsiLanguageInjectionHost)child)) {
|
||||
return new CommentWithInjectionBlock(child, wrap, alignment, indent, settings, javaSettings, formattingMode);
|
||||
}
|
||||
if (child instanceof LeafElement || childPsi instanceof PsiJavaModuleReferenceElement) {
|
||||
if (child instanceof LeafElement) {
|
||||
if (child.getElementType() == JavaTokenType.C_STYLE_COMMENT) {
|
||||
return new CStyleCommentBlock(child, actualIndent);
|
||||
}
|
||||
|
||||
+30
@@ -34,4 +34,34 @@ class JavaModuleFormatterTest : AbstractJavaFormatterTest() {
|
||||
doTextTest("@Deprecated\nmodule m { }", "@Deprecated\nmodule m {\n}")
|
||||
doTextTest("@Deprecated(forRemoval = true) module m { }", "@Deprecated(forRemoval = true)\nmodule m {\n}")
|
||||
}
|
||||
|
||||
fun testComposedModulesNamesAreCollapsed() {
|
||||
doTextTest("""
|
||||
module m . b .
|
||||
c { exports a . b to m1 .
|
||||
m2 ,m2 . m3, m3
|
||||
. m4; }
|
||||
""".trimIndent(),
|
||||
"""
|
||||
module m.b.
|
||||
c {
|
||||
exports a.b to m1.
|
||||
m2, m2.m3, m3
|
||||
.m4;
|
||||
}
|
||||
""".trimIndent())
|
||||
}
|
||||
|
||||
fun testComposedImportModuleNamesAreCollapsed() {
|
||||
doTextTest("""
|
||||
import module m . b . c
|
||||
import module m2 . b .
|
||||
c
|
||||
""".trimIndent(),
|
||||
"""
|
||||
import module m.b.c
|
||||
import module m2.b.
|
||||
c
|
||||
""".trimIndent() )
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user