mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-39742 Delete completion.stats.show.ml.ranking.diff from registry
GitOrigin-RevId: 4525b1388c3cd51c38b25a4e03e0c2b3563346af
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ca23bb270d
commit
ab4bff1872
@@ -77,9 +77,6 @@
|
||||
<registryKey key="completion.stats.exit.experiment" defaultValue="false"
|
||||
description="Do not perform A/B experiment for code completion on this installation"/>
|
||||
|
||||
<registryKey key="completion.stats.show.ml.ranking.diff" defaultValue="false"
|
||||
description="Show how element position changed after ml ranking performed, if ml completion ranking is enabled"/>
|
||||
|
||||
<registryKey key="completion.stats.send.logs" defaultValue="true"
|
||||
description="Send anonymous logs about completion usage in EAP builds"/>
|
||||
|
||||
|
||||
+8
-2
@@ -34,7 +34,7 @@ public class CompletionMLRankingSettings implements PersistentStateComponent<Com
|
||||
}
|
||||
|
||||
public boolean isShowDiffEnabled() {
|
||||
return myState.showDiff || Registry.is("completion.stats.show.ml.ranking.diff", false);
|
||||
return myState.rankingEnabled && myState.showDiff;
|
||||
}
|
||||
|
||||
void setRankingEnabled(boolean value) {
|
||||
@@ -61,6 +61,10 @@ public class CompletionMLRankingSettings implements PersistentStateComponent<Com
|
||||
logCompletionState(languageName, isEnabled);
|
||||
}
|
||||
|
||||
public void setShowDiffEnabled(boolean isEnabled) {
|
||||
myState.showDiff = isEnabled;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public State getState() {
|
||||
@@ -70,12 +74,14 @@ public class CompletionMLRankingSettings implements PersistentStateComponent<Com
|
||||
@Override
|
||||
public void loadState(@NotNull State state) {
|
||||
myState.rankingEnabled = state.rankingEnabled;
|
||||
myState.showDiff = state.showDiff;
|
||||
state.language2state.forEach((lang, enabled) -> setLanguageEnabled(lang, enabled));
|
||||
}
|
||||
|
||||
private void logCompletionState(@NotNull String languageName, boolean isEnabled) {
|
||||
final boolean enabled = myState.rankingEnabled && isEnabled;
|
||||
LOG.info("ML Completion " + (enabled ? "enabled" : "disabled") + " for: " + languageName);
|
||||
final boolean showDiff = enabled && myState.showDiff;
|
||||
LOG.info("ML Completion " + (enabled ? "enabled" : "disabled") + " ,show diff " + (showDiff ? "on" : "off") + " for: " + languageName);
|
||||
}
|
||||
|
||||
public static class State {
|
||||
|
||||
+3
-4
@@ -7,6 +7,7 @@ import com.intellij.openapi.ui.DialogPanel
|
||||
import com.intellij.openapi.util.registry.Registry
|
||||
import com.intellij.ui.components.JBCheckBox
|
||||
import com.intellij.ui.layout.*
|
||||
import com.intellij.util.PlatformUtils
|
||||
|
||||
class MLRankingConfigurable(private val supportedLanguages: List<String>)
|
||||
: BoundConfigurable("ML Ranking") {
|
||||
@@ -27,14 +28,12 @@ class MLRankingConfigurable(private val supportedLanguages: List<String>)
|
||||
}
|
||||
enableRankingCheckbox = enableRanking
|
||||
}
|
||||
val registry = Registry.get("completion.stats.show.ml.ranking.diff")
|
||||
row {
|
||||
enableRankingCheckbox?.let { enableRanking ->
|
||||
checkBox(StatsCollectorBundle.message("ml.completion.show.diff"),
|
||||
{ registry.asBoolean() },
|
||||
{ registry.setValue(it) }).enableIf(enableRanking.selected)
|
||||
{ settings.isShowDiffEnabled },
|
||||
{ settings.isShowDiffEnabled = it }).enableIf(enableRanking.selected)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.stats.experiment
|
||||
|
||||
import com.intellij.completion.settings.CompletionMLRankingSettings
|
||||
import com.intellij.ide.util.PropertiesComponent
|
||||
import com.intellij.internal.statistic.DeviceIdManager
|
||||
import com.intellij.lang.Language
|
||||
@@ -51,7 +52,7 @@ class EmulatedExperiment {
|
||||
private fun enableOnceDiffShowing() {
|
||||
val properties = PropertiesComponent.getInstance()
|
||||
if (!properties.getBoolean(DIFF_ENABLED_PROPERTY_KEY, false)) {
|
||||
Registry.get("completion.stats.show.ml.ranking.diff").setValue(true)
|
||||
CompletionMLRankingSettings.getInstance().isShowDiffEnabled = true
|
||||
properties.setValue(DIFF_ENABLED_PROPERTY_KEY, true)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user