Renamed method.
This commit is contained in:
@@ -87,11 +87,11 @@ public class JetPluginUtil {
|
|||||||
return libraryScope == ((NamespaceDescriptor) declaration).getMemberScope();
|
return libraryScope == ((NamespaceDescriptor) declaration).getMemberScope();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isInSourceContent(@NotNull PsiElement element) {
|
public static boolean isInSource(@NotNull PsiElement element) {
|
||||||
return isInSourceContent(element, true);
|
return isInSource(element, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isInSourceContent(@NotNull PsiElement element, boolean includeLibrarySources) {
|
public static boolean isInSource(@NotNull PsiElement element, boolean includeLibrarySources) {
|
||||||
PsiFile containingFile = element.getContainingFile();
|
PsiFile containingFile = element.getContainingFile();
|
||||||
if (containingFile == null) {
|
if (containingFile == null) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class KotlinTypeHierarchyProvider extends JavaTypeHierarchyProvider {
|
|||||||
PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
|
PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
|
||||||
if (!(file instanceof JetFile)) return null;
|
if (!(file instanceof JetFile)) return null;
|
||||||
|
|
||||||
if (!JetPluginUtil.isInSourceContent(file)) return null;
|
if (!JetPluginUtil.isInSource(file)) return null;
|
||||||
if (JetPluginUtil.isKtFileInGradleProjectInWrongFolder(file)) return null;
|
if (JetPluginUtil.isKtFileInGradleProjectInWrongFolder(file)) return null;
|
||||||
|
|
||||||
PsiElement target = TargetElementUtilBase.findTargetElement(editor, TargetElementUtilBase.getInstance().getAllAccepted());
|
PsiElement target = TargetElementUtilBase.findTargetElement(editor, TargetElementUtilBase.getInstance().getAllAccepted());
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class DebugInfoAnnotator implements Annotator {
|
|||||||
@Override
|
@Override
|
||||||
public void annotate(@NotNull PsiElement element, @NotNull final AnnotationHolder holder) {
|
public void annotate(@NotNull PsiElement element, @NotNull final AnnotationHolder holder) {
|
||||||
if (!isDebugInfoEnabled() ||
|
if (!isDebugInfoEnabled() ||
|
||||||
!JetPluginUtil.isInSourceContent(element) ||
|
!JetPluginUtil.isInSource(element) ||
|
||||||
JetPluginUtil.isKtFileInGradleProjectInWrongFolder(element)) {
|
JetPluginUtil.isKtFileInGradleProjectInWrongFolder(element)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public class DeclarationHintSupport extends AbstractProjectComponent {
|
|||||||
Editor editor = e.getEditor();
|
Editor editor = e.getEditor();
|
||||||
PsiFile psiFile = PsiDocumentManager.getInstance(myProject).getPsiFile(editor.getDocument());
|
PsiFile psiFile = PsiDocumentManager.getInstance(myProject).getPsiFile(editor.getDocument());
|
||||||
if (psiFile == null || psiFile.getLanguage() != JetLanguage.INSTANCE ||
|
if (psiFile == null || psiFile.getLanguage() != JetLanguage.INSTANCE ||
|
||||||
!JetPluginUtil.isInSourceContent(psiFile) ||
|
!JetPluginUtil.isInSource(psiFile) ||
|
||||||
JetPluginUtil.isKtFileInGradleProjectInWrongFolder(psiFile)) {
|
JetPluginUtil.isKtFileInGradleProjectInWrongFolder(psiFile)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -364,7 +364,7 @@ public class JetLineMarkerProvider implements LineMarkerProvider {
|
|||||||
public void collectSlowLineMarkers(@NotNull List<PsiElement> elements, @NotNull Collection<LineMarkerInfo> result) {
|
public void collectSlowLineMarkers(@NotNull List<PsiElement> elements, @NotNull Collection<LineMarkerInfo> result) {
|
||||||
if (elements.isEmpty() ||
|
if (elements.isEmpty() ||
|
||||||
DumbService.getInstance(elements.get(0).getProject()).isDumb() ||
|
DumbService.getInstance(elements.get(0).getProject()).isDumb() ||
|
||||||
!JetPluginUtil.isInSourceContent(elements.get(0)) ||
|
!JetPluginUtil.isInSource(elements.get(0)) ||
|
||||||
JetPluginUtil.isKtFileInGradleProjectInWrongFolder(elements.get(0))) {
|
JetPluginUtil.isKtFileInGradleProjectInWrongFolder(elements.get(0))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ public class JetPsiChecker implements Annotator {
|
|||||||
try {
|
try {
|
||||||
BindingContext bindingContext = AnalyzerFacadeWithCache.analyzeFileWithCache(file).getBindingContext();
|
BindingContext bindingContext = AnalyzerFacadeWithCache.analyzeFileWithCache(file).getBindingContext();
|
||||||
|
|
||||||
if (JetPluginUtil.isInSourceContent(element, /* includeLibrarySources = */ false)) {
|
if (JetPluginUtil.isInSource(element, /* includeLibrarySources = */ false)) {
|
||||||
Collection<Diagnostic> diagnostics = Sets.newLinkedHashSet(bindingContext.getDiagnostics());
|
Collection<Diagnostic> diagnostics = Sets.newLinkedHashSet(bindingContext.getDiagnostics());
|
||||||
Set<PsiElement> redeclarations = Sets.newHashSet();
|
Set<PsiElement> redeclarations = Sets.newHashSet();
|
||||||
for (Diagnostic diagnostic : diagnostics) {
|
for (Diagnostic diagnostic : diagnostics) {
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class JetJUnitConfigurationProducer extends RuntimeConfigurationProducer
|
|||||||
protected RunnerAndConfigurationSettings createConfigurationByElement(Location location, ConfigurationContext context) {
|
protected RunnerAndConfigurationSettings createConfigurationByElement(Location location, ConfigurationContext context) {
|
||||||
PsiElement leaf = location.getPsiElement();
|
PsiElement leaf = location.getPsiElement();
|
||||||
|
|
||||||
if (!JetPluginUtil.isInSourceContent(leaf, true)) {
|
if (!JetPluginUtil.isInSource(leaf, true)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class JetRunConfigurationProducer extends RuntimeConfigurationProducer im
|
|||||||
}
|
}
|
||||||
|
|
||||||
JetFile file = getStartClassFile(location);
|
JetFile file = getStartClassFile(location);
|
||||||
if (file == null || !JetPluginUtil.isInSourceContent(file, true)) {
|
if (file == null || !JetPluginUtil.isInSource(file, true)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class JetTestNgConfigurationProducer extends TestNGConfigurationProducer
|
|||||||
Project project = context.getProject();
|
Project project = context.getProject();
|
||||||
PsiElement leaf = location.getPsiElement();
|
PsiElement leaf = location.getPsiElement();
|
||||||
|
|
||||||
if (!JetPluginUtil.isInSourceContent(leaf, true)) {
|
if (!JetPluginUtil.isInSource(leaf, true)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class KotlinReferencesSearcher extends QueryExecutorBase<PsiReference, Re
|
|||||||
@Override
|
@Override
|
||||||
public void processQuery(@NotNull ReferencesSearch.SearchParameters queryParameters, @NotNull Processor<PsiReference> consumer) {
|
public void processQuery(@NotNull ReferencesSearch.SearchParameters queryParameters, @NotNull Processor<PsiReference> consumer) {
|
||||||
PsiElement element = queryParameters.getElementToSearch();
|
PsiElement element = queryParameters.getElementToSearch();
|
||||||
if (!JetPluginUtil.isInSourceContent(element) || JetPluginUtil.isKtFileInGradleProjectInWrongFolder(element)) {
|
if (!JetPluginUtil.isInSource(element) || JetPluginUtil.isKtFileInGradleProjectInWrongFolder(element)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (element instanceof JetClass) {
|
if (element instanceof JetClass) {
|
||||||
|
|||||||
Reference in New Issue
Block a user