From e62a7b0a91d3d0cf34fa34360f1c9ec3795e8f41 Mon Sep 17 00:00:00 2001 From: Alexander Zolotov Date: Wed, 14 Jun 2017 15:37:01 +0300 Subject: [PATCH] Do not return todos count for file outside of content roots --- .../psi/impl/cache/impl/IndexTodoCacheManagerImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/editor-ui-ex/src/com/intellij/psi/impl/cache/impl/IndexTodoCacheManagerImpl.java b/platform/editor-ui-ex/src/com/intellij/psi/impl/cache/impl/IndexTodoCacheManagerImpl.java index 3c6562d99869..02c1c2431a45 100644 --- a/platform/editor-ui-ex/src/com/intellij/psi/impl/cache/impl/IndexTodoCacheManagerImpl.java +++ b/platform/editor-ui-ex/src/com/intellij/psi/impl/cache/impl/IndexTodoCacheManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -81,7 +81,7 @@ public class IndexTodoCacheManagerImpl implements TodoCacheManager { @Override public int getTodoCount(@NotNull final VirtualFile file, @NotNull final IndexPatternProvider patternProvider) { - if (myProject.isDefault()) { + if (myProject.isDefault() || !ProjectFileIndex.getInstance(myProject).isInContent(file)) { return 0; } if (file instanceof VirtualFileWindow) return -1; @@ -91,7 +91,7 @@ public class IndexTodoCacheManagerImpl implements TodoCacheManager { @Override public int getTodoCount(@NotNull final VirtualFile file, @NotNull final IndexPattern pattern) { - if (myProject.isDefault()) { + if (myProject.isDefault() || !ProjectFileIndex.getInstance(myProject).isInContent(file)) { return 0; } if (file instanceof VirtualFileWindow) return -1;