src/vs/editor/contrib/inlineCompletions/browser/suggestWidgetPreviewModel.ts/SuggestWidgetPreviewModel/ghostText
class SuggestWidgetPreviewModel:	public override get ghostText(): GhostText | undefined {
		const isSuggestionPreviewEnabled = this.isSuggestionPreviewEnabled();
		const model = this.editor.getModel();
		const augmentedCompletion = minimizeInlineCompletion(model, this.cache.value?.completions[0]?.toLiveInlineCompletion());

		const suggestWidgetState = this.suggestionInlineCompletionSource.state;
		const suggestInlineCompletion = minimizeInlineCompletion(model, suggestWidgetState?.selectedItem?.normalizedInlineCompletion);

		const isAugmentedCompletionValid = augmentedCompletion
			&& suggestInlineCompletion
			&& augmentedCompletion.insertText.startsWith(suggestInlineCompletion.insertText)
			&& augmentedCompletion.range.equalsRange(suggestInlineCompletion.range);

		if (!isSuggestionPreviewEnabled && !isAugmentedCompletionValid) {
			return undefined;
		}

		// If the augmented completion is not valid and there is no suggest inline completion, we still show the augmented completion.
		const finalCompletion = isAugmentedCompletionValid ? augmentedCompletion : (suggestInlineCompletion || augmentedCompletion);

		const inlineCompletionPreviewLength = isAugmentedCompletionValid ? finalCompletion!.insertText.length - suggestInlineCompletion.insertText.length : 0;
		const newGhostText = this.toGhostText(finalCompletion, inlineCompletionPreviewLength);

		return newGhostText;
	}