/** * Verifies that FoldedPositions are valid. * If the assertion fails that is probably due to an ITextRegion.EMPTY_REGION being provided for the object's significant text region. */ @Test @BugTest("ACF-2605") public void testFoldedPositions() { Collection<FoldedPosition> foldingRegions = getXtextTestUtil().get(IFoldingRegionProvider.class).getFoldingRegions(getDocument()); for (DefaultFoldedPosition foldedPosition : Iterables.filter(foldingRegions, DefaultFoldedPosition.class)) { try { Assert.assertFalse("Illegal significant region for FoldedPosition " + foldedPosition, foldedPosition.computeCaptionOffset(getDocument()) < 0); /* If the above assertion fails that is probably due to an ITextRegion.EMPTY_REGION being provided for the object's significant text region. */ } catch (BadLocationException e) { fail("Bad location for FoldedPosition: " + e.getMessage()); } } }
@Override public void configure(final Binder binder) { super.configure(binder); binder.requestStaticInjection(AntlrConsoleFactory.class); binder.requestStaticInjection(AntlrHighlightingConfiguration.class); binder.bind(GrammarResource.class).to(DefaultGrammarResource.class); binder.bind(ToolOptionsProvider.class).to(DefaultToolOptionsProvider.class); binder.bind(Antlr4FoldingPreferenceStoreInitializer.class); binder.bind(BuildPreferenceStoreInitializer.class); binder.bind(IFoldingStructureProvider.class).to(Antlr4FoldingStructureProvider.class); binder.bind(IFoldingRegionProvider.class).to(Antlr4FoldingRegionProvider.class); binder.bind(String.class) .annotatedWith(Names.named(AbstractMultiLineCommentProvider.START_TAG)) .toInstance("/\\*\\*"); binder.bind(IActionContributor.class).annotatedWith(Names.named("Show Whitespace")) .to(ShowWhitespaceCharactersActionContributor.class); binder.bind(TodoListProcessor.class); binder.bind(RefreshProjectProcessor.class); binder.bind(IPath.class).annotatedWith(Names.named("stateLocation")).toInstance(stateLocation); ConsoleImpl.getLogger().addAppender(new DefaultConsole()); }
public Class<? extends IFoldingRegionProvider> bindFoldingRegionProvider() { return z80FoldingRegionProvider.class; }
public Class<? extends IFoldingRegionProvider> bindFoldingRegionProvider() { return GamaFoldingRegionProvider.class; }