diff --git a/CHANGELOG.md b/CHANGELOG.md index 93aff826b..713510f92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/gradle.properties b/gradle.properties index 0312bdd4c..33c29aa8c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 @@ -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 diff --git a/src/main/java/com/intellij/plugins/haxe/lang/RegexLanguageInjector.java b/src/main/java/com/intellij/plugins/haxe/lang/RegexLanguageInjector.java index 5dae84b6e..8bb57b488 100644 --- a/src/main/java/com/intellij/plugins/haxe/lang/RegexLanguageInjector.java +++ b/src/main/java/com/intellij/plugins/haxe/lang/RegexLanguageInjector.java @@ -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; /** @@ -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); } } } diff --git a/src/main/java/com/intellij/plugins/haxe/model/type/HaxeExpressionEvaluator.java b/src/main/java/com/intellij/plugins/haxe/model/type/HaxeExpressionEvaluator.java index afe9735c1..9c64f0bf3 100644 --- a/src/main/java/com/intellij/plugins/haxe/model/type/HaxeExpressionEvaluator.java +++ b/src/main/java/com/intellij/plugins/haxe/model/type/HaxeExpressionEvaluator.java @@ -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); @@ -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; + } + } } } } @@ -1484,7 +1492,12 @@ 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) { @@ -1492,7 +1505,12 @@ public static ResultHolder searchReferencesForTypeParameters(final HaxePsiField 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; + } } } } @@ -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; + } } } }