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

Function tryGetFunctionOpenToken

internal/ls/folding.go:553–561  ·  view source on GitHub ↗
(node *ast.SignatureDeclaration, body *ast.Node, sourceFile *ast.SourceFile)

Source from the content-addressed store, hash-verified

551}
552
553func tryGetFunctionOpenToken(node *ast.SignatureDeclaration, body *ast.Node, sourceFile *ast.SourceFile) *ast.Node {
554 if isNodeArrayMultiLine(node.Parameters(), sourceFile) {
555 openParenToken := astnav.FindChildOfKind(node, ast.KindOpenParenToken, sourceFile)
556 if openParenToken != nil {
557 return openParenToken
558 }
559 }
560 return astnav.FindChildOfKind(body, ast.KindOpenBraceToken, sourceFile)
561}
562
563func isNodeArrayMultiLine(list []*ast.Node, sourceFile *ast.SourceFile) bool {
564 if len(list) == 0 {

Callers 1

functionSpanFunction · 0.85

Calls 3

FindChildOfKindFunction · 0.92
isNodeArrayMultiLineFunction · 0.85
ParametersMethod · 0.45

Tested by

no test coverage detected