Skip to content

Commit

Permalink
2023.3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
m0rkeulv committed Oct 28, 2023
1 parent fd5a094 commit 3cbba6d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 16 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Changelog

## 1.4.18
* better support for local functions
* better support for anonymous structure extensions
* Support for Intellij 2023.3
* Improvement: Better support for local functions
* Improvement: Better support for anonymous structure extensions
* Changed: Switched to EcmaScript Regexp as injected regex language

## 1.4.17
* Bugfix: Fixed broken caching logic (Broken in 1.4.15, Disabled in 1.4.16, Fixed in 1.4.17)
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ pluginName = Haxe Toolkit Support
pluginRepositoryUrl = https://github.com/HaxeFoundation/intellij-haxe

# SemVer format -> https://semver.org
pluginVersion = 1.4.17
pluginVersion = 1.4.18

# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
platformType = IU
#platformType = IC

platformVersion = 2023.2.2
#platformVersion = LATEST-EAP-SNAPSHOT
#platformVersion = 2023.2.2
platformVersion = LATEST-EAP-SNAPSHOT
platformDownloadSources = true

# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
Expand All @@ -25,8 +25,8 @@ pluginUntilBuild = 233.*
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
# see flex/flash versions at : https://plugins.jetbrains.com/plugin/14508-flash-flex/versions/stable/252411
#platformPlugins = com.intellij.java, com.intellij.flex:233.10527.20, JavaScript
platformPlugins = com.intellij.java, com.intellij.flex:232.8660.142, JavaScript
platformPlugins = com.intellij.java, com.intellij.flex:233.11361.10, JavaScript
#platformPlugins = com.intellij.java, com.intellij.flex:232.8660.142, JavaScript
#platformPlugins = com.intellij.java, com.intellij.flex:232.8660.142

# Java language level used to compile sources and to generate the files for - Java 17 is required since 2022.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import com.intellij.psi.InjectedLanguagePlaces;
import com.intellij.psi.LanguageInjector;
import com.intellij.psi.PsiLanguageInjectionHost;
import org.intellij.lang.regexp.ecmascript.EcmaScriptUnicodeRegexpLanguage;
import org.intellij.lang.regexp.ecmascript.EcmaScriptRegexpLanguage;
import org.jetbrains.annotations.NotNull;

/**
Expand All @@ -39,7 +39,7 @@ public void getLanguagesToInject(@NotNull PsiLanguageInjectionHost host, @NotNul
if (host instanceof HaxeRegularExpression) {
final String text = host.getText();
final TextRange textRange = new TextRange(text.indexOf('/') + 1, text.lastIndexOf('/'));
injectionPlacesRegistrar.addPlace(EcmaScriptUnicodeRegexpLanguage.INSTANCE, textRange, null, null);
injectionPlacesRegistrar.addPlace(EcmaScriptRegexpLanguage.INSTANCE, textRange, null, null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,8 @@ public static ResultHolder searchReferencesForTypeParameters(final HaxePsiField
final HaxeGenericResolver resolver, ResultHolder resultHolder) {
resultHolder = resultHolder.duplicate();
HaxeComponentName componentName = field.getComponentName();
SpecificHaxeClassReference classType = resultHolder.getClassType();
SpecificHaxeClassReference type = resultHolder.getClassType();
SpecificHaxeClassReference classType = type;

HaxeGenericResolver classResolver = classType.getGenericResolver();
SearchScope useScope = PsiSearchHelper.getInstance(componentName.getProject()).getUseScope(componentName);
Expand Down Expand Up @@ -1454,8 +1455,15 @@ public static ResultHolder searchReferencesForTypeParameters(final HaxePsiField
for (int i = 0; i < Math.min(specificNames.length, arguments.size()); i++) {
if (specificNames[i].equals(parameter.getTypeTagPsi().getTypeOrAnonymous().getText())) {
// we could try to map parameters and args, but in most cases this probably won't be necessary and it would make this part very complex
ResultHolder handle = handle(arguments.get(i), context, resolver);
resultHolder.getClassType().getSpecifics()[i] = handle;
if (type.getSpecifics()[i].isUnknown()) {
ResultHolder handle = handle(arguments.get(i), context, resolver);
if (type.getSpecifics()[i].isUnknown()) {
type.getSpecifics()[i] = handle;
}else {
ResultHolder unified = HaxeTypeUnifier.unify(handle, type.getSpecifics()[i]);
type.getSpecifics()[i] = unified;
}
}
}
}
}
Expand Down Expand Up @@ -1484,15 +1492,25 @@ public static ResultHolder searchReferencesForTypeParameters(final HaxePsiField
if (keyPsiName.equals(specificNames[i])) {
HaxeExpression keyExpression = arrayAccessExpression.getExpressionList().get(1);
ResultHolder handle = handle(keyExpression, context, resolver);
resultHolder.getClassType().getSpecifics()[i] = handle;
if (type.getSpecifics()[i].isUnknown()) {
type.getSpecifics()[i] = handle;
}else {
ResultHolder unified = HaxeTypeUnifier.unify(handle, type.getSpecifics()[i]);
type.getSpecifics()[i] = unified;
}
}
// value
if (arrayAccessExpression.getParent() instanceof HaxeBinaryExpression binaryExpression) {
String valuePsiName = valueParamPsi.getTypeOrAnonymous().getType().getText();
if (valuePsiName.equals(specificNames[i])) {
HaxeExpression keyExpression = binaryExpression.getExpressionList().get(1);
ResultHolder handle = handle(keyExpression, context, resolver);
resultHolder.getClassType().getSpecifics()[i] = handle;
if (type.getSpecifics()[i].isUnknown()) {
type.getSpecifics()[i] = handle;
}else {
ResultHolder unified = HaxeTypeUnifier.unify(handle, type.getSpecifics()[i]);
type.getSpecifics()[i] = unified;
}
}
}
}
Expand All @@ -1512,8 +1530,13 @@ public static ResultHolder searchReferencesForTypeParameters(final HaxePsiField
String keyPsiName = keyParamPsi.getTypeOrAnonymous().getType().getText();
if (keyPsiName.equals(specificNames[i])) {
HaxeExpression keyExpression = arrayAccessExpression.getExpressionList().get(1);
ResultHolder handle = handle(keyExpression, context, resolver);
resultHolder.getClassType().getSpecifics()[i] = handle;
ResultHolder handle = handle(keyExpression, context, resolver);
if (type.getSpecifics()[i].isUnknown()) {
type.getSpecifics()[i] = handle;
}else {
ResultHolder unified = HaxeTypeUnifier.unify(handle, type.getSpecifics()[i]);
type.getSpecifics()[i] = unified;
}
}
}
}
Expand Down

0 comments on commit 3cbba6d

Please sign in to comment.