mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
modifier list intention: ensure range is valid (IDEA-142333)
This commit is contained in:
@@ -87,7 +87,7 @@ abstract class ModifierIntention extends Intention implements LowPriorityAction
|
||||
final PsiElement sibling = modifierList.getNextSibling();
|
||||
if (sibling instanceof PsiWhiteSpace) {
|
||||
sibling.replace(whitespace);
|
||||
CodeStyleManager.getInstance(project).reformatRange(member, modifierList.getTextOffset() + 1,
|
||||
CodeStyleManager.getInstance(project).reformatRange(member, modifierList.getTextOffset(),
|
||||
modifierList.getNextSibling().getTextOffset());
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
public class Te<caret>st {}
|
||||
+1
@@ -0,0 +1 @@
|
||||
class Test {}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright 2000-2015 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.
|
||||
*/
|
||||
package com.siyeh.ipp.modifiers;
|
||||
|
||||
import com.siyeh.IntentionPowerPackBundle;
|
||||
import com.siyeh.ipp.IPPTestCase;
|
||||
|
||||
public class MakePackageLocalIntentionTest extends IPPTestCase {
|
||||
|
||||
public void testInDefaultPackage() { doTest(); }
|
||||
|
||||
@Override
|
||||
protected String getRelativePath() {
|
||||
return "modifiers/make_local";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getIntentionName() {
|
||||
return IntentionPowerPackBundle.message("make.package.private.intention.name");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user