backport: 15.0.2

This commit is contained in:
FalsePattern 2024-06-02 19:54:39 +02:00
parent b8b10feb07
commit 2118e2a518
Signed by: falsepattern
GPG key ID: E930CDEC50C50E23
4 changed files with 73 additions and 11 deletions

View file

@ -17,6 +17,13 @@ Changelog structure reference:
## [Unreleased]
## [15.0.2]
### Fixed
- Zig
- Autocomplete not working when the caret is placed right after a "("
## [15.0.1]
### Fixed

View file

@ -1,13 +1,16 @@
import groovy.xml.XmlParser
import groovy.xml.XmlSlurper
import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.markdownToHTML
import org.jetbrains.intellij.tasks.PatchPluginXmlTask
import org.jetbrains.intellij.tasks.PublishPluginTask
fun properties(key: String) = providers.gradleProperty(key)
fun environment(key: String) = providers.environmentVariable(key)
plugins {
id("java") // Java support
`maven-publish`
id("java-library")
id("org.jetbrains.intellij") version("1.17.3")
id("org.jetbrains.changelog") version("2.2.0")
@ -16,6 +19,8 @@ plugins {
id("org.jetbrains.kotlin.jvm") version("1.9.22") //Only used by backport module
}
val publishVersions = listOf("232", "233", "241", "242")
val gitVersion: groovy.lang.Closure<String> by extra
val grammarKitGenDir = "build/generated/sources/grammarkit/java"
@ -416,15 +421,45 @@ project(":plugin") {
listProductsReleases {
types = listOf("IU", "IC", "CL")
}
}
}
// publishPlugin {
// dependsOn("patchChangelog")
// token = environment("PUBLISH_TOKEN")
// // The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
// // Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
// // https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
// channels = properties("pluginVersion").map { listOf(it.split('-').getOrElse(1) { "default" }.split('.').first()) }
// }
fun distFile(it: String) = layout.buildDirectory.file("dist/ZigBrains-${pluginVersion().get()}-$it-signed.zip")
publishVersions.forEach {
tasks.register<PublishPluginTask>("jbpublish-$it") {
distributionFile.set(distFile(it))
token = environment("IJ_PUBLISH_TOKEN")
}
tasks.named("publish") {
dependsOn("jbpublish-$it")
}
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = "com.falsepattern"
artifactId = "zigbrains"
version = pluginVersion().get()
publishVersions.forEach {
artifact(distFile(it)) {
classifier = "$it-signed"
extension = "zip"
}
}
}
}
repositories {
maven {
name = "mavenpattern"
url = uri("https://mvn.falsepattern.com/releases/");
credentials {
username = System.getenv("MAVEN_DEPLOY_USER")
password = System.getenv("MAVEN_DEPLOY_PASSWORD")
}
}
}
}

View file

@ -15,12 +15,29 @@
# limitations under the License.
#
set -e
declare -a branches=("master" "241" "233" "232")
DEFAULT_BRANCH="${branches[0]}"
if [[ -z "${PRIVATE_KEY_PASSWORD}" ]]; then
echo "Private key password does not exist!"
echo "PRIVATE_KEY_PASSWORD missing!"
exit 1
fi
if [[ -z "${MAVEN_DEPLOY_USER}"]]; then
echo "MAVEN_DEPLOY_USER missing!"
exit 1
fi
if [[ -z "${MAVEN_DEPLOY_PASSWORD}"]]; then
echo "MAVEN_DEPLOY_USER missing!"
exit 1
fi
if [[ -z "${IJ_PUBLISH_TOKEN}"]]; then
echo "MAVEN_DEPLOY_USER missing!"
exit 1
fi
@ -60,3 +77,5 @@ git checkout "$DEFAULT_BRANCH"
mkdir -p build/dist
cp plugin/build/distributions/*-signed.zip build/dist/
./gradlew publish

View file

@ -801,6 +801,7 @@ public class EditorEventManager {
}
private static final List<String> WHITESPACE_DELIMITERS = Arrays.asList(" \t\n\r".split(""));
private static final List<String> SYMBOL_DELIMITERS = Arrays.asList("()[]{};,".split(""));
@NotNull
public String getCompletionPrefix(Editor editor, int offset) {
@ -809,7 +810,7 @@ public class EditorEventManager {
for (int i = 0; i < offset; i++) {
char singleLetter = documentText.charAt(offset - i - 1);
val letterString = String.valueOf(singleLetter);
if (WHITESPACE_DELIMITERS.contains(letterString) || completionTriggers.contains(letterString)) {
if (WHITESPACE_DELIMITERS.contains(letterString) || SYMBOL_DELIMITERS.contains(letterString) || completionTriggers.contains(letterString)) {
break;
}
s.append(singleLetter);