Skip to content

Commit 163e3c4

Browse files
authored
Improve logic for choosing value/type meanings in quick info (#867)
1 parent 9bcca76 commit 163e3c4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/checker/printer.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ func (c *Checker) GetQuickInfoAtLocation(node *ast.Node) string {
9090
return ""
9191
}
9292
flags := symbol.Flags
93-
if flags&ast.SymbolFlagsType != 0 && !ast.IsInExpressionContext(node) {
94-
// If the symbol has a type meaning and we're not in an expression context, remove any value meanings
95-
flags &^= ast.SymbolFlagsValue
93+
if flags&ast.SymbolFlagsType != 0 && (ast.IsPartOfTypeNode(node) || isTypeDeclarationName(node)) {
94+
// If the symbol has a type meaning and we're in a type context, remove value-only meanings
95+
flags &^= ast.SymbolFlagsVariable | ast.SymbolFlagsFunction
9696
}
9797
p := c.newPrinter(TypeFormatFlagsNone)
9898
if isAlias {

0 commit comments

Comments
 (0)