Report ngram frequencies only for indexed file types
authorVitaliy.Bibaev <vitaliy.bibaev@jetbrains.com>
Fri, 13 Apr 2018 11:18:46 +0000 (14:18 +0300)
committerVitaliy.Bibaev <vitaliy.bibaev@jetbrains.com>
Fri, 13 Apr 2018 11:18:46 +0000 (14:18 +0300)
plugins/stats-collector/src/com/intellij/stats/ngram/NGramContributor.kt

index 17afc3c32cd30c487046e417253373a206c2f566..d84306ac123be51da753698002c5265be0ff68bc 100644 (file)
@@ -12,7 +12,8 @@ import com.intellij.psi.search.GlobalSearchScope
 
 class NGramContributor : CompletionContributor() {
     override fun fillCompletionVariants(parameters: CompletionParameters, result: CompletionResultSet) {
-        if (!NGramIndexingProperty.isEnabled(parameters.position.project)) {
+        if (!NGramIndexingProperty.isEnabled(parameters.position.project) ||
+                parameters.originalFile.fileType !in NGramElementProvider.getSupportedFileTypes()) {
             super.fillCompletionVariants(parameters, result)
             return
         }