import type { Identifier, TypeChecker } from 'typescript'; import ts from 'typescript'; import { normalizeLineBreaks } from '../../utils/string.js'; export function getDocumentation(checker: TypeChecker, id: Identifier): string { const comment = checker .getSymbolAtLocation(id) ?.getDocumentationComment(checker); return normalizeLineBreaks(ts.displayPartsToString(comment) ?? ''); }