backport: 25.1.0
This commit is contained in:
parent
85aacf0b96
commit
8209e688fc
12 changed files with 69 additions and 13 deletions
|
@ -17,6 +17,15 @@ Changelog structure reference:
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [25.1.0]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- IDEA 2025.1 support
|
||||||
|
|
||||||
|
- LSP
|
||||||
|
- Configurable inlay hints file size limit to reduce IDE lag
|
||||||
|
|
||||||
## [25.0.2]
|
## [25.0.2]
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
@ -15,6 +15,7 @@ through the built-in plugin browser:
|
||||||
1. Go to `Settings -> Plugins`
|
1. Go to `Settings -> Plugins`
|
||||||
2. To the right of the `Installed` button at the top, click on the `...` dropdown menu, then select `Manage Plugin Repositories...`
|
2. To the right of the `Installed` button at the top, click on the `...` dropdown menu, then select `Manage Plugin Repositories...`
|
||||||
3. Click the add button, and then enter the ZigBrains updater URL, based on your IDE version:
|
3. Click the add button, and then enter the ZigBrains updater URL, based on your IDE version:
|
||||||
|
- `2025.1.*` or newer: https://falsepattern.com/zigbrains/updatePlugins-251.xml
|
||||||
- `2024.3.*`: https://falsepattern.com/zigbrains/updatePlugins-243.xml
|
- `2024.3.*`: https://falsepattern.com/zigbrains/updatePlugins-243.xml
|
||||||
- `2024.2.*`: https://falsepattern.com/zigbrains/updatePlugins-242.xml
|
- `2024.2.*`: https://falsepattern.com/zigbrains/updatePlugins-242.xml
|
||||||
- `2024.1.*`: https://falsepattern.com/zigbrains/updatePlugins-241.xml
|
- `2024.1.*`: https://falsepattern.com/zigbrains/updatePlugins-241.xml
|
||||||
|
|
|
@ -14,7 +14,7 @@ plugins {
|
||||||
idea
|
idea
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
}
|
}
|
||||||
val publishVersions = listOf("241", "242", "243")
|
val publishVersions = listOf("241", "242", "243", "251")
|
||||||
val pluginVersionFull get() = "$pluginVersion-$pluginSinceBuild"
|
val pluginVersionFull get() = "$pluginVersion-$pluginSinceBuild"
|
||||||
val pluginVersion: String by project
|
val pluginVersion: String by project
|
||||||
val pluginSinceBuild: String by project
|
val pluginSinceBuild: String by project
|
||||||
|
|
2
build.sh
2
build.sh
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
declare -a branches=("master" "242" "241")
|
declare -a branches=("master" "243" "242" "241")
|
||||||
|
|
||||||
DEFAULT_BRANCH="${branches[0]}"
|
DEFAULT_BRANCH="${branches[0]}"
|
||||||
|
|
||||||
|
|
|
@ -9,12 +9,15 @@ plugins {
|
||||||
|
|
||||||
val ideaCommunityVersion: String by project
|
val ideaCommunityVersion: String by project
|
||||||
val useInstaller = property("useInstaller").toString().toBoolean()
|
val useInstaller = property("useInstaller").toString().toBoolean()
|
||||||
|
val serializationVersion: String by project
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
intellijPlatform {
|
intellijPlatform {
|
||||||
create(IntelliJPlatformType.IntellijIdeaCommunity, ideaCommunityVersion, useInstaller = useInstaller)
|
create(IntelliJPlatformType.IntellijIdeaCommunity, ideaCommunityVersion, useInstaller = useInstaller)
|
||||||
}
|
}
|
||||||
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-core:1.7.3")
|
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:$serializationVersion") {
|
||||||
|
isTransitive = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//region grammars
|
//region grammars
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
pluginName=ZigBrains
|
pluginName=ZigBrains
|
||||||
pluginRepositoryUrl=https://github.com/FalsePattern/ZigBrains
|
pluginRepositoryUrl=https://github.com/FalsePattern/ZigBrains
|
||||||
|
|
||||||
pluginVersion=25.0.2
|
pluginVersion=25.1.0
|
||||||
|
|
||||||
pluginSinceBuild=243
|
pluginSinceBuild=243
|
||||||
pluginUntilBuild=243.*
|
pluginUntilBuild=243.*
|
||||||
|
@ -17,6 +17,8 @@ lsp4jVersion=0.21.1
|
||||||
lsp4ijVersion=0.12.0
|
lsp4ijVersion=0.12.0
|
||||||
lsp4ijNightly=false
|
lsp4ijNightly=false
|
||||||
|
|
||||||
|
serializationVersion=1.6.3
|
||||||
|
|
||||||
kotlin.stdlib.default.dependency=false
|
kotlin.stdlib.default.dependency=false
|
||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
org.gradle.configuration-cache=true
|
org.gradle.configuration-cache=true
|
||||||
|
|
|
@ -8,12 +8,15 @@ val lsp4ijVersion: String by project
|
||||||
val lsp4jVersion: String by project
|
val lsp4jVersion: String by project
|
||||||
val ideaCommunityVersion: String by project
|
val ideaCommunityVersion: String by project
|
||||||
val useInstaller = property("useInstaller").toString().toBoolean()
|
val useInstaller = property("useInstaller").toString().toBoolean()
|
||||||
|
val serializationVersion: String by project
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
intellijPlatform {
|
intellijPlatform {
|
||||||
create(IntelliJPlatformType.IntellijIdeaCommunity, ideaCommunityVersion, useInstaller = useInstaller)
|
create(IntelliJPlatformType.IntellijIdeaCommunity, ideaCommunityVersion, useInstaller = useInstaller)
|
||||||
}
|
}
|
||||||
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-core:1.7.3")
|
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:$serializationVersion") {
|
||||||
|
isTransitive = false
|
||||||
|
}
|
||||||
compileOnly("com.redhat.devtools.intellij:lsp4ij:$lsp4ijVersion")
|
compileOnly("com.redhat.devtools.intellij:lsp4ij:$lsp4ijVersion")
|
||||||
compileOnly("org.eclipse.lsp4j:org.eclipse.lsp4j:$lsp4jVersion")
|
compileOnly("org.eclipse.lsp4j:org.eclipse.lsp4j:$lsp4jVersion")
|
||||||
implementation(project(":core")) {
|
implementation(project(":core")) {
|
||||||
|
|
|
@ -68,7 +68,14 @@ class ZigLanguageServerFactory: LanguageServerFactory, LanguageServerEnablementS
|
||||||
}
|
}
|
||||||
features.inlayHintFeature = object: LSPInlayHintFeature() {
|
features.inlayHintFeature = object: LSPInlayHintFeature() {
|
||||||
override fun isEnabled(file: PsiFile): Boolean {
|
override fun isEnabled(file: PsiFile): Boolean {
|
||||||
return project.zls?.settings?.inlayHints == true
|
val settings = project.zls?.settings ?: return false
|
||||||
|
if (!settings.inlayHints)
|
||||||
|
return false
|
||||||
|
val maxFileSizeKb = settings.inlayHintsMaxFileSizeKb
|
||||||
|
if (maxFileSizeKb == 0)
|
||||||
|
return true
|
||||||
|
val fileSizeKb = file.fileDocument.textLength / 1024
|
||||||
|
return fileSizeKb <= maxFileSizeKb
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return features
|
return features
|
||||||
|
|
|
@ -30,6 +30,7 @@ import org.jetbrains.annotations.NonNls
|
||||||
data class ZLSSettings(
|
data class ZLSSettings(
|
||||||
@JvmField @Attribute val zlsConfigPath: @NonNls String = "",
|
@JvmField @Attribute val zlsConfigPath: @NonNls String = "",
|
||||||
@JvmField @Attribute val inlayHints: Boolean = true,
|
@JvmField @Attribute val inlayHints: Boolean = true,
|
||||||
|
@JvmField @Attribute val inlayHintsMaxFileSizeKb: Int = 128,
|
||||||
@JvmField @Attribute val enable_snippets: Boolean = true,
|
@JvmField @Attribute val enable_snippets: Boolean = true,
|
||||||
@JvmField @Attribute val enable_argument_placeholders: Boolean = true,
|
@JvmField @Attribute val enable_argument_placeholders: Boolean = true,
|
||||||
@JvmField @Attribute val completion_label_details: Boolean = true,
|
@JvmField @Attribute val completion_label_details: Boolean = true,
|
||||||
|
|
|
@ -35,6 +35,9 @@ import com.intellij.ui.dsl.builder.AlignX
|
||||||
import com.intellij.ui.dsl.builder.Panel
|
import com.intellij.ui.dsl.builder.Panel
|
||||||
import com.intellij.ui.dsl.builder.Row
|
import com.intellij.ui.dsl.builder.Row
|
||||||
import org.jetbrains.annotations.PropertyKey
|
import org.jetbrains.annotations.PropertyKey
|
||||||
|
import javax.swing.text.AttributeSet
|
||||||
|
import javax.swing.text.DocumentFilter
|
||||||
|
import javax.swing.text.PlainDocument
|
||||||
|
|
||||||
@Suppress("PrivatePropertyName")
|
@Suppress("PrivatePropertyName")
|
||||||
class ZLSSettingsPanel() : ImmutableElementPanel<ZLSSettings> {
|
class ZLSSettingsPanel() : ImmutableElementPanel<ZLSSettings> {
|
||||||
|
@ -44,6 +47,27 @@ class ZLSSettingsPanel() : ImmutableElementPanel<ZLSSettings> {
|
||||||
.withTitle(ZLSBundle.message("settings.zls-config-path.browse.title"))
|
.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() {
|
||||||
|
override fun insertString(fb: FilterBypass?, offset: Int, string: String?, attr: AttributeSet?) {
|
||||||
|
if (string != null && !string.isEmpty() && string.toIntOrNull() == null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
super.insertString(fb, offset, string, attr)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun replace(
|
||||||
|
fb: FilterBypass?,
|
||||||
|
offset: Int,
|
||||||
|
length: Int,
|
||||||
|
text: String?,
|
||||||
|
attrs: AttributeSet?
|
||||||
|
) {
|
||||||
|
if (text != null && !text.isEmpty() && text.toIntOrNull() == null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
super.replace(fb, offset, length, text, attrs)
|
||||||
|
}
|
||||||
|
} }
|
||||||
private val enable_snippets = JBCheckBox()
|
private val enable_snippets = JBCheckBox()
|
||||||
private val enable_argument_placeholders = JBCheckBox()
|
private val enable_argument_placeholders = JBCheckBox()
|
||||||
private val completion_label_details = JBCheckBox()
|
private val completion_label_details = JBCheckBox()
|
||||||
|
@ -99,6 +123,13 @@ class ZLSSettingsPanel() : ImmutableElementPanel<ZLSSettings> {
|
||||||
"settings.inlay-hints-enable.label",
|
"settings.inlay-hints-enable.label",
|
||||||
"settings.inlay-hints-enable.tooltip"
|
"settings.inlay-hints-enable.tooltip"
|
||||||
) { cell(inlayHints) }
|
) { cell(inlayHints) }
|
||||||
|
fancyRow(
|
||||||
|
"settings.inlay-hints-max-size.label",
|
||||||
|
"settings.inlay-hints-max-size.tooltip",
|
||||||
|
) {
|
||||||
|
cell(inlayHintsMaxFileSize)
|
||||||
|
text(ZLSBundle.message("settings.inlay-hints-max-size.unit"))
|
||||||
|
}
|
||||||
fancyRow(
|
fancyRow(
|
||||||
"settings.inlay_hints_show_variable_type_hints.label",
|
"settings.inlay_hints_show_variable_type_hints.label",
|
||||||
"settings.inlay_hints_show_variable_type_hints.tooltip"
|
"settings.inlay_hints_show_variable_type_hints.tooltip"
|
||||||
|
@ -174,6 +205,7 @@ class ZLSSettingsPanel() : ImmutableElementPanel<ZLSSettings> {
|
||||||
get() = ZLSSettings(
|
get() = ZLSSettings(
|
||||||
zlsConfigPath.text,
|
zlsConfigPath.text,
|
||||||
inlayHints.isSelected,
|
inlayHints.isSelected,
|
||||||
|
inlayHintsMaxFileSize.text.toIntOrNull() ?: 128,
|
||||||
enable_snippets.isSelected,
|
enable_snippets.isSelected,
|
||||||
enable_argument_placeholders.isSelected,
|
enable_argument_placeholders.isSelected,
|
||||||
completion_label_details.isSelected,
|
completion_label_details.isSelected,
|
||||||
|
@ -198,6 +230,7 @@ class ZLSSettingsPanel() : ImmutableElementPanel<ZLSSettings> {
|
||||||
set(value) {
|
set(value) {
|
||||||
zlsConfigPath.text = value.zlsConfigPath
|
zlsConfigPath.text = value.zlsConfigPath
|
||||||
inlayHints.isSelected = value.inlayHints
|
inlayHints.isSelected = value.inlayHints
|
||||||
|
inlayHintsMaxFileSize.text = value.inlayHintsMaxFileSizeKb.toString()
|
||||||
enable_snippets.isSelected = value.enable_snippets
|
enable_snippets.isSelected = value.enable_snippets
|
||||||
enable_argument_placeholders.isSelected = value.enable_argument_placeholders
|
enable_argument_placeholders.isSelected = value.enable_argument_placeholders
|
||||||
completion_label_details.isSelected = value.completion_label_details
|
completion_label_details.isSelected = value.completion_label_details
|
||||||
|
|
|
@ -4,6 +4,9 @@ settings.zls-config-path.browse.title=Path to the Custom ZLS Config File (Option
|
||||||
settings.inlay-hints-group.label=Inlay Hints
|
settings.inlay-hints-group.label=Inlay Hints
|
||||||
settings.inlay-hints-enable.label=Enable
|
settings.inlay-hints-enable.label=Enable
|
||||||
settings.inlay-hints-enable.tooltip=Toggle this to enable/disable all inlay hints
|
settings.inlay-hints-enable.tooltip=Toggle this to enable/disable all inlay hints
|
||||||
|
settings.inlay-hints-max-size.label=Maximum Size
|
||||||
|
settings.inlay-hints-max-size.tooltip=The maximum size of a zig file to show inlay hints for.\nInlay hints in very large files make the IDE lag.\nSet to 0 to disable.
|
||||||
|
settings.inlay-hints-max-size.unit=KB
|
||||||
settings.enable_snippets.label=Enable snippets
|
settings.enable_snippets.label=Enable snippets
|
||||||
settings.enable_snippets.tooltip=Enables snippet completions when the client also supports them
|
settings.enable_snippets.tooltip=Enables snippet completions when the client also supports them
|
||||||
settings.enable_argument_placeholders.label=Enable argument placeholders
|
settings.enable_argument_placeholders.label=Enable argument placeholders
|
||||||
|
|
8
push.sh
8
push.sh
|
@ -23,8 +23,6 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
declare -a branches=("dev" "master" "242" "241")
|
|
||||||
|
|
||||||
die () {
|
die () {
|
||||||
echo >&2 "$@"
|
echo >&2 "$@"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -32,8 +30,4 @@ die () {
|
||||||
|
|
||||||
[ "$#" -eq 1 ] || die "1 argument required, $# provided"
|
[ "$#" -eq 1 ] || die "1 argument required, $# provided"
|
||||||
|
|
||||||
for i in "${branches[@]}"
|
git push --atomic "$1" "dev" "master" "243" "242" "241"
|
||||||
do
|
|
||||||
echo "Pushing branch $i"
|
|
||||||
git push "$1" "$i"
|
|
||||||
done
|
|
Loading…
Add table
Reference in a new issue