Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatter don't work #5

Open
borisbrodski opened this issue Oct 7, 2015 · 0 comments
Open

Formatter don't work #5

borisbrodski opened this issue Oct 7, 2015 · 0 comments

Comments

@borisbrodski
Copy link
Owner

Formatting ExampleColumn.spec I get

java.lang.IllegalStateException
    at org.eclipse.xtext.formatting2.regionaccess.internal.NodeModelBasedRegionAccessBuilder.process(NodeModelBasedRegionAccessBuilder.java:219)
    at org.eclipse.xtext.formatting2.regionaccess.internal.NodeModelBasedRegionAccessBuilder.process(NodeModelBasedRegionAccessBuilder.java:210)
    at org.eclipse.xtext.formatting2.regionaccess.internal.NodeModelBasedRegionAccessBuilder.process(NodeModelBasedRegionAccessBuilder.java:210)
    at org.eclipse.xtext.formatting2.regionaccess.internal.NodeModelBasedRegionAccessBuilder.process(NodeModelBasedRegionAccessBuilder.java:210)
    at org.eclipse.xtext.formatting2.regionaccess.internal.NodeModelBasedRegionAccessBuilder.getEObjectToTokensMap(NodeModelBasedRegionAccessBuilder.java:86)
    at org.eclipse.xtext.formatting2.regionaccess.internal.NodeModelBasedRegionAccess.<init>(NodeModelBasedRegionAccess.java:29)
    at org.eclipse.xtext.formatting2.regionaccess.internal.NodeModelBasedRegionAccessBuilder.create(NodeModelBasedRegionAccessBuilder.java:57)
    at org.eclipse.xtext.formatting2.regionaccess.TextRegionAccessBuilder.create(TextRegionAccessBuilder.java:36)
    at org.eclipse.xtext.ui.editor.formatting2.ContentFormatter.initRequest(ContentFormatter.java:126)
    at org.eclipse.xtext.ui.editor.formatting2.ContentFormatter.exec(ContentFormatter.java:88)
    at org.eclipse.xtext.ui.editor.formatting2.ContentFormatter$FormattingUnitOfWork.exec(ContentFormatter.java:57)
    at org.eclipse.xtext.ui.editor.formatting2.ContentFormatter$FormattingUnitOfWork.exec(ContentFormatter.java:1)
    at org.eclipse.xtext.resource.OutdatedStateManager.exec(OutdatedStateManager.java:121)
    at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.internalReadOnly(XtextDocument.java:520)
    at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.priorityReadOnly(XtextDocument.java:485)
    at org.eclipse.xtext.ui.editor.model.XtextDocument.priorityReadOnly(XtextDocument.java:142)
    at org.eclipse.xtext.ui.editor.formatting2.ContentFormatter.format(ContentFormatter.java:103)
    at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:1023)
    at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1501)
    at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:128)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.texteditor.TextOperationAction.run(TextOperationAction.java:126)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
    at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:122)
    at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:252)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:234)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
    at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:493)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:486)
    at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:286)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:507)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:558)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:378)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$0(KeyBindingDispatcher.java:324)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:86)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1266)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1112)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1137)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1122)
    at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1164)
    at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1160)
    at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1581)
    at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4795)
    at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:343)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4676)
    at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5050)
    at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3767)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1488)

Removing all annotations the formatter starts working, but still throws this one:

org.eclipse.xtext.formatting2.FormattingNotApplicableException
    at org.eclipse.xtext.formatting2.internal.MaxLineWidthDocument.validate(MaxLineWidthDocument.java:55)
    at org.eclipse.xtext.formatting2.internal.MaxLineWidthDocument.validate(MaxLineWidthDocument.java:60)
    at org.eclipse.xtext.formatting2.internal.MaxLineWidthDocument.addReplacer(MaxLineWidthDocument.java:32)
    at org.eclipse.xtext.formatting2.internal.FormattableDocument.set(FormattableDocument.java:309)
    at org.eclipse.xtext.formatting2.internal.FormattableDocument.append(FormattableDocument.java:83)
    at org.eclipse.xtext.xbase.formatting2.XbaseFormatter.formatExpressionsMultiline(XbaseFormatter.java:2182)
    at org.eclipse.xtext.xbase.formatting2.XbaseFormatter._format(XbaseFormatter.java:1891)
    at org.jnario.spec.formatting2.SpecFormatter.format(SpecFormatter.java:318)
    at org.eclipse.xtext.formatting2.internal.FormattableDocument.format(FormattableDocument.java:180)
    at org.eclipse.xtext.xbase.formatting2.XbaseFormatter$20.format(XbaseFormatter.java:412)
    at org.eclipse.xtext.formatting2.internal.ConditionalReplacer.createReplacements(ConditionalReplacer.java:41)
    at org.eclipse.xtext.formatting2.internal.FormattableDocument.createReplacements(FormattableDocument.java:143)
    at org.eclipse.xtext.formatting2.internal.FormattableDocument.renderToTextReplacements(FormattableDocument.java:281)
    at org.eclipse.xtext.formatting2.AbstractFormatter2.format(AbstractFormatter2.java:262)
    at org.eclipse.xtext.ui.editor.formatting2.ContentFormatter.exec(ContentFormatter.java:90)
    at org.eclipse.xtext.ui.editor.formatting2.ContentFormatter$FormattingUnitOfWork.exec(ContentFormatter.java:57)
    at org.eclipse.xtext.ui.editor.formatting2.ContentFormatter$FormattingUnitOfWork.exec(ContentFormatter.java:1)
    at org.eclipse.xtext.resource.OutdatedStateManager.exec(OutdatedStateManager.java:121)
    at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.internalReadOnly(XtextDocument.java:520)
    at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.priorityReadOnly(XtextDocument.java:485)
    at org.eclipse.xtext.ui.editor.model.XtextDocument.priorityReadOnly(XtextDocument.java:142)
    at org.eclipse.xtext.ui.editor.formatting2.ContentFormatter.format(ContentFormatter.java:103)
    at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:1023)
    at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1501)
    at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:128)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.texteditor.TextOperationAction.run(TextOperationAction.java:126)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
    at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:122)
    at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
    at sun.reflect.GeneratedMethodAccessor124.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:252)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:234)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
    at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:493)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:486)
    at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:286)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:507)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:558)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:378)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$0(KeyBindingDispatcher.java:324)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:86)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1266)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1112)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1137)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1122)
    at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1164)
    at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1160)
    at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1581)
    at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4795)
    at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:343)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4676)
    at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5050)
    at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3767)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
ghaith referenced this issue in ghaith/Jnario Apr 30, 2017
Added an index method to fetch the name
removed NonStoringBatchLinkableResourceStorageFacade
ghaith referenced this issue in ghaith/Jnario Apr 30, 2017
Added an index method to fetch the name
removed NonStoringBatchLinkableResourceStorageFacade
ghaith referenced this issue in ghaith/Jnario May 15, 2017
Fix for #5 Use index in ExampleNameProvider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant