Skip to content

Commit

Permalink
fix type parameter info for completion suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
m0rkeulv committed May 18, 2024
1 parent 81e8b1a commit d442520
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ public void calculatePresentation() {
}

private void evaluateTypeText() {
ResultHolder type = model.getResultType(null);
ResultHolder type = model.getResultType(resolver);
if (isFunctionType && model instanceof HaxeMethodModel methodModel) {
SpecificFunctionReference functionType = methodModel.getFunctionType(null);
SpecificFunctionReference functionType = methodModel.getFunctionType(resolver);
typeText = functionType.toPresentationString();
return;
}
Expand All @@ -165,8 +165,17 @@ private void evaluateTypeText() {

private void evaluateTailText() {
if (model instanceof HaxeMethodModel && !isFunctionType) {
String parameterListAsText = HaxePresentableUtil.getPresentableParameterList(model.getNamedComponentPsi());
tailText = "(" + parameterListAsText + ")";
if (leftReference != null) {
tailText = "(" + getParameterListAsText() + ")";
}
}
}

private @NotNull String getParameterListAsText() {
if (leftReference != null){
return HaxePresentableUtil.getPresentableParameterList(model.getNamedComponentPsi(), leftReference.getSpecialization(), true);
}else {
return HaxePresentableUtil.getPresentableParameterList(model.getNamedComponentPsi());
}
}

Expand Down

0 comments on commit d442520

Please sign in to comment.