Compare commits

..

32 commits
master ... 242

Author SHA1 Message Date
ca64d96377
backport: 25.2.0 2025-04-20 16:10:48 +02:00
10ce9b32d2
backport: 25.1.0 2025-04-17 13:58:55 +02:00
ebd08a4913
backport: 25.0.2 2025-04-16 00:44:26 +02:00
a4483cee0e
backport: 25.0.1 2025-04-11 18:51:58 +02:00
29471b40f6
backport: 25.0.0 2025-04-11 18:38:57 +02:00
e8746f71c7
backport: 24.0.1 2025-03-27 23:05:16 +01:00
639cce4e3c
backport: 24.0.0 2025-03-27 22:07:22 +01:00
de68e65d7a
backport: 23.1.2 2025-03-27 11:50:49 +01:00
6da7815895
backport: 23.1.1 2025-03-26 23:34:11 +01:00
83d7c9d932
backport: 23.1.0 2025-03-26 16:23:50 +01:00
11fe03fe49
backport: 23.0.2 2025-03-23 14:42:03 +01:00
2c343eb940
backport: 23.0.1 2025-03-20 00:20:07 +01:00
ae7657ab7c
backport: 23.0.0 2025-03-15 16:52:12 +01:00
eeef01498c
backport: 22.0.1 2025-03-13 23:08:40 +01:00
0162e53b01
backport: 22.0.0 2025-03-13 16:41:17 +01:00
ae08287d7e
backport: 21.1.0 2025-03-11 14:21:24 +01:00
97d22f3054
backport: 21.0.0 2025-03-11 01:56:58 +01:00
13996193ac
backport: 20.3.0 2025-02-05 22:26:00 +01:00
d222e527ba
backport: 20.2.2 2025-01-30 13:27:03 +01:00
76c233a5b0
backport: 20.2.1 2025-01-22 12:29:49 +01:00
2e0870c883
backport: 20.2.0 2025-01-21 15:52:15 +01:00
5c10704f43
backport: 20.1.3 2025-01-15 20:16:25 +01:00
8a95e75de0
backport: 20.1.2 2025-01-12 14:41:46 +01:00
edbe62efcb
backport: 20.1.1 2024-12-24 12:54:36 +01:00
ea69f8b76a
backport: 20.1.0 2024-12-22 23:12:02 +01:00
814669b228
backport: 20.0.4 2024-12-11 17:15:23 +01:00
2624002696
backport: 20.0.3 2024-11-28 13:28:54 +01:00
8df2966098
backport: 20.0.2 2024-11-11 12:18:04 +01:00
39faf77f4f
backport: 20.0.1 2024-11-09 12:02:29 +01:00
d1739d85e5
ci: publishing fixes 2024-11-07 17:50:28 +01:00
4bf786ec8f
backport: 20.0.0 2024-11-07 17:21:06 +01:00
cf158f84b6
ci: lock to 2024.2 2024-11-07 17:07:56 +01:00
18 changed files with 35 additions and 37 deletions

View file

@ -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()
} }
} }
} }

View file

@ -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)
} }
} }
} }

View file

@ -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 {

View file

@ -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

View file

@ -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() {

View file

@ -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)
} }
} }

View file

@ -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
} }

View file

@ -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(),

View file

@ -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,

View file

@ -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

View file

@ -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 {

View file

@ -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

View file

@ -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?) {

View file

@ -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) {

View file

@ -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

View file

@ -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() {

View file

@ -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) {

View file

@ -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
} }