[java] class-like annotation wrapping in modules

This commit is contained in:
Roman Shevchenko
2017-10-02 20:19:01 +02:00
parent 1b9a88ee8c
commit 5c5c3ce691
4 changed files with 12 additions and 31 deletions
@@ -1317,6 +1317,9 @@ public class JavaSpacePropertyProcessor extends JavaElementVisitor {
else if (myType1 == JavaElementType.MODULE_REFERENCE || myType2 == JavaElementType.MODULE_REFERENCE) {
createSpaceInCode(true);
}
else if (myType1 == JavaElementType.MODIFIER_LIST) {
processModifierList();
}
}
@Override
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.psi.formatter.java.wrap.impl;
import com.intellij.formatting.Wrap;
@@ -326,6 +312,10 @@ public class JavaChildWrapArranger {
return settings.VARIABLE_ANNOTATION_WRAP;
}
if (nodeType == JavaElementType.MODULE) {
return settings.CLASS_ANNOTATION_WRAP;
}
return CommonCodeStyleSettings.DO_NOT_WRAP;
}
}
@@ -1,6 +1,7 @@
/**
* {@linkplain nothing}
*/
@SuppressWarnings("JavadocReference") module com.suppress.test.test.test {
@SuppressWarnings("JavadocReference")
module com.suppress.test.test.test {
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.psi.formatter.java
import com.intellij.openapi.roots.LanguageLevelProjectExtension
@@ -47,5 +33,6 @@ class JavaModuleFormatterTest : AbstractJavaFormatterTest() {
fun testAnnotatedModule() {
doTextTest("@Deprecated\nmodule m { }", "@Deprecated\nmodule m {\n}")
doTextTest("@Deprecated(forRemoval = true) module m { }", "@Deprecated(forRemoval = true)\nmodule m {\n}")
}
}