src/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.ts/DecorationsWidget/setParts
class DecorationsWidget:	public setParts(lineNumber: number, parts: InsertedInlineText[], hiddenText?: HiddenText): void {
		const textModel = this.editor.getModel();
		if (!textModel) {
			return;
		}

		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',
				}
			});
		}

		// Using change decorations ensures that we update the id's before some event handler is called.
		this.editor.changeDecorations(accessor => {
			this.decorationIds = accessor.deltaDecorations(this.decorationIds, parts.map<IModelDeltaDecoration>(p => {
				return ({
					range: Range.fromPositions(new Position(lineNumber, p.column)),
					options: {
						description: 'ghost-text',
						after: { content: p.text, inlineClassName: p.preview ? 'ghost-text-decoration-preview' : 'ghost-text-decoration', cursorStops: InjectedTextCursorStops.Left },
						showIfCollapsed: true,
					}
				});
			}).concat(hiddenTextDecorations));
		});
	}