forked from intellij-rust/intellij-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RsCodeInsightSettings.kt
32 lines (25 loc) · 1.01 KB
/
RsCodeInsightSettings.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
* Use of this source code is governed by the MIT license that can be
* found in the LICENSE file.
*/
package org.rust.ide.settings
import com.intellij.openapi.components.PersistentStateComponent
import com.intellij.openapi.components.State
import com.intellij.openapi.components.Storage
import com.intellij.openapi.components.service
import com.intellij.util.xmlb.XmlSerializerUtil
@State(name = "RsCodeInsightSettings", storages = [Storage("rust.xml")])
class RsCodeInsightSettings : PersistentStateComponent<RsCodeInsightSettings> {
var showImportPopup: Boolean = false
var importOutOfScopeItems: Boolean = true
var suggestOutOfScopeItems: Boolean = true
var addUnambiguousImportsOnTheFly: Boolean = false
var importOnPaste: Boolean = true
override fun getState(): RsCodeInsightSettings = this
override fun loadState(state: RsCodeInsightSettings) {
XmlSerializerUtil.copyBean(state, this)
}
companion object {
fun getInstance(): RsCodeInsightSettings = service()
}
}