Refactoring: rename method and hide information about gradle

This commit is contained in:
Nikolay Krasko
2014-10-07 23:49:44 +04:00
parent a7fbc1bc6c
commit 7bf84ec84c
9 changed files with 10 additions and 15 deletions
@@ -41,7 +41,7 @@ public class DebugInfoAnnotator implements Annotator {
@Override
public void annotate(@NotNull PsiElement element, @NotNull final AnnotationHolder holder) {
if (!isDebugInfoEnabled() || !ProjectRootsUtil.isInSourceWithGradleCheck(element)) {
if (!isDebugInfoEnabled() || !ProjectRootsUtil.isInSource(element)) {
return;
}
@@ -93,7 +93,7 @@ public class JetPsiChecker implements Annotator, HighlightRangeExtension {
@Override
public void annotate(@NotNull PsiElement element, @NotNull AnnotationHolder holder) {
if (!(ProjectRootsUtil.isInSourceWithGradleCheck(element) || element.getContainingFile() instanceof JetCodeFragment)) return;
if (!(ProjectRootsUtil.isInSource(element) || element.getContainingFile() instanceof JetCodeFragment)) return;
for (HighlightingVisitor visitor : getBeforeAnalysisVisitors(holder)) {
element.accept(visitor);
@@ -27,11 +27,6 @@ import kotlin.platform.platformStatic
import org.jetbrains.jet.plugin.util.application.runReadAction
public object ProjectRootsUtil {
platformStatic
private fun isInSource(element: PsiElement): Boolean {
return isInSource(element, true)
}
platformStatic
public fun isInSource(element: PsiElement, includeLibrarySources: Boolean): Boolean {
return runReadAction { (): Boolean ->
@@ -54,7 +49,7 @@ public object ProjectRootsUtil {
}
platformStatic
public fun isInSourceWithGradleCheck(element: PsiElement): Boolean {
return isInSource(element) && !JetModuleTypeManager.getInstance()!!.isKtFileInGradleProjectInWrongFolder(element)
public fun isInSource(element: PsiElement): Boolean {
return isInSource(element, true)
}
}