code: public void formatRegion(XtextResource resource, int offset, int length) {
  		assert resource != null;
  		assert offset >= 0;
  		assert length >= 0;
  		final String result = formatResourceRegion(resource, offset, length);
  		// Write back to the resource
  		try (StringInputStream stringInputStream = new StringInputStream(result)) {
  			resource.load(stringInputStream, Collections.emptyMap());
  		} catch (Exception exception) {
  			throw Exceptions.sneakyThrow(exception);
  		}
  	}
docs: Format the code in the given region.
  
  @param resource the resource to format.
  @param offset the offset of the text to format.
  @param length the length of the text.