mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
CodeInsightTestCase and RubyUsefulTestCase separated
This commit is contained in:
@@ -1,7 +1,23 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
package com.intellij.testFramework;
|
||||
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.PsiDocumentManager;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiReference;
|
||||
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
@@ -30,19 +46,4 @@ public class CodeInsightTestCase extends LightPlatformCodeInsightFixtureTestCase
|
||||
final int offset = findOffsetBySignature(signature);
|
||||
return myFixture.getFile().findReferenceAt(offset);
|
||||
}
|
||||
|
||||
protected PsiElement findPsiBySignature(final String signature) {
|
||||
return findPsiBySignature(signature, myFixture.getFile());
|
||||
}
|
||||
|
||||
protected PsiElement findPsiBySignature(final String signature, final PsiFile psiFile) {
|
||||
final int offset = findOffsetBySignature(signature, psiFile);
|
||||
return psiFile.findElementAt(offset);
|
||||
}
|
||||
|
||||
protected PsiElement findPsiBySignature(final String signature, final VirtualFile file) {
|
||||
final PsiFile psiFile = PsiManager.getInstance(getProject()).findFile(file);
|
||||
final int offset = findOffsetBySignature(signature, psiFile);
|
||||
return psiFile.findElementAt(offset);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user