Skip to content

Commit

Permalink
Release 1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
m0rkeulv committed Apr 13, 2024
1 parent acde2e2 commit 7787f84
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Changelog
## 1.5.1
* Fixed: Issue setting up Haxe SDK in intelliJ 2024.1
## 1.5.0
* Improvement: Better type inferences
* Improvement: Better resolve of TypeParameters (generics)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pluginName = Haxe Toolkit Support
pluginRepositoryUrl = https://github.com/HaxeFoundation/intellij-haxe

# SemVer format -> https://semver.org
pluginVersion = 1.5.0
pluginVersion = 1.5.1

# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
#platformType = IU
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,27 @@ public boolean isRootTypeApplicable(OrderRootType type) {

@Override
public void setupSdkPaths(Sdk sdk) {
final SdkModificator modificator = sdk.getSdkModificator();



SdkAdditionalData data = sdk.getSdkAdditionalData();
if (data == null) {
data = HaxeSdkUtil.testHaxeSdk(sdk.getHomePath());
modificator.setSdkAdditionalData(data);
}

HaxeSdkUtil.setupSdkPaths(sdk.getHomeDirectory(), modificator);

modificator.commitChanges();
}
super.setupSdkPaths(sdk);
writeSdkData(sdk, data);
}

private static void writeSdkData(Sdk sdk, SdkAdditionalData data) {
ApplicationManager.getApplication().runWriteAction(() -> {
if (data != null) {
final SdkModificator modificator = sdk.getSdkModificator();
modificator.setSdkAdditionalData(data);
HaxeSdkUtil.setupSdkPaths(sdk.getHomeDirectory(), modificator);
modificator.commitChanges();
}
});
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package com.intellij.plugins.haxe.haxelib;

import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.Sdk;
Expand Down Expand Up @@ -52,7 +53,9 @@ private static void tryToSetDefaultSdk() {
sdkType,
sdkType.suggestHomePath(),
sdkType.getVersionString(sdkType.suggestHomePath()));
sdkType.setupSdkPaths(defaultSDK);
ApplicationManager.getApplication().invokeLaterOnWriteThread(() -> {
sdkType.setupSdkPaths(defaultSDK);
});
}
}
static boolean myDefaultSdkErrorHasBeenLogged = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,8 @@ private static Project getProject(AnActionEvent e) {
return CommonDataKeys.PROJECT.getData(context);
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,9 @@ private Project getProject(AnActionEvent e) {
DataContext context = e.getDataContext();
return CommonDataKeys.PROJECT.getData(context);
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}
}

0 comments on commit 7787f84

Please sign in to comment.