Compare commits
32 commits
Author | SHA1 | Date | |
---|---|---|---|
ca64d96377 | |||
10ce9b32d2 | |||
ebd08a4913 | |||
a4483cee0e | |||
29471b40f6 | |||
e8746f71c7 | |||
639cce4e3c | |||
de68e65d7a | |||
6da7815895 | |||
83d7c9d932 | |||
11fe03fe49 | |||
2c343eb940 | |||
ae7657ab7c | |||
eeef01498c | |||
0162e53b01 | |||
ae08287d7e | |||
97d22f3054 | |||
13996193ac | |||
d222e527ba | |||
76c233a5b0 | |||
2e0870c883 | |||
5c10704f43 | |||
8a95e75de0 | |||
edbe62efcb | |||
ea69f8b76a | |||
814669b228 | |||
2624002696 | |||
8df2966098 | |||
39faf77f4f | |||
d1739d85e5 | |||
4bf786ec8f | |||
cf158f84b6 |
18 changed files with 35 additions and 37 deletions
|
@ -6,8 +6,8 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm") version "2.1.10" apply false
|
kotlin("jvm") version "1.9.24" apply false
|
||||||
kotlin("plugin.serialization") version "2.1.10" apply false
|
kotlin("plugin.serialization") version "1.9.24" apply false
|
||||||
id("org.jetbrains.intellij.platform") version "2.5.0"
|
id("org.jetbrains.intellij.platform") version "2.5.0"
|
||||||
id("org.jetbrains.changelog") version "2.2.1"
|
id("org.jetbrains.changelog") version "2.2.1"
|
||||||
id("org.jetbrains.grammarkit") version "2022.3.2.2" apply false
|
id("org.jetbrains.grammarkit") version "2022.3.2.2" apply false
|
||||||
|
@ -90,7 +90,6 @@ allprojects {
|
||||||
|
|
||||||
intellijPlatform {
|
intellijPlatform {
|
||||||
defaultRepositories()
|
defaultRepositories()
|
||||||
snapshots()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,8 +58,7 @@ class ZigClionDebuggerDriverConfigurationProvider: ZigDebuggerDriverConfiguratio
|
||||||
return when(toolchain.debuggerKind) {
|
return when(toolchain.debuggerKind) {
|
||||||
CPPDebugger.Kind.BUNDLED_GDB,
|
CPPDebugger.Kind.BUNDLED_GDB,
|
||||||
CPPDebugger.Kind.CUSTOM_GDB -> CLionGDBDriverConfiguration(project, toolchain, isEmulateTerminal = emulateTerminal)
|
CPPDebugger.Kind.CUSTOM_GDB -> CLionGDBDriverConfiguration(project, toolchain, isEmulateTerminal = emulateTerminal)
|
||||||
CPPDebugger.Kind.BUNDLED_LLDB,
|
CPPDebugger.Kind.BUNDLED_LLDB -> CLionLLDBDriverConfiguration(project, toolchain, isEmulateTerminal = emulateTerminal)
|
||||||
CPPDebugger.Kind.CUSTOM_LLDB -> CLionLLDBDriverConfiguration(project, toolchain, isEmulateTerminal = emulateTerminal)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,6 @@ import com.intellij.openapi.options.SimpleConfigurable
|
||||||
import com.intellij.util.xmlb.XmlSerializerUtil
|
import com.intellij.util.xmlb.XmlSerializerUtil
|
||||||
import com.intellij.xdebugger.settings.DebuggerSettingsCategory
|
import com.intellij.xdebugger.settings.DebuggerSettingsCategory
|
||||||
import com.intellij.xdebugger.settings.XDebuggerSettings
|
import com.intellij.xdebugger.settings.XDebuggerSettings
|
||||||
import java.util.function.Supplier
|
|
||||||
|
|
||||||
class ZigDebuggerSettings: XDebuggerSettings<ZigDebuggerSettings>("Zig") {
|
class ZigDebuggerSettings: XDebuggerSettings<ZigDebuggerSettings>("Zig") {
|
||||||
var debuggerKind = DebuggerKind.default
|
var debuggerKind = DebuggerKind.default
|
||||||
|
@ -59,10 +58,9 @@ class ZigDebuggerSettings: XDebuggerSettings<ZigDebuggerSettings>("Zig") {
|
||||||
GENERAL_SETTINGS_ID,
|
GENERAL_SETTINGS_ID,
|
||||||
ZigDebugBundle.message("settings.debugger.title"),
|
ZigDebugBundle.message("settings.debugger.title"),
|
||||||
ZigDebuggerGeneralSettingsConfigurableUi::class.java,
|
ZigDebuggerGeneralSettingsConfigurableUi::class.java,
|
||||||
Supplier {
|
) {
|
||||||
instance
|
instance
|
||||||
}
|
}
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
|
@ -160,6 +160,7 @@ class WorkDirectoryConfigurable(@Transient override val serializedName: String)
|
||||||
class WorkDirectoryConfigModule(private val serializedName: String) : PathConfigModule<WorkDirectoryConfigurable>() {
|
class WorkDirectoryConfigModule(private val serializedName: String) : PathConfigModule<WorkDirectoryConfigurable>() {
|
||||||
private val field = textFieldWithBrowseButton(
|
private val field = textFieldWithBrowseButton(
|
||||||
null,
|
null,
|
||||||
|
ZigBrainsBundle.message("dialog.title.working-directory"),
|
||||||
FileChooserDescriptorFactory.createSingleFolderDescriptor().withTitle(ZigBrainsBundle.message("dialog.title.working-directory"))
|
FileChooserDescriptorFactory.createSingleFolderDescriptor().withTitle(ZigBrainsBundle.message("dialog.title.working-directory"))
|
||||||
).also { Disposer.register(this, it) }
|
).also { Disposer.register(this, it) }
|
||||||
|
|
||||||
|
@ -198,7 +199,8 @@ class FilePathConfigurable(
|
||||||
class FilePathConfigModule(private val serializedName: String, @Nls private val label: String) : PathConfigModule<FilePathConfigurable>() {
|
class FilePathConfigModule(private val serializedName: String, @Nls private val label: String) : PathConfigModule<FilePathConfigurable>() {
|
||||||
private val field = textFieldWithBrowseButton(
|
private val field = textFieldWithBrowseButton(
|
||||||
null,
|
null,
|
||||||
FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor(),
|
null,
|
||||||
|
FileChooserDescriptorFactory.createSingleFileDescriptor(),
|
||||||
)
|
)
|
||||||
|
|
||||||
override var stringValue by field::text
|
override var stringValue by field::text
|
||||||
|
|
|
@ -68,7 +68,7 @@ class ZigModuleBuilder: ModuleBuilder() {
|
||||||
internal val peer = ZigProjectGeneratorPeer(true).also { Disposer.register(parent ?: return@also) {it.dispose()} }
|
internal val peer = ZigProjectGeneratorPeer(true).also { Disposer.register(parent ?: return@also) {it.dispose()} }
|
||||||
|
|
||||||
override fun getComponent(): JComponent {
|
override fun getComponent(): JComponent {
|
||||||
return peer.myComponent.withBorder()
|
return peer.component.withBorder()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun disposeUIResources() {
|
override fun disposeUIResources() {
|
||||||
|
|
|
@ -50,7 +50,7 @@ class ZigNewProjectWizard: LanguageGeneratorNewProjectWizard {
|
||||||
|
|
||||||
override fun setupUI(builder: Panel): Unit = with(builder) {
|
override fun setupUI(builder: Panel): Unit = with(builder) {
|
||||||
row {
|
row {
|
||||||
cell(peer.myComponent).align(AlignX.FILL)
|
cell(peer.component).align(AlignX.FILL)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
package com.falsepattern.zigbrains.project.newproject
|
package com.falsepattern.zigbrains.project.newproject
|
||||||
|
|
||||||
import com.intellij.ide.util.projectWizard.SettingsStep
|
import com.intellij.ide.util.projectWizard.SettingsStep
|
||||||
import com.intellij.openapi.ui.TextFieldWithBrowseButton
|
|
||||||
import com.intellij.openapi.ui.ValidationInfo
|
import com.intellij.openapi.ui.ValidationInfo
|
||||||
import com.intellij.platform.ProjectGeneratorPeer
|
import com.intellij.platform.ProjectGeneratorPeer
|
||||||
import com.intellij.ui.dsl.builder.panel
|
import com.intellij.ui.dsl.builder.panel
|
||||||
|
@ -33,13 +32,12 @@ class ZigProjectGeneratorPeer(var handleGit: Boolean): ProjectGeneratorPeer<ZigP
|
||||||
val newProjectPanel by lazy {
|
val newProjectPanel by lazy {
|
||||||
ZigNewProjectPanel(handleGit)
|
ZigNewProjectPanel(handleGit)
|
||||||
}
|
}
|
||||||
val myComponent: JComponent by lazy {
|
private val myComponent: JComponent by lazy {
|
||||||
panel {
|
panel {
|
||||||
newProjectPanel.attach(this)
|
newProjectPanel.attach(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
override fun getComponent(): JComponent {
|
||||||
override fun getComponent(myLocationField: TextFieldWithBrowseButton, checkValid: Runnable): JComponent {
|
|
||||||
return myComponent
|
return myComponent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ import com.intellij.platform.backend.workspace.toVirtualFileUrl
|
||||||
import com.intellij.platform.workspace.jps.entities.*
|
import com.intellij.platform.workspace.jps.entities.*
|
||||||
import com.intellij.project.isDirectoryBased
|
import com.intellij.project.isDirectoryBased
|
||||||
import com.intellij.project.stateStore
|
import com.intellij.project.stateStore
|
||||||
import com.intellij.workspaceModel.ide.legacyBridge.LegacyBridgeJpsEntitySourceFactory
|
import com.intellij.workspaceModel.ide.impl.LegacyBridgeJpsEntitySourceFactory
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import javax.swing.Icon
|
import javax.swing.Icon
|
||||||
|
@ -122,8 +122,8 @@ class ZigSyntheticLibrary(val project: Project) : SyntheticLibrary(), ItemPresen
|
||||||
builder.resolve(moduleId)?.let { moduleEntity ->
|
builder.resolve(moduleId)?.let { moduleEntity ->
|
||||||
builder.removeEntity(moduleEntity)
|
builder.removeEntity(moduleEntity)
|
||||||
}
|
}
|
||||||
val moduleEntitySource = LegacyBridgeJpsEntitySourceFactory.getInstance(project)
|
val moduleEntitySource = LegacyBridgeJpsEntitySourceFactory
|
||||||
.createEntitySourceForModule(baseModuleDir, null)
|
.createEntitySourceForModule(project, baseModuleDir, null)
|
||||||
|
|
||||||
val moduleEntity = builder.addEntity(ModuleEntity(ZIG_MODULE_ID, emptyList(), moduleEntitySource))
|
val moduleEntity = builder.addEntity(ModuleEntity(ZIG_MODULE_ID, emptyList(), moduleEntitySource))
|
||||||
|
|
||||||
|
@ -131,8 +131,7 @@ class ZigSyntheticLibrary(val project: Project) : SyntheticLibrary(), ItemPresen
|
||||||
builder.removeEntity(libraryEntity)
|
builder.removeEntity(libraryEntity)
|
||||||
}
|
}
|
||||||
val libraryEntitySource = LegacyBridgeJpsEntitySourceFactory
|
val libraryEntitySource = LegacyBridgeJpsEntitySourceFactory
|
||||||
.getInstance(project)
|
.createEntitySourceForProjectLibrary(project, null)
|
||||||
.createEntitySourceForProjectLibrary(null)
|
|
||||||
val libraryEntity = LibraryEntity(
|
val libraryEntity = LibraryEntity(
|
||||||
ZIG_LIBRARY_ID,
|
ZIG_LIBRARY_ID,
|
||||||
libraryTableId, emptyList(),
|
libraryTableId, emptyList(),
|
||||||
|
|
|
@ -56,7 +56,7 @@ class LocalToolchainSelector(component: Component): LocalSelector<LocalZigToolch
|
||||||
} else {
|
} else {
|
||||||
val existingToolchain = zigToolchainList
|
val existingToolchain = zigToolchainList
|
||||||
.mapNotNull { it.second as? LocalZigToolchain }
|
.mapNotNull { it.second as? LocalZigToolchain }
|
||||||
.firstOrNull { it.location == tc.location }
|
.firstOrNull { it.location == tc!!.location }
|
||||||
if (existingToolchain != null) {
|
if (existingToolchain != null) {
|
||||||
result = VerifyResult(
|
result = VerifyResult(
|
||||||
null,
|
null,
|
||||||
|
|
|
@ -47,7 +47,8 @@ import kotlin.io.path.pathString
|
||||||
class LocalZigToolchainPanel() : ImmutableNamedElementPanelBase<LocalZigToolchain>() {
|
class LocalZigToolchainPanel() : ImmutableNamedElementPanelBase<LocalZigToolchain>() {
|
||||||
private val pathToToolchain = textFieldWithBrowseButton(
|
private val pathToToolchain = textFieldWithBrowseButton(
|
||||||
null,
|
null,
|
||||||
FileChooserDescriptorFactory.createSingleFolderDescriptor().withTitle(ZigBrainsBundle.message("dialog.title.zig-toolchain"))
|
ZigBrainsBundle.message("dialog.title.zig-toolchain"),
|
||||||
|
FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||||
).also {
|
).also {
|
||||||
it.textField.document.addDocumentListener(object : DocumentAdapter() {
|
it.textField.document.addDocumentListener(object : DocumentAdapter() {
|
||||||
override fun textChanged(e: DocumentEvent) {
|
override fun textChanged(e: DocumentEvent) {
|
||||||
|
@ -69,7 +70,8 @@ class LocalZigToolchainPanel() : ImmutableNamedElementPanelBase<LocalZigToolchai
|
||||||
}
|
}
|
||||||
private val pathToStd = textFieldWithBrowseButton(
|
private val pathToStd = textFieldWithBrowseButton(
|
||||||
null,
|
null,
|
||||||
FileChooserDescriptorFactory.createSingleFolderDescriptor().withTitle(ZigBrainsBundle.message("dialog.title.zig-std"))
|
ZigBrainsBundle.message("dialog.title.zig-std"),
|
||||||
|
FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||||
).also { Disposer.register(this, it) }
|
).also { Disposer.register(this, it) }
|
||||||
private var debounce: Job? = null
|
private var debounce: Job? = null
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ import kotlinx.coroutines.*
|
||||||
import java.awt.Component
|
import java.awt.Component
|
||||||
import kotlin.coroutines.CoroutineContext
|
import kotlin.coroutines.CoroutineContext
|
||||||
|
|
||||||
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) {
|
return if (application.isDispatchThread) {
|
||||||
runWithModalProgressBlocking(taskOwnerFactory(), titleFactory(), cancellationFactory(), action)
|
runWithModalProgressBlocking(taskOwnerFactory(), titleFactory(), cancellationFactory(), action)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -96,7 +96,7 @@ abstract class Downloader<T, V: VersionInfo>(val component: Component) {
|
||||||
value?.let { append(it.version.rawVersion) }
|
value?.let { append(it.version.rawVersion) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val outputPath = textFieldWithBrowseButton(null, selector.descriptor)
|
val outputPath = textFieldWithBrowseButton(null, selector.descriptor.title, selector.descriptor)
|
||||||
Disposer.register(dialog, outputPath)
|
Disposer.register(dialog, outputPath)
|
||||||
outputPath.textField.columns = 50
|
outputPath.textField.columns = 50
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ abstract class LocalSelector<T>(val component: Component) {
|
||||||
private suspend fun doBrowseFromDisk(preSelected: Path?): T? {
|
private suspend fun doBrowseFromDisk(preSelected: Path?): T? {
|
||||||
val dialog = DialogBuilder()
|
val dialog = DialogBuilder()
|
||||||
val name = JBTextField().also { it.columns = 25 }
|
val name = JBTextField().also { it.columns = 25 }
|
||||||
val path = textFieldWithBrowseButton(null, descriptor)
|
val path = textFieldWithBrowseButton(null, descriptor.title, descriptor)
|
||||||
Disposer.register(dialog, path)
|
Disposer.register(dialog, path)
|
||||||
lateinit var errorMessageBox: JBLabel
|
lateinit var errorMessageBox: JBLabel
|
||||||
suspend fun verifyAndUpdate(path: Path?) {
|
suspend fun verifyAndUpdate(path: Path?) {
|
||||||
|
|
|
@ -87,7 +87,7 @@ abstract class UUIDMapSelector<T>(val driver: UUIDComboBoxDriver<T>): Disposable
|
||||||
val actual = item is ListElem.One.Actual<*>
|
val actual = item is ListElem.One.Actual<*>
|
||||||
editButton?.isEnabled = actual
|
editButton?.isEnabled = actual
|
||||||
editButton?.repaint()
|
editButton?.repaint()
|
||||||
onSelection(if (actual) item.uuid else null)
|
onSelection(if (actual) (item as ListElem.One.Actual<*>).uuid else null)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun itemStateChanged(event: ItemEvent) {
|
private fun itemStateChanged(event: ItemEvent) {
|
||||||
|
|
|
@ -3,11 +3,11 @@ pluginRepositoryUrl=https://github.com/FalsePattern/ZigBrains
|
||||||
|
|
||||||
pluginVersion=25.2.0
|
pluginVersion=25.2.0
|
||||||
|
|
||||||
pluginSinceBuild=251
|
pluginSinceBuild=242
|
||||||
pluginUntilBuild=
|
pluginUntilBuild=242.*
|
||||||
|
|
||||||
ideaCommunityVersion=2025.1
|
ideaCommunityVersion=2024.2.5
|
||||||
clionVersion=2025.1
|
clionVersion=2024.2.4
|
||||||
useInstaller=true
|
useInstaller=true
|
||||||
javaVersion=21
|
javaVersion=21
|
||||||
# ideaCommunity / clion
|
# ideaCommunity / clion
|
||||||
|
@ -17,7 +17,7 @@ lsp4jVersion=0.21.1
|
||||||
lsp4ijVersion=0.12.0
|
lsp4ijVersion=0.12.0
|
||||||
lsp4ijNightly=false
|
lsp4ijNightly=false
|
||||||
|
|
||||||
serializationVersion=1.7.3
|
serializationVersion=1.6.3
|
||||||
|
|
||||||
kotlin.stdlib.default.dependency=false
|
kotlin.stdlib.default.dependency=false
|
||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
|
|
|
@ -43,8 +43,8 @@ import javax.swing.text.PlainDocument
|
||||||
class ZLSSettingsPanel() : ImmutableElementPanel<ZLSSettings> {
|
class ZLSSettingsPanel() : ImmutableElementPanel<ZLSSettings> {
|
||||||
private val zlsConfigPath = textFieldWithBrowseButton(
|
private val zlsConfigPath = textFieldWithBrowseButton(
|
||||||
null,
|
null,
|
||||||
|
ZLSBundle.message("settings.zls-config-path.browse.title"),
|
||||||
FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor()
|
FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor()
|
||||||
.withTitle(ZLSBundle.message("settings.zls-config-path.browse.title"))
|
|
||||||
).also { Disposer.register(this, it) }
|
).also { Disposer.register(this, it) }
|
||||||
private val inlayHints = JBCheckBox()
|
private val inlayHints = JBCheckBox()
|
||||||
private val inlayHintsMaxFileSize = ExtendableTextField(5).also { (it.document as PlainDocument).documentFilter = object: DocumentFilter() {
|
private val inlayHintsMaxFileSize = ExtendableTextField(5).also { (it.document as PlainDocument).documentFilter = object: DocumentFilter() {
|
||||||
|
|
|
@ -49,7 +49,8 @@ import kotlin.io.path.pathString
|
||||||
class ZLSPanel() : ImmutableNamedElementPanelBase<ZLSVersion>() {
|
class ZLSPanel() : ImmutableNamedElementPanelBase<ZLSVersion>() {
|
||||||
private val pathToZLS = textFieldWithBrowseButton(
|
private val pathToZLS = textFieldWithBrowseButton(
|
||||||
null,
|
null,
|
||||||
FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor().withTitle(ZLSBundle.message("dialog.title.zls"))
|
ZLSBundle.message("dialog.title.zls"),
|
||||||
|
FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor()
|
||||||
).also {
|
).also {
|
||||||
it.textField.document.addDocumentListener(object : DocumentAdapter() {
|
it.textField.document.addDocumentListener(object : DocumentAdapter() {
|
||||||
override fun textChanged(e: DocumentEvent) {
|
override fun textChanged(e: DocumentEvent) {
|
||||||
|
|
|
@ -52,7 +52,7 @@ data class ZLSVersionInfo(
|
||||||
return withContext(Dispatchers.IO) {
|
return withContext(Dispatchers.IO) {
|
||||||
val single = toolchain != null
|
val single = toolchain != null
|
||||||
val url = if (single) {
|
val url = if (single) {
|
||||||
getToolchainURL(toolchain, project) ?: return@withContext emptyList()
|
getToolchainURL(toolchain!!, project) ?: return@withContext emptyList()
|
||||||
} else {
|
} else {
|
||||||
multiURL
|
multiURL
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue