MCPcopy Create free account
hub / github.com/microsoft/typescript-go / IsLibSymbolForHoverVerbosity

Method IsLibSymbolForHoverVerbosity

internal/checker/services.go:1114–1125  ·  view source on GitHub ↗

IsLibSymbolForHoverVerbosity returns true if a symbol is declared in a lib file.

(symbol *ast.Symbol)

Source from the content-addressed store, hash-verified

1112
1113// IsLibSymbolForHoverVerbosity returns true if a symbol is declared in a lib file.
1114func (c *Checker) IsLibSymbolForHoverVerbosity(symbol *ast.Symbol) bool {
1115 if symbol == nil {
1116 return false
1117 }
1118 for _, decl := range symbol.Declarations {
1119 sf := ast.GetSourceFileOfNode(decl)
1120 if sf != nil && c.program.IsSourceFileDefaultLibrary(sf.Path()) {
1121 return true
1122 }
1123 }
1124 return false
1125}
1126
1127// IsLibTypeForHoverVerbosity returns true if a type is declared in a lib file.
1128// Don't expand types like Array or Promise, instead treating them as opaque.

Callers 2

isExpandableTypeMethod · 0.80

Calls 3

GetSourceFileOfNodeFunction · 0.92
PathMethod · 0.65

Tested by

no test coverage detected