selection after methods chains completion and checking parameters in context

This commit is contained in:
Dmitry Batkovich
2013-10-24 12:47:33 +04:00
parent 0fb461e070
commit 80106fc16c
53 changed files with 1582 additions and 1943 deletions
@@ -0,0 +1,64 @@
import java.jang.String;
/**
* @author Dmitry Batkovich <dmitry.batkovich@jetbrains.com>
*/
class Some {
public void m() {
MethodJavaDocHelper h = new MethodJavaDocHelper();
h.getTag();
}
}
class Some1 {
public void m() {
MethodJavaDocHelper h = new MethodJavaDocHelper();
h.getTag();
}
}
class Some2 {
public void m() {
MethodJavaDocHelper h = new MethodJavaDocHelper() ;
h.getTag();
}
}
class Some3 {
public void m() {
MethodJavaDocHelper h = new MethodJavaDocHelper() ;
h.getTag();
}
}
class Some4 {
public void m() {
MethodJavaDocHelper h = new MethodJavaDocHelper();
h.getTag();
}
}
class Some5 {
public void m() {
MethodJavaDocHelper h = new MethodJavaDocHelper() ;
h.getTag();
}
}
interface PsiElement {
}
class MethodJavaDocHelper {
public PsiElement getTag() {
return null;
}
}
public class TestCompletion {
public void method() {
PsiElement e = <caret>
}
}
@@ -0,0 +1,57 @@
/**
* @author Dmitry Batkovich <dmitry.batkovich@jetbrains.com>
*/
public class TestIndex {
}
class Some {
public void m() {
MethodJavaDocHelper h = new MethodJavaDocHelper();
h.getTag();
}
}
class Some1 {
public void m() {
MethodJavaDocHelper h = new MethodJavaDocHelper();
h.getTag();
}
}
class Some2 {
public void m() {
MethodJavaDocHelper h = new MethodJavaDocHelper();
h.getTag();
}
}
class Some3 {
public void m() {
MethodJavaDocHelper h = new MethodJavaDocHelper();
h.getTag();
}
}
class Some4 {
public void m() {
MethodJavaDocHelper h = new MethodJavaDocHelper();
h.getTag();
}
}
class Some5 {
public void m() {
MethodJavaDocHelper h = new MethodJavaDocHelper();
h.getTag();
}
}
interface PsiElement {
}
class MethodJavaDocHelper {
public PsiElement getTag() {
return null;
}
}
@@ -0,0 +1,15 @@
interface PsiMember {
PsiClass getContainingClass();
}
interface PsiMethod extends PsiMember {
}
interface PsiClass {}
public class TestCompletion {
public void method() {
PsiMethod psiMethod = <caret><selection>null</selection>;
PsiClass c = psiMethod.getContainingClass()
}
}
@@ -0,0 +1,14 @@
interface PsiMember {
PsiClass getContainingClass();
}
interface PsiMethod extends PsiMember {
}
interface PsiClass {}
public class TestCompletion {
public void method() {
PsiClass c = <caret>
}
}
@@ -0,0 +1,22 @@
public class TestIndex {
public void statMethod(PsiMethod m) {
m.getContainingClass();
m.getContainingClass();
m.getContainingClass();
m.getContainingClass();
m.getContainingClass();
m.getContainingClass();
m.getContainingClass();
m.getContainingClass();
}
}
interface PsiMember {
PsiClass getContainingClass();
}
interface PsiMethod extends PsiMember {
}
interface PsiClass {}
@@ -0,0 +1,48 @@
import java.jang.String;
/**
* @author Dmitry Batkovich <dmitry.batkovich@jetbrains.com>
*/
class CP1 implements CompletionProvider {
public void addCompletions(CompletionParameters p) {
p.getPosition();
}
}
class CP2 implements CompletionProvider {
public void addCompletions(CompletionParameters p) {
p.getPosition();
}
}
class CP3 implements CompletionProvider {
public void addCompletions(CompletionParameters p) {
p.getPosition();
}
}
class CP4 implements CompletionProvider {
public void addCompletions(CompletionParameters p) {
p.getPosition();
}
}
interface CompletionProvider {
void addCompletions(CompletionParameters p);
}
interface CompletionParameters {
PsiElement getPosition();
}
interface PsiElement {
}
public class TestCompletion {
public void method() {
PsiElement e = <caret>
}
}
@@ -0,0 +1,41 @@
/**
* @author Dmitry Batkovich <dmitry.batkovich@jetbrains.com>
*/
public class TestIndex {
}
class CP1 implements CompletionProvider {
public void addCompletions(CompletionParameters p) {
p.getPosition();
}
}
class CP2 implements CompletionProvider {
public void addCompletions(CompletionParameters p) {
p.getPosition();
}
}
class CP3 implements CompletionProvider {
public void addCompletions(CompletionParameters p) {
p.getPosition();
}
}
class CP4 implements CompletionProvider {
public void addCompletions(CompletionParameters p) {
p.getPosition();
}
}
interface CompletionProvider {
void addCompletions(CompletionParameters p);
}
interface CompletionParameters {
PsiElement getPosition();
}
interface PsiElement {
}
@@ -0,0 +1,81 @@
interface PsiElement {
}
interface PsiFile {
PsiElement findElementAt(int index);
}
interface VirtualFile {
}
class PsiManager {
PsiFile findFile(VirtualFile vf) {
return null;
}
public static PsiManager getInstance() {
return null;
}
}
interface UnknownParameter {
}
class SomeManager {
PsiFile findFile(UnknownParameter parameter) {
return null;
}
public static SomeManager getInstance() {
return null;
}
}
class SomeManager1 {
PsiFile findFile(UnknownParameter parameter) {
return null;
}
public static SomeManager1 getInstance() {
return null;
}
}
class SomeManager2 {
PsiFile findFile(UnknownParameter parameter) {
return null;
}
public static SomeManager2 getInstance() {
return null;
}
}
class SomeManager3 {
PsiFile findFile(UnknownParameter parameter) {
return null;
}
public static SomeManager3 getInstance() {
return null;
}
}
class SomeManager4 {
PsiFile findFile(UnknownParameter parameter) {
return null;
}
public static SomeManager4 getInstance() {
return null;
}
}
public class TestCompletion {
public void method(VirtualFile f) {
PsiElement element = <caret>
}
}
@@ -0,0 +1,106 @@
public class TestIndex {
public void m1(VirtualFile f) {
PsiManager.getInstance().findFile(f).findElementAt(0);
PsiManager.getInstance().findFile(f).findElementAt(0);
PsiManager.getInstance().findFile(f).findElementAt(0);
PsiManager.getInstance().findFile(f).findElementAt(0);
}
public void m2(UnknownParameter p) {
SomeManager1.getInstance().findFile(p).findElementAt(0);
SomeManager1.getInstance().findFile(p).findElementAt(0);
SomeManager1.getInstance().findFile(p).findElementAt(0);
SomeManager1.getInstance().findFile(p).findElementAt(0);
SomeManager2.getInstance().findFile(p).findElementAt(0);
SomeManager2.getInstance().findFile(p).findElementAt(0);
SomeManager2.getInstance().findFile(p).findElementAt(0);
SomeManager2.getInstance().findFile(p).findElementAt(0);
SomeManager3.getInstance().findFile(p).findElementAt(0);
SomeManager3.getInstance().findFile(p).findElementAt(0);
SomeManager3.getInstance().findFile(p).findElementAt(0);
SomeManager3.getInstance().findFile(p).findElementAt(0);
SomeManager4.getInstance().findFile(p).findElementAt(0);
SomeManager4.getInstance().findFile(p).findElementAt(0);
SomeManager4.getInstance().findFile(p).findElementAt(0);
SomeManager4.getInstance().findFile(p).findElementAt(0);
}
}
interface PsiElement {
}
interface PsiFile {
PsiElement findElementAt(int index);
}
interface VirtualFile {
}
class PsiManager {
PsiFile findFile(VirtualFile vf) {
return null;
}
public static PsiManager getInstance() {
return null;
}
}
interface UnknownParameter {
}
class SomeManager {
PsiFile findFile(UnknownParameter parameter) {
return null;
}
public static SomeManager getInstance() {
return null;
}
}
class SomeManager1 {
PsiFile findFile(UnknownParameter parameter) {
return null;
}
public static SomeManager1 getInstance() {
return null;
}
}
class SomeManager2 {
PsiFile findFile(UnknownParameter parameter) {
return null;
}
public static SomeManager2 getInstance() {
return null;
}
}
class SomeManager3 {
PsiFile findFile(UnknownParameter parameter) {
return null;
}
public static SomeManager3 getInstance() {
return null;
}
}
class SomeManager4 {
PsiFile findFile(UnknownParameter parameter) {
return null;
}
public static SomeManager4 getInstance() {
return null;
}
}
@@ -0,0 +1,17 @@
interface PsiManager {
Project getProject();
}
interface PsiElement {
Project getProject();
}
interface Project {}
public class TestCompletion {
public void method(PsiElement e, PsiManager m) {
Project p = <caret>
}
}
@@ -0,0 +1,25 @@
public class TestIndex {
public void statMethod(PsiManager m, PsiElement e) {
m.getProject();
m.getProject();
m.getProject();
m.getProject();
m.getProject();
e.getProject();
e.getProject();
e.getProject();
e.getProject();
e.getProject();
}
}
interface PsiManager {
Project getProject();
}
interface PsiElement {
Project getProject();
}
interface Project {}
@@ -0,0 +1,32 @@
public class TestCompletion {
void m() {
PsiFile f = <caret>
}
}
interface PsiFile {
}
interface PsiElement {
PsiFile getContainingFile();
}
class SomeUtil {
//representate some not frequently used methods
public static PsiFile get1() {
return null;
}
public static PsiFile get2() {
return null;
}
public static PsiFile get3() {
return null;
}
public static PsiFile get4() {
return null;
}
public static PsiFile get5() {
return null;
}
}
@@ -0,0 +1,56 @@
public class TestIndex {
void m(PsiElement e) {
//10
e.getContainingFile();
e.getContainingFile();
e.getContainingFile();
e.getContainingFile();
e.getContainingFile();
e.getContainingFile();
e.getContainingFile();
e.getContainingFile();
e.getContainingFile();
e.getContainingFile();
e.getContainingFile();
e.getContainingFile();
e.getContainingFile();
e.getContainingFile();
e.getContainingFile();
e.getContainingFile();
}
void m2() {
SomeUtil.get1();
SomeUtil.get2();
SomeUtil.get3();
SomeUtil.get4();
SomeUtil.get5();
}
}
interface PsiFile {
}
interface PsiElement {
PsiFile getContainingFile();
}
class SomeUtil {
//representate some not frequently used methods
public static PsiFile get1() {
return null;
}
public static PsiFile get2() {
return null;
}
public static PsiFile get3() {
return null;
}
public static PsiFile get4() {
return null;
}
public static PsiFile get5() {
return null;
}
}
@@ -1,53 +0,0 @@
import java.jang.String;
class B {
C getC() {
return null;
}
static B b = new B();
static B getB1() {
return b;
}
static B getB2() {
return b;
}
static B getB3() {
return b;
}
static B getB4() {
return b;
}
static B getB5() {
return b;
}
static B getB6() {
return b;
}
static B getB7() {
return b;
}
static B getB8() {
return b;
}
static B getB9() {
return b;
}
static B getB10() {
return b;
}
static B getB11() {
return b;
}
}
class C {}
public class TestCompletion {
public void method() {
C c = <caret>
}
}
@@ -1,104 +0,0 @@
/**
* @author Dmitry Batkovich <dmitry.batkovich@jetbrains.com>
*/
public class TestIndex {
public void statMethod1() {
B.getB1().getC();
B.getB1().getC();
B.getB1().getC();
}
public void statMethod2() {
B.getB2().getC();
B.getB2().getC();
B.getB2().getC();
}
public void statMethod3() {
B.getB3().getC();
B.getB3().getC();
B.getB3().getC();
}
public void statMethod4() {
B.getB4().getC();
B.getB4().getC();
B.getB4().getC();
}
public void statMethod5() {
B.getB5().getC();
B.getB5().getC();
B.getB5().getC();
}
public void statMethod6() {
B.getB6().getC();
B.getB6().getC();
B.getB6().getC();
}
public void statMethod7() {
B.getB7().getC();
B.getB7().getC();
B.getB7().getC();
}
public void statMethod8() {
B.getB8().getC();
B.getB8().getC();
B.getB8().getC();
}
public void statMethod9() {
B.getB9().getC();
B.getB9().getC();
B.getB9().getC();
}
public void statMethod10() {
B.getB10().getC();
B.getB10().getC();
B.getB10().getC();
}
public void statMethod11() {
B.getB11().getC();
B.getB11().getC();
B.getB11().getC();
}
}
class B {
C getC() {
return null;
}
static B b = new B();
static B getB1() {
return b;
}
static B getB2() {
return b;
}
static B getB3() {
return b;
}
static B getB4() {
return b;
}
static B getB5() {
return b;
}
static B getB6() {
return b;
}
static B getB7() {
return b;
}
static B getB8() {
return b;
}
static B getB9() {
return b;
}
static B getB10() {
return b;
}
static B getB11() {
return b;
}
}
class C {}
@@ -8,7 +8,7 @@ interface Project {}
public class TestCompletion {
void m() {
PsiManager psiManager = null;
PsiManager psiManager = <selection><caret>null</selection>;
Project p = psiManager.getProject()
}
}
@@ -10,7 +10,7 @@ interface Project {}
public class TestCompletion {
void m() {
String asd = "123";
PsiManager psiManager = null;
PsiManager psiManager = <selection><caret>null</selection>;
Project p = psiManager.getProject(asd, zxc)
}
}
@@ -0,0 +1,14 @@
interface PsiElement {
PsiElement findElementAt(int offset);
}
interface PsiFile extends PsiElement {
}
public class TestCompletion(){
void m(){
PsiElement e = <caret>
}
}
@@ -0,0 +1,26 @@
public class TestIndex {
PsiFile f;
void m() {
f.findElementAt(0);
f.findElementAt(0);
f.findElementAt(0);
f.findElementAt(0);
f.findElementAt(0);
f.findElementAt(0);
f.findElementAt(0);
f.findElementAt(0);
f.findElementAt(0);
f.findElementAt(0);
}
}
interface PsiElement {
PsiElement findElementAt(int offset);
}
interface PsiFile extends PsiElement {
}