chore: [NO BACKPORT] Fix deprecations
This commit is contained in:
parent
f704b6c936
commit
28527cddb4
7 changed files with 17 additions and 17 deletions
|
@ -29,6 +29,7 @@ import com.intellij.openapi.options.SimpleConfigurable
|
|||
import com.intellij.util.xmlb.XmlSerializerUtil
|
||||
import com.intellij.xdebugger.settings.DebuggerSettingsCategory
|
||||
import com.intellij.xdebugger.settings.XDebuggerSettings
|
||||
import java.util.function.Supplier
|
||||
|
||||
class ZigDebuggerSettings: XDebuggerSettings<ZigDebuggerSettings>("Zig") {
|
||||
var debuggerKind = DebuggerKind.default
|
||||
|
@ -58,9 +59,10 @@ class ZigDebuggerSettings: XDebuggerSettings<ZigDebuggerSettings>("Zig") {
|
|||
GENERAL_SETTINGS_ID,
|
||||
ZigDebugBundle.message("settings.debugger.title"),
|
||||
ZigDebuggerGeneralSettingsConfigurableUi::class.java,
|
||||
) {
|
||||
Supplier {
|
||||
instance
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
@ -46,13 +46,11 @@ import kotlin.io.path.pathString
|
|||
class ZLSSettingsPanel(private val project: Project?) : Disposable {
|
||||
private val zlsPath = textFieldWithBrowseButton(
|
||||
project,
|
||||
ZLSBundle.message("settings.zls-path.browse.title"),
|
||||
FileChooserDescriptorFactory.createSingleFileDescriptor(),
|
||||
FileChooserDescriptorFactory.createSingleFileDescriptor().withTitle(ZLSBundle.message("settings.zls-path.browse.title")),
|
||||
).also { Disposer.register(this, it) }
|
||||
private val zlsConfigPath = textFieldWithBrowseButton(
|
||||
project,
|
||||
ZLSBundle.message("settings.zls-config-path.browse.title"),
|
||||
FileChooserDescriptorFactory.createSingleFileDescriptor()
|
||||
FileChooserDescriptorFactory.createSingleFileDescriptor().withTitle(ZLSBundle.message("settings.zls-config-path.browse.title"))
|
||||
).also { Disposer.register(this, it) }
|
||||
|
||||
private val buildOnSave = JBCheckBox().apply { toolTipText = ZLSBundle.message("settings.build-on-save.tooltip") }
|
||||
|
|
|
@ -67,7 +67,7 @@ class ZigModuleBuilder: ModuleBuilder() {
|
|||
internal val peer = ZigProjectGeneratorPeer(true)
|
||||
|
||||
override fun getComponent(): JComponent {
|
||||
return peer.component.withBorder()
|
||||
return peer.myComponent.withBorder()
|
||||
}
|
||||
|
||||
override fun disposeUIResources() {
|
||||
|
|
|
@ -50,7 +50,7 @@ class ZigNewProjectWizard: LanguageGeneratorNewProjectWizard {
|
|||
|
||||
override fun setupUI(builder: Panel): Unit = with(builder) {
|
||||
row {
|
||||
cell(peer.component).align(AlignX.FILL)
|
||||
cell(peer.myComponent).align(AlignX.FILL)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ package com.falsepattern.zigbrains.project.newproject
|
|||
|
||||
import com.intellij.ide.util.projectWizard.SettingsStep
|
||||
import com.intellij.openapi.Disposable
|
||||
import com.intellij.openapi.ui.TextFieldWithBrowseButton
|
||||
import com.intellij.openapi.ui.ValidationInfo
|
||||
import com.intellij.openapi.util.Disposer
|
||||
import com.intellij.platform.ProjectGeneratorPeer
|
||||
|
@ -32,12 +33,13 @@ import javax.swing.JComponent
|
|||
|
||||
class ZigProjectGeneratorPeer(var handleGit: Boolean): ProjectGeneratorPeer<ZigProjectConfigurationData>, Disposable {
|
||||
private val newProjectPanel: ZigNewProjectPanel = ZigNewProjectPanel(handleGit).also { Disposer.register(this, it) }
|
||||
private val myComponent: JComponent by lazy {
|
||||
val myComponent: JComponent by lazy {
|
||||
panel {
|
||||
newProjectPanel.attach(this)
|
||||
}
|
||||
}
|
||||
override fun getComponent(): JComponent {
|
||||
|
||||
override fun getComponent(myLocationField: TextFieldWithBrowseButton, checkValid: Runnable): JComponent {
|
||||
return myComponent
|
||||
}
|
||||
|
||||
|
|
|
@ -59,8 +59,7 @@ class ZigProjectSettingsPanel(private val project: Project?) : Disposable {
|
|||
private val direnv = JBCheckBox(ZigBrainsBundle.message("settings.project.label.direnv"))
|
||||
private val pathToToolchain = textFieldWithBrowseButton(
|
||||
project,
|
||||
ZigBrainsBundle.message("dialog.title.zig-toolchain"),
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor().withTitle(ZigBrainsBundle.message("dialog.title.zig-toolchain"))
|
||||
).also {
|
||||
it.textField.document.addDocumentListener(object : DocumentAdapter() {
|
||||
override fun textChanged(e: DocumentEvent) {
|
||||
|
@ -82,8 +81,7 @@ class ZigProjectSettingsPanel(private val project: Project?) : Disposable {
|
|||
}
|
||||
private val pathToStd = textFieldWithBrowseButton(
|
||||
project,
|
||||
ZigBrainsBundle.message("dialog.title.zig-std"),
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor().withTitle(ZigBrainsBundle.message("dialog.title.zig-std"))
|
||||
).also { Disposer.register(this, it) }
|
||||
private var debounce: Job? = null
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ import com.intellij.util.SuspendingLazy
|
|||
import com.intellij.util.application
|
||||
import kotlinx.coroutines.*
|
||||
|
||||
inline fun <T> runModalOrBlocking(taskOwnerFactory: () -> ModalTaskOwner, titleFactory: () -> String, cancellationFactory: () -> TaskCancellation = TaskCancellation::cancellable, noinline action: suspend CoroutineScope.() -> T): T {
|
||||
inline fun <T> runModalOrBlocking(taskOwnerFactory: () -> ModalTaskOwner, titleFactory: () -> String, cancellationFactory: () -> TaskCancellation = {TaskCancellation.cancellable()}, noinline action: suspend CoroutineScope.() -> T): T {
|
||||
return if (application.isDispatchThread) {
|
||||
runWithModalProgressBlocking(taskOwnerFactory(), titleFactory(), cancellationFactory(), action)
|
||||
} else {
|
||||
|
@ -40,7 +40,7 @@ inline fun <T> runModalOrBlocking(taskOwnerFactory: () -> ModalTaskOwner, titleF
|
|||
}
|
||||
}
|
||||
|
||||
inline fun <T> SuspendingLazy<T>.getOrAwaitModalOrBlocking(taskOwnerFactory: () -> ModalTaskOwner, titleFactory: () -> String, cancellationFactory: () -> TaskCancellation = TaskCancellation::cancellable): T {
|
||||
inline fun <T> SuspendingLazy<T>.getOrAwaitModalOrBlocking(taskOwnerFactory: () -> ModalTaskOwner, titleFactory: () -> String, cancellationFactory: () -> TaskCancellation = {TaskCancellation.cancellable()}): T {
|
||||
if (isInitialized()) {
|
||||
return getInitialized()
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue