mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[stats-collector] Normalize names of factors in logs
GitOrigin-RevId: 6cece25863b55743e349f6675731ad60a839c249
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4c33968f3c
commit
b19071c9be
+2
@@ -50,6 +50,8 @@ object FeatureUtils {
|
||||
return relevanceMap
|
||||
}
|
||||
|
||||
fun normalizeFeatureName(name: String): String = name.normalized()
|
||||
|
||||
private fun String.normalized(): String {
|
||||
return substringBefore('@')
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.intellij.stats.completion
|
||||
|
||||
import com.intellij.codeInsight.lookup.LookupElement
|
||||
import com.intellij.codeInsight.lookup.impl.LookupImpl
|
||||
import com.jetbrains.completion.feature.impl.FeatureUtils
|
||||
|
||||
class LookupStateManager {
|
||||
private val elementToId = mutableMapOf<String, Int>()
|
||||
@@ -67,7 +68,7 @@ class LookupStateManager {
|
||||
val relevanceObjects = lookup.getRelevanceObjects(this, false)
|
||||
return this.map {
|
||||
val id = getElementId(it)!!
|
||||
val relevanceMap = relevanceObjects[it]?.map { Pair(it.first, it.second?.toString()) }?.toMap()
|
||||
val relevanceMap = relevanceObjects[it]?.associate { p -> FeatureUtils.normalizeFeatureName(p.first) to p.second?.toString() }
|
||||
LookupEntryInfo(id, it.lookupString.length, relevanceMap)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user