src/vs/workbench/contrib/comments/browser/commentThreadWidget.ts/ReviewZoneWidget/createCommentForm
class ReviewZoneWidget:	private createCommentForm() {
		const hasExistingComments = this._commentThread.comments && this._commentThread.comments.length > 0;
		const commentForm = dom.append(this._bodyElement, dom.$('.comment-form'));
		const commentEditor = this._scopedInstatiationService.createInstance(SimpleCommentEditor, commentForm, SimpleCommentEditor.getEditorOptions(), this._parentEditor, this);
		const commentEditorIsEmpty = CommentContextKeys.commentIsEmpty.bindTo(this._contextKeyService);
		commentEditorIsEmpty.set(!this._pendingComment);

		this._commentReplyComponent = {
			form: commentForm,
			editor: commentEditor,
			commentEditorIsEmpty
		};

		const modeId = generateUuid() + '-' + (hasExistingComments ? this._commentThread.threadId : ++INMEM_MODEL_ID);
		const params = JSON.stringify({
			extensionId: this.extensionId,
			commentThreadId: this.commentThread.threadId
		});

		let resource = URI.parse(`${COMMENT_SCHEME}://${this.extensionId}/commentinput-${modeId}.md?${params}`); // TODO. Remove params once extensions adopt authority.
		let commentController = this.commentService.getCommentController(this.owner);
		if (commentController) {
			resource = resource.with({ authority: commentController.id });
		}

		const model = this.modelService.createModel(this._pendingComment || '', this.modeService.createByFilepathOrFirstLine(resource), resource, false);
		this._disposables.add(model);
		commentEditor.setModel(model);
		this._disposables.add(commentEditor);
		this._disposables.add(commentEditor.getModel()!.onDidChangeContent(() => {
			this.setCommentEditorDecorations();
			commentEditorIsEmpty?.set(!commentEditor.getValue());
		}));

		this.createTextModelListener(commentEditor, commentForm);

		this.setCommentEditorDecorations();

		// Only add the additional step of clicking a reply button to expand the textarea when there are existing comments
		if (hasExistingComments) {
			this.createReplyButton(commentEditor, commentForm);
		} else {
			if (this._commentThread.comments && this._commentThread.comments.length === 0) {
				this.expandReplyArea();
			}
		}
		this._error = dom.append(commentForm, dom.$('.validation-error.hidden'));

		this._formActions = dom.append(commentForm, dom.$('.form-actions'));
		this.createCommentWidgetActions(this._formActions, model);
		this.createCommentWidgetActionsListener();
	}