mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
intention to set default value to the parameter (IDEA-63040)
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
// "Generate delegated method with default parameter value" "true"
|
||||
class Test {
|
||||
void foo() {
|
||||
foo(<caret>);
|
||||
}
|
||||
|
||||
void foo(int ii){
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Generate delegated method with default parameter value" "true"
|
||||
class Test {
|
||||
Test() {
|
||||
this(<caret>);
|
||||
}
|
||||
|
||||
Test(int ii){}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Generate delegated method with default parameter value" "true"
|
||||
class Test {
|
||||
int foo() {
|
||||
return foo(<caret>);
|
||||
}
|
||||
|
||||
int foo(int ii){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Generate delegated method with default parameter value" "true"
|
||||
class Test {
|
||||
<T> int foo(boolean... args) {
|
||||
return foo(<caret>, args);
|
||||
}
|
||||
|
||||
<T> int foo(T ii, boolean... args){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Generate delegated method with default parameter value" "true"
|
||||
class Test {
|
||||
int foo(boolean... args) {
|
||||
return foo(<caret>, args);
|
||||
}
|
||||
|
||||
int foo(int ii, boolean... args){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// "Generate delegated method with default parameter value" "true"
|
||||
class Test {
|
||||
void foo(int i<caret>i){
|
||||
}
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// "Generate delegated method with default parameter value" "true"
|
||||
class Test {
|
||||
Test(int i<caret>i){}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Generate delegated method with default parameter value" "false"
|
||||
class Test {
|
||||
void foo(){}
|
||||
void foo(int i<caret>i){
|
||||
}
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// "Generate delegated method with default parameter value" "false"
|
||||
interface Test {
|
||||
void foo(int i<caret>i);
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Generate delegated method with default parameter value" "true"
|
||||
class Test {
|
||||
int foo(int i<caret>i){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Generate delegated method with default parameter value" "true"
|
||||
class Test {
|
||||
<T> int foo(T i<caret>i, boolean... args){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Generate delegated method with default parameter value" "true"
|
||||
class Test {
|
||||
int foo(int i<caret>i, boolean... args){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2000-2011 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.intellij.codeInsight.daemon.quickFix;
|
||||
|
||||
import com.intellij.codeInsight.template.impl.TemplateManagerImpl;
|
||||
import com.intellij.codeInsight.template.impl.TemplateState;
|
||||
|
||||
/**
|
||||
* @author anna
|
||||
*/
|
||||
public class DelegateWithDefaultParamValueTest extends LightQuickFixTestCase {
|
||||
@Override
|
||||
protected void doAction(String text, boolean actionShouldBeAvailable, String testFullPath, String testName)
|
||||
throws Exception {
|
||||
try {
|
||||
((TemplateManagerImpl)TemplateManagerImpl.getInstance(getProject())).setTemplateTesting(true);
|
||||
super.doAction(text, actionShouldBeAvailable, testFullPath, testName);
|
||||
|
||||
if (actionShouldBeAvailable) {
|
||||
TemplateState state = TemplateManagerImpl.getTemplateState(getEditor());
|
||||
assert state != null;
|
||||
state.gotoEnd(false);
|
||||
}
|
||||
} finally {
|
||||
((TemplateManagerImpl)TemplateManagerImpl.getInstance(getProject())).setTemplateTesting(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void test() throws Exception {
|
||||
doAllTests();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBasePath() {
|
||||
return "/codeInsight/daemonCodeAnalyzer/quickFix/delegateWithDefaultValue";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user