protected Resource getXtextResource() {
		//FIXME: for helping to resolve #661
		final XtextEditor editor = getEditor();
		if (editor != null) {
			final IResource resource = editor.getResource();
			if (resource instanceof IStorage) {
				final IProject project = resource.getProject();
				if (project != null) {
					final ResourceSet resourceSet = this.resourceSetProvider.get(project);
					assert resourceSet != null;
					final URI uri = this.uriMapper.getUri((IStorage) resource);
					return resourceSet.getResource(uri, true);
				}
			}
		}
		return null;
	}
protected Resource getXtextResource ( ) { final XtextEditor editor = getEditor ( ) ; if ( editor != null ) { final IResource resource = editor . getResource ( ) ; if ( resource instanceof IStorage ) { final IProject project = resource . getProject ( ) ; if ( project != null ) { final ResourceSet resourceSet = this . resourceSetProvider . get ( project ) ; assert resourceSet != null ; final URI uri = this . uriMapper . getUri ( ( IStorage ) resource ) ; return resourceSet . getResource ( uri , true ) ; } } } return null ; }
Replies the current Xtext document that is supported by the linked editor.

@return the Xtext document, or {@code null} if neither an editor nor a
Xtext document was linked.