Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
Fix crash and transfer ownership
Browse files Browse the repository at this point in the history
  • Loading branch information
Yupeng Wang committed Sep 29, 2024
1 parent a0f54b3 commit f3410b3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 23 deletions.
20 changes: 10 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id 'java'
id 'org.jetbrains.intellij' version '1.15.0'
id 'org.jetbrains.kotlin.jvm' version '1.9.0'
id 'org.jetbrains.intellij' version '1.17.4'
id 'org.jetbrains.kotlin.jvm' version '2.0.20'
}

static def gitTag() {
Expand Down Expand Up @@ -32,18 +34,16 @@ repositories {

// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
version = '232.8660.48-EAP-SNAPSHOT'
version = 'LATEST-EAP-SNAPSHOT'
type = 'IU'
plugins = ['org.jetbrains.plugins.go:232.8660.48']
plugins = ['org.jetbrains.plugins.go:243.16718.32']
updateSinceUntilBuild = false
}

compileKotlin {
kotlinOptions.jvmTarget = "17"
}

compileTestKotlin {
kotlinOptions.jvmTarget = "17"
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}

def changeLog() {
Expand Down
5 changes: 5 additions & 0 deletions change-notes.htm
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<p><strong>1.6.7 (2024-09-29)</strong></p>
<ul>
<li>fix crash on init NotificationGroupManager</li>
<li>transfer ownership to JetBrains</li>
</ul>
<p><strong>1.6.6 (2023-07-28)</strong></p>
<ul>
<li>enhance system GOPATH detectability, now most project should work out of box</li>
Expand Down
5 changes: 3 additions & 2 deletions src/main/kotlin/com/ypwang/plugin/Utilities.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ import java.nio.file.Path
import java.nio.file.Paths
import java.util.*

private const val notificationGroupName = "Go linter notifications"
private val configFiles = arrayOf(".golangci.json", ".golangci.toml", ".golangci.yaml", ".golangci.yml") // ordered by precedence

val logger = Logger.getInstance("go-linter")
val notificationGroup: NotificationGroup = NotificationGroupManager.getInstance().getNotificationGroup(notificationGroupName)
val notificationGroup: NotificationGroup by lazy {
NotificationGroupManager.getInstance().getNotificationGroup("Go linter notifications")
}

fun findCustomConfigInPath(path: String?): Optional<String> {
val varPath: String? = path
Expand Down
13 changes: 2 additions & 11 deletions src/main/kotlin/com/ypwang/plugin/platform/Platform.kt
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,6 @@ abstract class Platform(protected val project: Project) {
// system path itself is absolute for running OS
rst.add(path)

// try to fix macOS empty system environment variables, read environment variables from .zshrc or .bashrc
// see: https://github.com/JetBrains/intellij-community/blob/master/platform/util/src/com/intellij/util/EnvironmentUtil.java#L72
if (SystemInfo.isMac) {
val systemEnvPath = EnvironmentUtil.getValue(Const_Path) ?: ""
if (systemEnvPath.isNotBlank()) {
rst.add(systemEnvPath)
}
}

return rst
}

Expand All @@ -122,8 +113,8 @@ abstract class Platform(protected val project: Project) {
if (VgoProjectSettings.getInstance(project).isIntegrationEnabled || Objects.equals("on", env)) "on" else "off"

// immutable in current idea process, for host OS ==============================================================
private val systemPath = System.getenv(Const_Path) ?: ""
private val systemModuleOn = System.getenv(Const_GoModule) ?: ""
private val systemPath = EnvironmentUtil.getValue(Const_Path) ?: ""
private val systemModuleOn = EnvironmentUtil.getValue(Const_GoModule) ?: ""
private val envOverride = mapOf<String, (Project) -> String>(
Const_Path to { p -> combinePath(p, null, systemPath).joinToString(File.pathSeparator) },
Const_GoPath to { p -> combineGoPath(p, null).joinToString(File.pathSeparator) },
Expand Down

0 comments on commit f3410b3

Please sign in to comment.