code: public void format(XtextResource resource) {
  		assert resource != null;
  		final String result = formatResource(resource);
  		// 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 resource.
  
  @param resource the resource of the code to format.