Skip to content

Commit

Permalink
fix: Compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
shuhangli committed Jul 18, 2023
1 parent f72d972 commit 1c20e74
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 23 deletions.
7 changes: 4 additions & 3 deletions .idea/gradle.xml

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

2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
// Kotlin support
id("org.jetbrains.kotlin.jvm") version "1.8.20"
// Gradle IntelliJ Plugin
id("org.jetbrains.intellij") version "1.13.3"
id("org.jetbrains.intellij") version "1.15.0"
// Gradle Changelog Plugin
id("org.jetbrains.changelog") version "2.0.0"
// Gradle Qodana Plugin
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ platformVersion = 2023.1
platformPlugins = org.jetbrains.plugins.go,org.jetbrains.plugins.terminal,idea.plugin.protoeditor,com.jetbrains.restClient

# Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion = 7.5.1
gradleVersion = 8.2.1
runIde.autoReloadPlugins=true
org.gradle.jvmargs=-XX\:MaxHeapSize\=4096m -Xmx8192m
## Opt-out flag for bundling Kotlin standard library -> https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
24 changes: 16 additions & 8 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,13 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,22 +130,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -193,6 +197,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
1 change: 1 addition & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package com.github.suhli.ideagokratosplugin.helper

import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VfsUtil
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.openapi.vfs.VirtualFileManager
import com.intellij.openapi.vfs.findFileOrDirectory
import com.intellij.psi.PsiDirectory
import com.intellij.psi.PsiFileSystemItem
import com.intellij.util.ResourceUtil
import java.io.File
import java.nio.file.Path
import java.nio.file.Paths

class DirHelper {
Expand Down Expand Up @@ -45,8 +42,11 @@ class DirHelper {

fun isFileInDir(path: String, name: String): Boolean {
val p = Paths.get(path)
val file = VfsUtil.findFile(p, false) ?: return false
return file.findFileOrDirectory(name) != null
val file = VfsUtil.findFile(p,false) ?: return false
if (!file.isDirectory){
return false
}
return file.findChild(name) != null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ private fun findDependency(file: PsiFile): HashSet<String> {
if (file !is PbFile) {
return result
}
val dependsComments = file.children.filter { v -> v is PsiComment && v.text.contains("depends:") }
val settings = PbProjectSettings.getInstance(file.project)
val imports = file.children.filter { v -> v is PbImportStatement }
val project = file.project
val exists = hashSetOf<String>()
for (i in imports) {
val name = i.children[0].text.replace("\"","")
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- Plugin Configuration File. Read more: https://plugins.jetbrains.com/docs/intellij/plugin-configuration-file.html -->
<idea-plugin require-restart="false" >
<idea-plugin>
<id>com.github.suhli.ideagokratosplugin</id>
<name>Go Kratos</name>
<vendor email="[email protected]" url="https://github.com/suhli">suhli</vendor>
Expand Down

0 comments on commit 1c20e74

Please sign in to comment.