<commit_before>package com.github.denofevil.aurelia

import com.intellij.openapi.project.Project
import com.intellij.openapi.roots.ProjectRootModificationTracker
import com.intellij.openapi.vfs.VirtualFileManager
import com.intellij.psi.search.FilenameIndex
import com.intellij.psi.search.GlobalSearchScope
import com.intellij.psi.util.CachedValueProvider
import com.intellij.psi.util.CachedValuesManager

/**
 * @author Dennis.Ushakov
 */
object Aurelia {
    var INJECTABLE = arrayOf("bind", "one-way", "two-way", "one-time", "delegate", "trigger", "call")
    var REPEAT_FOR = "repeat.for"
    var AURELIA_APP = "aurelia-app"

    val AURELIA_DETECTOR_FILES = listOf(
            // Aurelia is included with with module loader (from jspm_packages when using JSPM) or module bundler (from node_modules when using Webpack)
            "aurelia-framework.js",
            // project generated by aurelia-cli
            "aurelia-bootstrapper.js",
            // project bootstrapped with script tag (contains aurelia-framework and other essential Aurelia modules)
            "aurelia-core.js"
    )

    fun present(project: Project) = CachedValuesManager.getManager(project).getCachedValue(project) {
        CachedValueProvider.Result.create(
                AURELIA_DETECTOR_FILES.any {
                    FilenameIndex.getFilesByName(project, it, GlobalSearchScope.allScope(project)).isNotEmpty()
                }, VirtualFileManager.VFS_STRUCTURE_MODIFICATIONS, ProjectRootModificationTracker.getInstance(project))
    }!!
}<commit_msg>fix Aurelia detection for IJ 2018.2+ (fixes #33)<commit_after>package com.github.denofevil.aurelia

import com.intellij.openapi.project.Project
import com.intellij.openapi.roots.ProjectRootModificationTracker
import com.intellij.openapi.vfs.VirtualFileManager
import com.intellij.psi.search.FilenameIndex
import com.intellij.psi.search.GlobalSearchScope
import com.intellij.psi.util.CachedValueProvider
import com.intellij.psi.util.CachedValuesManager

/**
 * @author Dennis.Ushakov
 */
object Aurelia {
    var INJECTABLE = arrayOf("bind", "one-way", "two-way", "one-time", "delegate", "trigger", "call")
    var REPEAT_FOR = "repeat.for"
    var AURELIA_APP = "aurelia-app"

    val AURELIA_DETECTOR_FILES = listOf(
            // Aurelia is included with with module loader (from jspm_packages when using JSPM) or module bundler (from node_modules when using Webpack)
            "aurelia-framework.js",
            // project generated by aurelia-cli
            "aurelia-bootstrapper.js",
            "aurelia-bootstrapper.d.ts",
            // project bootstrapped with script tag (contains aurelia-framework and other essential Aurelia modules)
            "aurelia-core.js"
    )

    fun present(project: Project) = CachedValuesManager.getManager(project).getCachedValue(project) {
        CachedValueProvider.Result.create(
                AURELIA_DETECTOR_FILES.any {
                    FilenameIndex.getFilesByName(project, it, GlobalSearchScope.allScope(project)).isNotEmpty()
                }, VirtualFileManager.VFS_STRUCTURE_MODIFICATIONS, ProjectRootModificationTracker.getInstance(project))
    }!!
}
{'fraction_non_alphanumeric': 0.09639696586599242, 'fraction_numerical': 0.0022123893805309734, 'mean_word_length': 3.567099567099567, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5321809', 'n_tokens_mistral': 977, 'n_tokens_neox': 959, 'n_words': 184}