IDocument document = new Document(data.source);
ITextSelection selection = new TextSelection(document, data.sourceSelection.getOffset(),
data.sourceSelection.getLength());
IGrammarVersionProvider versionProvider = createVersionProvider();
RefactoringInfo info = new RefactoringInfo(document, selection, versionProvider);
ExtractLocalRefactoring refactoring = new ExtractLocalRefactoring(info);
ExtractLocalRequestProcessor requestProcessor = refactoring.getRequestProcessor();
requestProcessor.setVariableName("extracted_variable");
requestProcessor.setReplaceDuplicates(true);