mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
don't correct classes by resolve scope shen they're outside source roots
This commit is contained in:
@@ -20,6 +20,7 @@ import com.intellij.codeInspection.InspectionManager
|
||||
import com.intellij.codeInspection.ex.LocalInspectionToolWrapper
|
||||
import com.intellij.codeInspection.uncheckedWarnings.UncheckedWarningLocalInspection
|
||||
import com.intellij.openapi.roots.ModuleRootManager
|
||||
import com.intellij.psi.PsiMethod
|
||||
import com.intellij.testFramework.PsiTestUtil
|
||||
import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase
|
||||
/**
|
||||
@@ -55,5 +56,33 @@ class SomeClass {
|
||||
def context = InspectionManager.getInstance(project).createNewGlobalContext(false)
|
||||
assertEmpty InspectionEngine.runInspectionOnFile(file, wrapper, context)
|
||||
}
|
||||
|
||||
public void "test resolve super constructor reference"() {
|
||||
PsiTestUtil.removeAllRoots(myModule, ModuleRootManager.getInstance(myModule).sdk)
|
||||
PsiTestUtil.addSourceRoot(myModule, myFixture.tempDirFixture.findOrCreateDir("src"))
|
||||
|
||||
myFixture.addFileToProject("src/Foo.java", """
|
||||
class Foo<T> {
|
||||
public Foo(T x) {
|
||||
}
|
||||
}
|
||||
""")
|
||||
|
||||
myFixture.configureByText("Foo.java", """
|
||||
class Foo<T> {
|
||||
public Foo(T x) {
|
||||
}
|
||||
}
|
||||
|
||||
class Bar extends Foo<String> {
|
||||
public Bar() {
|
||||
sup<caret>er("a");
|
||||
}
|
||||
}
|
||||
""")
|
||||
|
||||
assert myFixture.file.physical
|
||||
assert assertInstanceOf(myFixture.elementAtCaret, PsiMethod).name == 'Foo'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user