src/vs/workbench/services/configuration/common/jsonEditingService.ts/JSONEditingService/resolveAndValidate
class JSONEditingService:	private async resolveAndValidate(resource: URI, checkDirty: boolean): Promise<IReference<IResolvedTextEditorModel>> {
		const reference = await this.resolveModelReference(resource);

		const model = reference.object.textEditorModel;

		if (this.hasParseErrors(model)) {
			reference.dispose();
			return this.reject<IReference<IResolvedTextEditorModel>>(JSONEditingErrorCode.ERROR_INVALID_FILE);
		}

		// Target cannot be dirty if not writing into buffer
		if (checkDirty && this.textFileService.isDirty(resource)) {
			reference.dispose();
			return this.reject<IReference<IResolvedTextEditorModel>>(JSONEditingErrorCode.ERROR_FILE_DIRTY);
		}

		return reference;
	}