src/vs/editor/contrib/inlineCompletions/ghostTextWidget.ts/DecorationsWidget/setParts
class DecorationsWidget:	public setParts(lineNumber: number, parts: InsertedInlineText[], hiddenText?: HiddenText): void {
		this.disposableStore.clear();

		const colorTheme = this.themeService.getColorTheme();
		const foreground = colorTheme.getColor(ghostTextForeground);
		let opacity: string | undefined = undefined;
		let color: string | undefined = undefined;
		if (foreground) {
			opacity = String(foreground.rgba.a);
			color = Color.Format.CSS.format(opaque(foreground))!;
		}

		const borderColor = colorTheme.getColor(ghostTextBorder);
		let border: string | undefined = undefined;
		if (borderColor) {
			border = `2px dashed ${borderColor}`;
		}

		const textModel = this.editor.getModel();
		if (!textModel) {
			return;
		}

		const { tabSize } = textModel.getOptions();

		const line = textModel.getLineContent(lineNumber) || '';
		let lastIndex = 0;
		let currentLinePrefix = '';

		const hiddenTextDecorations = new Array<IModelDeltaDecoration>();
		if (hiddenText) {
			hiddenTextDecorations.push({
				range: Range.fromPositions(new Position(lineNumber, hiddenText.column), new Position(lineNumber, hiddenText.column + hiddenText.length)),
				options: {
					inlineClassName: 'ghost-text-hidden',
					description: 'ghost-text-hidden'
				}
			});
		}

		this.decorationIds = this.editor.deltaDecorations(this.decorationIds, parts.map<IModelDeltaDecoration>(p => {
			currentLinePrefix += line.substring(lastIndex, p.column - 1);
			lastIndex = p.column - 1;

			// To avoid visual confusion, we don't want to render visible whitespace
			const contentText = this.renderSingleLineText(p.text, currentLinePrefix, tabSize, false);

			const decorationType = this.disposableStore.add(registerDecorationType(this.codeEditorService, 'ghost-text', '0-ghost-text-', {
				after: {
					// TODO: escape?
					contentText,
					opacity,
					color,
					border,
				},
			}));

			return ({
				range: Range.fromPositions(new Position(lineNumber, p.column)),
				options: {
					...decorationType.resolve()
				}
			});
		}).concat(hiddenTextDecorations));
	}