Skip to content

Commit

Permalink
Fix wrong text/signatures in auto-completion for inherited members wi…
Browse files Browse the repository at this point in the history
…th type parameters
  • Loading branch information
m0rkeulv committed Sep 8, 2024
1 parent 19c33e0 commit 1caebad
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Changelog
## 1.5.12
* Bugfix: Function types for inherited methods could in some cases show wrong signature when type parameters where used.
* Bugfix: Auto-completion would in some cases show wrong types when type parameters where used.
* Improvement: performance improvements (expression evaluation cache)
*
## 1.5.11
* Improvement: Variables and members with only init expression "= null" should now correctly resolve to type Null<T>.
* Improvement: Added parser support for `TIntersection` reification (macro : type & type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.intellij.plugins.haxe.lang.psi.*;
import com.intellij.plugins.haxe.model.*;
import com.intellij.plugins.haxe.model.type.HaxeGenericResolver;
import com.intellij.plugins.haxe.model.type.HaxeGenericResolverUtil;
import com.intellij.plugins.haxe.model.type.ResultHolder;
import com.intellij.plugins.haxe.model.type.SpecificFunctionReference;
import com.intellij.plugins.haxe.util.HaxePresentableUtil;
Expand Down Expand Up @@ -89,9 +90,17 @@ public static Collection<HaxeMemberLookupElement> convert(HaxeResolveResult left
}
if (!shouldBeIgnored) {
HaxeBaseMemberModel model = HaxeBaseMemberModel.fromPsi(componentName);
if (model instanceof HaxeMethodModel) {
// adding functionType in addition to method call
result.add(new HaxeMemberLookupElement(leftReferenceResolveResult, componentName, context, resolver, model, true));
if (model != null) {
HaxeClassModel classModel = model.getDeclaringClass();
if (classModel != null && leftReferenceResolveResult != null) {
HaxeClass currentClass = leftReferenceResolveResult.getHaxeClass();
HaxeClass membersClass = classModel.haxeClass;
resolver = HaxeGenericResolverUtil.createInheritedClassResolver(membersClass, currentClass, resolver);
}
if (model instanceof HaxeMethodModel) {
// adding functionType in addition to method call
result.add(new HaxeMemberLookupElement(leftReferenceResolveResult, componentName, context, resolver, model, true));
}
}
result.add(new HaxeMemberLookupElement(leftReferenceResolveResult, componentName, context, resolver, model));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ public class HaxeExpressionEvaluatorCacheService {


public void clearCaches() {
cacheMap.clear();
synchronized(this) {
cacheMap.clear();
}
}
}

Expand Down

0 comments on commit 1caebad

Please sign in to comment.