mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 06:50:54 +07:00
[inlay hints] fix settings saving (WEB-60172)
GitOrigin-RevId: 1816515041e4d6506b5aa12b4c7b3f2ce6912272
This commit is contained in:
committed by
intellij-monorepo-bot
parent
cf86210836
commit
c527a543a3
@@ -35,11 +35,16 @@ class DeclarativeInlayHintsSettings : SimplePersistentStateComponent<Declarative
|
||||
private fun getSerializedId(providerId: String, optionId: String) = "$providerId#$optionId"
|
||||
|
||||
@RequiresWriteLock
|
||||
fun setOptionEnabled(optionId: String, providerId: String, value: Boolean) {
|
||||
if (!value) {
|
||||
state.disabledOptions.add(getSerializedId(providerId, optionId))
|
||||
fun setOptionEnabled(optionId: String, providerId: String, isEnabled: Boolean) {
|
||||
val serializedId = getSerializedId(providerId, optionId)
|
||||
val areSame = state.disabledOptions.contains(serializedId) != isEnabled
|
||||
if (!isEnabled) {
|
||||
state.disabledOptions.add(serializedId)
|
||||
} else {
|
||||
state.disabledOptions.remove(getSerializedId(providerId, optionId))
|
||||
state.disabledOptions.remove(serializedId)
|
||||
}
|
||||
if (!areSame) {
|
||||
state.intIncrementModificationCount()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user