'create groovy method from usage' position caret at the beginning of selection

This commit is contained in:
Maxim.Medvedev
2012-05-15 19:04:46 +04:00
parent a6b7faa32e
commit e5b412d4c3
18 changed files with 306 additions and 18 deletions

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2000-2012 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.
*/
// "Create Method 'test'" "true"
public class Test {
public Test() {
@@ -5,6 +21,6 @@ public class Test {
}
private void test() {
<selection>//To change body of created methods use File | Settings | File Templates.<caret></selection>
<caret><selection>//To change body of created methods use File | Settings | File Templates.</selection>
}
}

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2000-2012 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.
*/
// "Create Method 'test'" "true"
public class Test {
public Test() {
@@ -5,6 +21,6 @@ public class Test {
}
private void test() {
<selection>//To change body of created methods use File | Settings | File Templates.<caret></selection>
<caret><selection>//To change body of created methods use File | Settings | File Templates.</selection>
}
}

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2000-2012 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.
*/
// "Create Method 'test'" "true"
public class Test {
public Test() {
@@ -5,6 +21,6 @@ public class Test {
}
private void test() {
<selection>//To change body of created methods use File | Settings | File Templates.<caret></selection>
<caret><selection>//To change body of created methods use File | Settings | File Templates.</selection>
}
}

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2000-2012 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.
*/
// "Create Method 'test'" "true"
public class Test {
static void test(int i) {}
@@ -6,6 +22,6 @@ public class Test {
}
private void test() {
<selection>//To change body of created methods use File | Settings | File Templates.<caret></selection>
<caret><selection>//To change body of created methods use File | Settings | File Templates.</selection>
}
}

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2000-2012 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.
*/
// "Create Method 'bar'" "true"
public class Test {
<T extends String> void foo (T t1, T t2) {
@@ -5,6 +21,6 @@ public class Test {
}
private <T extends String> void bar(T t1, T t2) {
<selection>//To change body of created methods use File | Settings | File Templates.<caret></selection>
<caret><selection>//To change body of created methods use File | Settings | File Templates.</selection>
}
}

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2000-2012 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.
*/
// "Create Method 'test'" "true"
public class Test {
public Test() {
@@ -5,6 +21,6 @@ public class Test {
}
private boolean test() {
<selection>return false; //To change body of created methods use File | Settings | File Templates.<caret></selection>
<caret><selection>return false; //To change body of created methods use File | Settings | File Templates.</selection>
}
}

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2000-2012 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.
*/
// "Create Method 'bar'" "true"
class A {
public void foo() {
@@ -6,6 +22,6 @@ class A {
}
private String bar() {
<selection>return null; //To change body of created methods use File | Settings | File Templates.<caret></selection>
<caret><selection>return null; //To change body of created methods use File | Settings | File Templates.</selection>
}
}

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2000-2012 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.
*/
// "Create Method 'someMethod'" "true"
public class Test {
@@ -8,7 +24,7 @@ public class Test {
}
private boolean someMethod(Object o) {
<selection>return false; //To change body of created methods use File | Settings | File Templates.<caret></selection>
<caret><selection>return false; //To change body of created methods use File | Settings | File Templates.</selection>
}
};
}

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2000-2012 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.
*/
// "Create Method 'f'" "true"
class A {
{
@@ -10,6 +26,6 @@ class A {
}
class B {
public static void f(Runnable runnable) {
<selection>//To change body of created methods use File | Settings | File Templates.<caret></selection>
<caret><selection>//To change body of created methods use File | Settings | File Templates.</selection>
}
}

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2000-2012 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.
*/
// "Create Method 'f'" "true"
public class A {
public A() {
@@ -5,7 +21,7 @@ public class A {
}
private static int f() {
<selection>return 0; //To change body of created methods use File | Settings | File Templates.<caret></selection>
<caret><selection>return 0; //To change body of created methods use File | Settings | File Templates.</selection>
}
public A(int i) {