Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Build Plugin

on:
push:
branches: *
branches:
- '*'
# pull_request:
# branches: [ "master" ]

Expand All @@ -16,7 +17,7 @@ jobs:

env:
CI: true
CI_BUILD_VERSION: 1.3.7.${{ github.run_number }}
CI_BUILD_VERSION: 1.4.0.${{ github.run_number }}

steps:
- name: Checkout
Expand All @@ -28,13 +29,13 @@ jobs:
java-version: '17'
distribution: 'temurin'

- name: Build 2023.1-EAP
- name: Build 2025.3
env:
IDEA_VER: 231
IDEA_VER: 245
run: ./gradlew buildPlugin

- name: Upload artifact
uses: actions/upload-artifact@v3.1.0
uses: actions/upload-artifact@v4
with:
name: v${{ env.CI_BUILD_VERSION }}
path: build/distributions/*.zip
8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

83 changes: 33 additions & 50 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@
* limitations under the License.
*/

import de.undercouch.gradle.tasks.download.*
import de.undercouch.gradle.tasks.download.Download
import org.apache.tools.ant.taskdefs.condition.Os
import org.jetbrains.intellij.platform.gradle.tasks.PrepareSandboxTask
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import java.io.ByteArrayOutputStream
import kotlin.text.get
import kotlin.text.set

plugins {
id("org.jetbrains.intellij").version("1.10.0")
id("org.jetbrains.kotlin.jvm").version("1.7.22")
id("org.jetbrains.intellij.platform") version "2.7.0"
id("org.jetbrains.kotlin.jvm").version("2.1.0")
id("de.undercouch.download").version("5.3.0")
}

Expand All @@ -41,38 +45,13 @@ data class BuildData(

val buildDataList = listOf(
BuildData(
ideaSDKShortVersion = "231",
// 223.7571.123-EAP-SNAPSHOT
// LATEST-EAP-SNAPSHOT
ideaSDKVersion = "LATEST-EAP-SNAPSHOT",
sinceBuild = "231",
untilBuild = "231.*",
ideaSDKShortVersion = "2025.2",
ideaSDKVersion = "252.23892.409",
sinceBuild = "252",
untilBuild = "252.*",
bunch = "212",
targetCompatibilityLevel = JavaVersion.VERSION_17,
jvmTarget = "17"
),
BuildData(
ideaSDKShortVersion = "223",
ideaSDKVersion = "2022.3",
sinceBuild = "223",
untilBuild = "223.*",
bunch = "212",
targetCompatibilityLevel = JavaVersion.VERSION_17,
jvmTarget = "17"
),
BuildData(
ideaSDKShortVersion = "222",
ideaSDKVersion = "2022.2",
sinceBuild = "212",
untilBuild = "222.*",
bunch = "212"
),
BuildData(
ideaSDKShortVersion = "211",
ideaSDKVersion = "2021.1",
sinceBuild = "211",
untilBuild = "211.*",
bunch = "203"
)
)

Expand Down Expand Up @@ -172,8 +151,11 @@ task("installEmmyDebugger", type = Copy::class) {

project(":") {
repositories {
maven(url = "https://www.jetbrains.com/intellij-repository/releases")
mavenCentral()
intellijPlatform {
defaultRepositories()
marketplace()
}
}

dependencies {
Expand All @@ -183,6 +165,10 @@ project(":") {
implementation("org.luaj:luaj-jse:3.0.1")
implementation("org.eclipse.mylyn.github:org.eclipse.egit.github.core:2.1.5")
implementation("com.jgoodies:forms:1.2.1")
intellijPlatform {
intellijIdeaCommunity(buildVersionData.ideaSDKShortVersion)
//bundledModule("intellij.spellchecker")
}
}

sourceSets {
Expand All @@ -193,18 +179,14 @@ project(":") {
}
}

configure<JavaPluginConvention> {
/*configure<JavaPluginConvention> {
sourceCompatibility = buildVersionData.targetCompatibilityLevel
targetCompatibility = buildVersionData.targetCompatibilityLevel
}
}*/

intellij {
type.set("IC")
updateSinceUntilBuild.set(false)
downloadSources.set(!isCI)
version.set(buildVersionData.ideaSDKVersion)
//localPath.set(System.getenv("IDEA_HOME_${buildVersionData.ideaSDKShortVersion}"))
sandboxDir.set("${project.buildDir}/${buildVersionData.ideaSDKShortVersion}/idea-sandbox")
intellijPlatform {
version = version
sandboxContainer.set(layout.buildDirectory.dir("${buildVersionData.ideaSDKShortVersion}/idea-sandbox"))
}

task("bunch") {
Expand Down Expand Up @@ -242,26 +224,27 @@ project(":") {
}
}

processResources {
dependsOn("installEmmyDebugger")
}

compileKotlin {
kotlinOptions {
jvmTarget = buildVersionData.jvmTarget
compilerOptions {
jvmTarget.set(JvmTarget.fromTarget(buildVersionData.jvmTarget))
}
}

patchPluginXml {
dependsOn("installEmmyDebugger")
sinceBuild.set(buildVersionData.sinceBuild)
untilBuild.set(buildVersionData.untilBuild)
}

instrumentCode {
compilerVersion.set(buildVersionData.instrumentCodeCompilerVersion)
}

publishPlugin {
token.set(System.getenv("IDEA_PUBLISH_TOKEN"))
}

withType<org.jetbrains.intellij.tasks.PrepareSandboxTask> {
withType<PrepareSandboxTask> {
doLast {
copy {
from("src/main/resources/std")
Expand All @@ -274,4 +257,4 @@ project(":") {
}
}
}
}
}
84 changes: 83 additions & 1 deletion gen/com/tang/intellij/lua/psi/impl/LuaCallExprImpl.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 0 additions & 6 deletions src/main/java/com/tang/intellij/lua/LuaBundle.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) Stri
return CommonBundle.message(getBundle(), key, params);
}

@Nullable
public static String messageOfNull(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key,
@NotNull Object... params) {
return CommonBundle.messageOfNull(getBundle(), key, params);
}

private static Reference<ResourceBundle> ourBundle;
@NonNls
private static final String BUNDLE = "LuaBundle";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.tang.intellij.lua.codeInsight

import com.intellij.codeInsight.lookup.LookupElement
import com.intellij.lang.parameterInfo.*
import com.intellij.psi.util.PsiTreeUtil
import com.intellij.util.Processor
Expand All @@ -34,18 +33,6 @@ data class ParameterInfoType(val sig: IFunSignature, val isColonStyle: Boolean)
* Created by tangzx on 2016/12/25.
*/
class LuaParameterInfoHandler : ParameterInfoHandler<LuaArgs, ParameterInfoType> {
override fun couldShowInLookup(): Boolean {
return false
}

override fun getParametersForLookup(lookupElement: LookupElement, parameterInfoContext: ParameterInfoContext): Array<Any>? {
return emptyArray()
}

override fun getParametersForDocumentation(o: ParameterInfoType, parameterInfoContext: ParameterInfoContext): Array<Any>? {
return emptyArray()
}

override fun findElementForParameterInfo(context: CreateParameterInfoContext): LuaArgs? {
val file = context.file
val luaArgs = PsiTreeUtil.findElementOfClassAtOffset(file, context.offset, LuaArgs::class.java, false)
Expand Down Expand Up @@ -85,14 +72,6 @@ class LuaParameterInfoHandler : ParameterInfoHandler<LuaArgs, ParameterInfoType>
}
}

override fun getParameterCloseChars(): String? {
return ",()"
}

override fun tracksParameterIndex(): Boolean {
return true
}

override fun updateUI(o: ParameterInfoType?, context: ParameterInfoUIContext) {
if (o == null)
return
Expand All @@ -113,14 +92,14 @@ class LuaParameterInfoHandler : ParameterInfoHandler<LuaArgs, ParameterInfoType>
}
if (str.isNotEmpty()) {
context.setupUIComponentPresentation(
str,
start,
end,
false,
false,
false,
context.defaultParameterColor
str,
start,
end,
false,
false,
false,
context.defaultParameterColor
)
}
}
}
}
Loading