MCPcopy Index your code
hub / github.com/microsoft/typescript-go / getNodeForQuickInfo

Function getNodeForQuickInfo

internal/ls/hover.go:782–799  ·  view source on GitHub ↗
(node *ast.Node)

Source from the content-addressed store, hash-verified

780}
781
782func getNodeForQuickInfo(node *ast.Node) *ast.Node {
783 if node.Parent == nil {
784 return node
785 }
786 if ast.IsNewExpression(node.Parent) && node.Pos() == node.Parent.Pos() {
787 return node.Parent.Expression()
788 }
789 if ast.IsNamedTupleMember(node.Parent) && node.Pos() == node.Parent.Pos() {
790 return node.Parent
791 }
792 if ast.IsImportMeta(node.Parent) && node.Parent.Name() == node {
793 return node.Parent
794 }
795 if ast.IsJsxNamespacedName(node.Parent) {
796 return node.Parent
797 }
798 return node
799}
800
801func getSymbolAtLocationForQuickInfo(c *checker.Checker, node *ast.Node) *ast.Symbol {
802 if objectElement := getContainingObjectLiteralElement(node); objectElement != nil {

Callers 1

ProvideHoverMethod · 0.85

Calls 7

IsNewExpressionFunction · 0.92
IsNamedTupleMemberFunction · 0.92
IsImportMetaFunction · 0.92
IsJsxNamespacedNameFunction · 0.92
ExpressionMethod · 0.80
PosMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected