From 71d0a1f78f3f13591dd2bb777977584e7ac11f62 Mon Sep 17 00:00:00 2001 From: Patrick Kettner Date: Tue, 6 Oct 2026 19:30:00 -0400 Subject: [PATCH] Move the getDocumentationForSymbol docstring onto the function --- tsc/internal/ls/hover.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tsc/internal/ls/hover.go b/tsc/internal/ls/hover.go index 249960e8021dd..95ea4fb9a5fe6 100644 --- a/tsc/internal/ls/hover.go +++ b/tsc/internal/ls/hover.go @@ -197,10 +197,6 @@ func (l *LanguageService) getQuickInfoAndDocumentationForSymbol(c *checker.Check return quickInfo, documentation, vsDocumentation, quickInfoRuns } -// getDocumentationForSymbol tries each documentation source in turn (call-signature documentation, -// declaration JSDoc, root-symbol JSDoc, alias target JSDoc) and returns the first non-empty result, -// formatted for contentFormat. commentOnly restricts the result to the JSDoc summary, excluding the -// @tag section. type documentationLocationMapper func(*ast.SourceFile, core.TextRange) (lsproto.Location, spanmap.Fidelity) func (l *LanguageService) documentationLocationMapper(feature spanmap.Feature) documentationLocationMapper { @@ -209,6 +205,10 @@ func (l *LanguageService) documentationLocationMapper(feature spanmap.Feature) d } } +// getDocumentationForSymbol tries each documentation source in turn (call-signature documentation, +// declaration JSDoc, root-symbol JSDoc, alias target JSDoc) and returns the first non-empty result, +// formatted for contentFormat. commentOnly restricts the result to the JSDoc summary, excluding the +// @tag section. func getDocumentationForSymbol(getMappedLocation documentationLocationMapper, c *checker.Checker, symbol *ast.Symbol, node *ast.Node, declaration *ast.Node, contentFormat lsproto.MarkupKind, commentOnly bool) string { documentation := documentationFromSignature(getMappedLocation, c, symbol, getCallOrNewExpression(node), node, contentFormat, commentOnly) if documentation != "" {