src/vs/editor/contrib/inlineCompletions/browser/suggestWidgetInlineCompletionProvider.ts/suggestionToSuggestItemInfo
function suggestionToSuggestItemInfo(suggestController: SuggestController, position: Position, item: CompletionItem, toggleMode: boolean): SuggestItemInfo | undefined {
	// additionalTextEdits might not be resolved here, this could be problematic.
	if (Array.isArray(item.completion.additionalTextEdits) && item.completion.additionalTextEdits.length > 0) {
		// cannot represent additional text edits. TODO: Now we can.
		return {
			completionItemKind: item.completion.kind,
			isSnippetText: false,
			normalizedInlineCompletion: {
				// Dummy element, so that space is reserved, but no text is shown
				range: Range.fromPositions(position, position),
				insertText: '',
				filterText: '',
				snippetInfo: undefined,
				additionalTextEdits: [],
			},
		};
	}

	let { insertText } = item.completion;
	let isSnippetText = false;
	if (item.completion.insertTextRules! & CompletionItemInsertTextRule.InsertAsSnippet) {
		const snippet = new SnippetParser().parse(insertText);
		const model = suggestController.editor.getModel()!;

		// Ignore snippets that are too large.
		// Adjust whitespace is expensive for them.
		if (snippet.children.length > 100) {
			return undefined;
		}

		SnippetSession.adjustWhitespace(model, position, snippet, true, true);
		insertText = snippet.toString();
		isSnippetText = true;
	}

	const info = suggestController.getOverwriteInfo(item, toggleMode);
	return {
		isSnippetText,
		completionItemKind: item.completion.kind,
		normalizedInlineCompletion: {
			insertText: insertText,
			filterText: insertText,
			range: Range.fromPositions(
				position.delta(0, -info.overwriteBefore),
				position.delta(0, Math.max(info.overwriteAfter, 0))
			),
			snippetInfo: undefined,
			additionalTextEdits: [],
		}
	};
}