mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java] class-like annotation wrapping in modules
This commit is contained in:
@@ -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
|
||||
|
||||
+5
-15
@@ -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;
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
/**
|
||||
* {@linkplain nothing}
|
||||
*/
|
||||
@SuppressWarnings("JavadocReference") module com.suppress.test.test.test {
|
||||
@SuppressWarnings("JavadocReference")
|
||||
module com.suppress.test.test.test {
|
||||
|
||||
}
|
||||
+2
-15
@@ -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}")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user