-
Notifications
You must be signed in to change notification settings - Fork 57
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
TM4E breaks generic editor for text file #137
Comments
That's strange because #129 was not merged? We would like consume TextLMate grammar with GenericEditor by letting the user to register grammar with preferences (today this works only with the TextMate Editor) See #17 You have this error because a plugin (which plugin?) frines that:
That @mickaelistria has started with #129 But it requires some changes inside GenericEditor. It should be very cool if we could fix #17 |
At least, in case there is no TextMate grammar, the PresentationReconciler should break the whole editor (indepedently of all related issues). It should probably just log in the console and do nothing in that case. |
@mniewrzal please retry, c0f75b0 should fix your problem.
I have decided not to log something (in order to avoid polluating logs when Generic Editor open a text file or other thing where grammar doesn't exists). But I have kept the capability to throw an error if grammar or theme are not available. You can do that with
If you don't like this idea, please tell me. The cool thing is that now you can use user preferences grammar with Generic Editor. |
Looks ok now. Thanks! Your strategy to handle logging also sounds good. |
Cool:) |
I tried to open simple text file with generic editor but it was broken with
Failed to create the part's controls
message. Text file can be empty.org.eclipse.core.runtime.AssertionFailedException: null argument:Cannot find TextMate grammar for the given document at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:85) at org.eclipse.tm4e.ui.text.TMPresentationReconciler$InternalListener.inputDocumentChanged(TMPresentationReconciler.java:229) at org.eclipse.jface.text.TextViewer.fireInputDocumentChanged(TextViewer.java:2759) at org.eclipse.jface.text.TextViewer.setDocument(TextViewer.java:2800) at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:631) at org.eclipse.jface.text.source.projection.ProjectionViewer.setDocument(ProjectionViewer.java:365) at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:581) at org.eclipse.ui.texteditor.AbstractTextEditor.initializeSourceViewer(AbstractTextEditor.java:3999) at org.eclipse.ui.texteditor.AbstractTextEditor.createPartControl(AbstractTextEditor.java:3469) at org.eclipse.ui.texteditor.StatusTextEditor.createPartControl(StatusTextEditor.java:61) at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.createPartControl(AbstractDecoratedTextEditor.java:445) at org.eclipse.ui.internal.genericeditor.ExtensionBasedTextEditor.createPartControl(ExtensionBasedTextEditor.java:67) at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:151) at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPartControl(CompatibilityEditor.java:99) at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:355) 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:498)
The text was updated successfully, but these errors were encountered: