src/vs/editor/contrib/documentSymbols/documentSymbols.ts/getDocumentSymbols
export async function getDocumentSymbols(document: ITextModel, flat: boolean, token: CancellationToken): Promise<DocumentSymbol[]> {
	const model = await OutlineModel.create(document, token);
	return flat
		? model.asListOfDocumentSymbols()
		: model.getTopLevelSymbols();
}