GitOrigin-RevId: 0d8f3a68e28f90dc4b641c249060516f0f50ab56
This commit is contained in:
Vladimir Krivosheev
2024-10-09 20:37:50 +02:00
committed by intellij-monorepo-bot
parent cc80e36cc3
commit 956b017e55
2 changed files with 4 additions and 5 deletions

View File

@@ -189,8 +189,7 @@
</extensions> </extensions>
<extensions defaultExtensionNs="com.intellij"> <extensions defaultExtensionNs="com.intellij">
<applicationService <applicationService serviceImplementation="training.featuresSuggester.settings.FeatureSuggesterSettings"/>
serviceImplementation="training.featuresSuggester.settings.FeatureSuggesterSettings"/>
<applicationConfigurable parentId="tools" <applicationConfigurable parentId="tools"
instance="training.featuresSuggester.settings.FeatureSuggesterConfigurable" instance="training.featuresSuggester.settings.FeatureSuggesterConfigurable"
id="org.intellij.featuresSuggester.FeatureSuggesterConfigurable" id="org.intellij.featuresSuggester.FeatureSuggesterConfigurable"

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. // Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package training.featuresSuggester.settings package training.featuresSuggester.settings
import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.application.ApplicationManager
@@ -19,7 +19,7 @@ import kotlin.math.min
name = "FeatureSuggesterSettings", name = "FeatureSuggesterSettings",
storages = [Storage("FeatureSuggester.xml", roamingType = RoamingType.DISABLED)] storages = [Storage("FeatureSuggester.xml", roamingType = RoamingType.DISABLED)]
) )
class FeatureSuggesterSettings : PersistentStateComponent<FeatureSuggesterSettings> { internal class FeatureSuggesterSettings : PersistentStateComponent<FeatureSuggesterSettings> {
var suggesters: MutableMap<String, Boolean> = run { var suggesters: MutableMap<String, Boolean> = run {
val enabled = isSuggestersEnabledByDefault val enabled = isSuggestersEnabledByDefault
FeatureSuggester.suggesters.associate { internalId(it.id) to enabled }.toMutableMap() FeatureSuggester.suggesters.associate { internalId(it.id) to enabled }.toMutableMap()
@@ -28,7 +28,7 @@ class FeatureSuggesterSettings : PersistentStateComponent<FeatureSuggesterSettin
// SuggesterId to the last time this suggestion was shown // SuggesterId to the last time this suggestion was shown
private var suggestionLastShownTime: MutableMap<String, Long> = mutableMapOf() private var suggestionLastShownTime: MutableMap<String, Long> = mutableMapOf()
// List of timestamps (millis) of the first IDE session start for the last days // the list of timestamps (millis) of the first IDE session start for the last days
private var workingDays: MutableList<Long> = mutableListOf() private var workingDays: MutableList<Long> = mutableListOf()
val isAnySuggesterEnabled: Boolean val isAnySuggesterEnabled: Boolean