docs: @Pure
  	protected String formatResource(XtextResource resource) {
  		assert resource != null;
  		try {
  			final ITextRegionAccess regionAccess = this.regionAccessBuilder.get().forNodeModel(resource).create();
  			final FormatterRequest formatterRequest = new FormatterRequest();
  			formatterRequest.setAllowIdentityEdits(false);
  			formatterRequest.setTextRegionAccess(regionAccess);
  			final IPreferenceValues preferenceValues = FormatterFacade.this.configurationProvider
  					.getPreferenceValues(resource);
  			formatterRequest.setPreferences(TypedPreferenceValues.castOrWrap(preferenceValues));
  			final List<ITextReplacement> replacements = this.formatter.format(formatterRequest);
  			return regionAccess.getRewriter().renderToString(replacements);
  		} catch (Exception exception) {
  			throw Exceptions.sneakyThrow(exception);
  		}
  	}