예제 #1
0
 @Override
 public void setUp() throws Exception {
   super.setUp();
   modelAsText =
       "stuff mystuff\nstuff yourstuff refs _mystuff stuff hisstuff refs _yourstuff// Comment";
   IFile file = IResourcesSetupUtil.createFile("test/test.testlanguage", modelAsText);
   editor = openEditor(file);
   document = editor.getDocument();
   hover =
       Activator.getInstance()
           .getInjector(getEditorId())
           .getInstance(ProblemAnnotationHover.class);
   hover.setSourceViewer(editor.getInternalSourceViewer());
   List<Issue> issues =
       document.readOnly(
           new IUnitOfWork<List<Issue>, XtextResource>() {
             public List<Issue> exec(XtextResource state) throws Exception {
               return state
                   .getResourceServiceProvider()
                   .getResourceValidator()
                   .validate(state, CheckMode.ALL, null);
             }
           });
   MarkerCreator markerCreator =
       Activator.getInstance().getInjector(getEditorId()).getInstance(MarkerCreator.class);
   for (Issue issue : issues) {
     markerCreator.createMarker(issue, file, MarkerTypes.forCheckType(issue.getType()));
   }
 }
예제 #2
0
 @Override
 public void setUp() throws Exception {
   super.setUp();
   setInjector(
       Activator.getInstance()
           .getInjector("org.eclipse.xtext.ui.tests.refactoring.RefactoringTestLanguage"));
   getInjector().injectMembers(this);
   fragmentProvider.setUseNames(true);
 }
예제 #3
0
 @Override
 public void setUp() throws Exception {
   super.setUp();
   IJavaProject project = JavaProjectSetupUtil.createJavaProject(TEST_PROJECT);
   addNature(project.getProject(), XtextProjectHelper.NATURE_ID);
   Injector injector = Activator.getInstance().getInjector(getEditorId());
   injector.injectMembers(this);
   IFile fooFile =
       IResourcesSetupUtil.createFile(TEST_PROJECT + "/foo.refactoringtestlanguage", "foo");
   IFile barFile =
       IResourcesSetupUtil.createFile(
           TEST_PROJECT + "/bar.refactoringtestlanguage", "bar { ref foo }");
   waitForAutoBuild();
   fooEditor = openEditor(fooFile);
   barEditor = openEditor(barFile);
   assertTrue(refactoringPreferences.useInlineRefactoring());
 }
 @Override
 protected Injector getInjector() {
   return Activator.getInstance()
       .getInjector(
           Activator.ORG_ECLIPSE_XTEXT_UI_TESTS_EDITOR_CONTENTASSIST_BUG360834TESTLANGUAGE);
 }
 @Override
 protected Bundle getBundle() {
   return Activator.getInstance().getBundle();
 }