Skip to content

Commit 7cf9efa

Browse files
committed
Show type info for any type owner element
Fixes #2444
1 parent 5abd0a6 commit 7cf9efa

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/com/goide/codeInsight/GoExpressionTypeProvider.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
package com.goide.codeInsight;
1818

19-
import com.goide.psi.GoExpression;
2019
import com.goide.psi.GoStatement;
2120
import com.goide.psi.GoType;
21+
import com.goide.psi.GoTypeOwner;
2222
import com.intellij.lang.ExpressionTypeProvider;
2323
import com.intellij.openapi.util.text.StringUtil;
2424
import com.intellij.psi.PsiElement;
@@ -28,10 +28,10 @@
2828

2929
import java.util.List;
3030

31-
public class GoExpressionTypeProvider extends ExpressionTypeProvider<GoExpression> {
31+
public class GoExpressionTypeProvider extends ExpressionTypeProvider<GoTypeOwner> {
3232
@NotNull
3333
@Override
34-
public String getInformationHint(@NotNull GoExpression element) {
34+
public String getInformationHint(@NotNull GoTypeOwner element) {
3535
GoType type = element.getGoType(null);
3636
return StringUtil.escapeXml(StringUtil.notNullize(type != null ? type.getText() : null, "<unknown>"));
3737
}
@@ -44,14 +44,14 @@ public String getErrorHint() {
4444

4545
@NotNull
4646
@Override
47-
public List<GoExpression> getExpressionsAt(@NotNull PsiElement elementAt) {
47+
public List<GoTypeOwner> getExpressionsAt(@NotNull PsiElement elementAt) {
4848
if (PsiTreeUtil.getParentOfType(elementAt, GoStatement.class) == null) {
4949
return ContainerUtil.emptyList();
5050
}
51-
List<GoExpression> expressions = ContainerUtil.newArrayList();
51+
List<GoTypeOwner> expressions = ContainerUtil.newArrayList();
5252
while (elementAt != null && !(elementAt instanceof GoStatement)) {
53-
if (elementAt instanceof GoExpression) {
54-
expressions.add((GoExpression)elementAt);
53+
if (elementAt instanceof GoTypeOwner) {
54+
expressions.add((GoTypeOwner)elementAt);
5555
}
5656
elementAt = elementAt.getParent();
5757
}

0 commit comments

Comments
 (0)