Minor: move feature manager
authorVitaliy Bibaev <roenke54@gmail.com>
Wed, 13 Dec 2017 09:12:26 +0000 (12:12 +0300)
committerVitaliy Bibaev <roenke54@gmail.com>
Wed, 13 Dec 2017 09:12:26 +0000 (12:12 +0300)
plugins/stats-collector/resources/META-INF/plugin.xml
plugins/stats-collector/src/com/intellij/completion/FeatureManager.kt [deleted file]
plugins/stats-collector/src/com/intellij/completion/FeatureManagerImpl.kt
plugins/stats-collector/src/com/intellij/sorting/MLCompletionSorter.kt
plugins/stats-collector/src/com/intellij/stats/personalization/impl/UserFactorsManagerImpl.kt

index 60adf27f2b06e9d2c78866b47b4dc43c78130a44..885f2c8b606a81872b97d20ef5d2ec361350de90 100644 (file)
 
     <component>
       <implementation-class>com.intellij.completion.FeatureManagerImpl</implementation-class>
-      <interface-class>com.intellij.completion.FeatureManager</interface-class>
+      <interface-class>com.jetbrains.completion.ranker.features.FeatureManager</interface-class>
     </component>
   </application-components>
 
diff --git a/plugins/stats-collector/src/com/intellij/completion/FeatureManager.kt b/plugins/stats-collector/src/com/intellij/completion/FeatureManager.kt
deleted file mode 100644 (file)
index 6808f19..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.intellij.completion
-
-import com.intellij.openapi.application.ApplicationManager
-import com.jetbrains.completion.ranker.features.*
-
-/**
- * @author Vitaliy.Bibaev
- */
-interface FeatureManager {
-    val binaryFactors: List<BinaryFeature>
-    val doubleFactors: List<DoubleFeature>
-    val categorialFactors: List<CatergorialFeature>
-    val ignoredFactors: Set<String>
-
-    val completionFactors: CompletionFactors
-    val featureArrayLength: Int
-
-    fun isUserFeature(name: String): Boolean
-    fun allFeatures(): List<Feature>
-
-    companion object {
-        fun getInstance(): FeatureManager = ApplicationManager.getApplication().getComponent(FeatureManager::class.java)
-    }
-}
\ No newline at end of file
index e27c0a1c90aaf6e137fda21712b3eb5c2a154661..1f292910c36ade7709853769576fba0609e09f4c 100644 (file)
@@ -1,5 +1,6 @@
 package com.intellij.completion
 
+import com.intellij.openapi.application.ApplicationManager
 import com.intellij.openapi.components.ApplicationComponent
 import com.jetbrains.completion.ranker.features.*
 
@@ -7,6 +8,10 @@ import com.jetbrains.completion.ranker.features.*
  * @author Vitaliy.Bibaev
  */
 class FeatureManagerImpl : FeatureManager, ApplicationComponent {
+    companion object {
+        fun getInstance(): FeatureManager = ApplicationManager.getApplication().getComponent(FeatureManager::class.java)
+    }
+
     private var arrayLength = 0
 
     override lateinit var binaryFactors: List<BinaryFeature> private set
index 0c7d2c5d1dff431cf07c4ad93e63b743bc8f0799..95af869c088abd68f627ae805c7ac3f95c1f1da9 100644 (file)
@@ -15,7 +15,7 @@
  */
 package com.intellij.sorting
 
-import com.intellij.completion.FeatureManager
+import com.jetbrains.completion.ranker.features.FeatureManager
 import com.intellij.openapi.components.ApplicationComponent
 import com.intellij.openapi.components.ServiceManager
 import com.jetbrains.completion.ranker.CompletionRanker
index b190b41a98676d2cab6639c67fca02bbbf852f96..75ac5db6ffba0a32cac062219a8e37805b18781d 100644 (file)
@@ -1,7 +1,7 @@
 package com.intellij.stats.personalization.impl
 
 import com.intellij.codeInsight.completion.CompletionType
-import com.intellij.completion.FeatureManager
+import com.intellij.completion.FeatureManagerImpl
 import com.intellij.openapi.components.ProjectComponent
 import com.intellij.openapi.diagnostic.Logger
 import com.intellij.stats.personalization.UserFactor
@@ -17,7 +17,7 @@ class UserFactorsManagerImpl : UserFactorsManager, ProjectComponent {
     private val userFactors = mutableMapOf<String, UserFactor>()
     init {
         // TODO: register all factors here
-        FeatureManager.getInstance() // TODO: register feature-derived factors
+        FeatureManagerImpl.getInstance() // TODO: register feature-derived factors
 
         // user factors
         register(ExplicitCompletionRatio())