facebook

Syntax coloring on CodeMix 3.10.201904111446 raises exceptions

  1. CodeMix & Angular IDE
  2.  > 
  3. Getting Help
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #612790 Reply

    lainhart
    Participant

    CodeMix 20190411 with MyEclipse Version: CI 2019.4.0; Build id: 16.0.0-20190403

    My goal is to get the syntax coloring of Javascript files to match the defaults given in Eclipse/JSDT. To that end, I open Window/Preferences/CodeMix/Syntax Coloring, and change color on items like “Comments”, “Keywords”, etc. On the current editor, the syntax coloring finally takes, but I see a bunch of IAE exceptions. Subsequent editing sessions, I’m not seeing the coloring. Stack traces for the two errors are in the attached file (including the traces inline exceeds max character threshold).

    Somewhat related – I also note that the “Enable” toggle on that “Syntax Coloring” page is non-selectable, although enabled – not sure what that’s for.

    — Todd

    Attachments:
    You must be logged in to view attached files.
    #612792 Reply

    Aaron Lara
    Member

    Todd, Sorry you are having this issue. I quickly tried to replicate it at my end by changing all the colors on the Syntax Coloring page but it just worked for me.

    By Inspecting the code it looks like one of the color values was not correctly parsed. Can you share to me the following preference file?
    MyEclipse_Workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.genuitec.eclipse.code.ui.prefs

    Additonally you can try clicking Restore Defaults in that page and see if this time it parses the colors correctly. But if you are using a Dark based theme, ir will result in bad coloring. (Make sure to back up the file I just mentioned before this).

    Cheers!
    Aaron Lara

    #612794 Reply

    lainhart
    Participant

    Hi Aaron –

    Thanks for the quick response. I’ve copied the contents of the file you requested below.

    I did click Restore Defaults to bring me back to the system defaults (which are too colorful/distracting for me – my reason for changing). I didn’t try to set again, as I assume I would end up with the same results.

    My color theme the light(ish) Eclipse color theme – no darks.

    Thanks — Todd

    
    com.genuitec.eclipse.code.extensionsmanager.shown=true
    deletedObsoleteMarkers=true
    eclipse.preferences.version=1
    editorsAddedAsDefault=js,
    editorsRemovedFromDefault=
    initializedAutoCloseTag=true
    initializedCodeMining=true
    initializedEditor=true
    initializedHTMLHint=true
    initializedIntellisense=true
    unsetCheckJs=true
    
    #612795 Reply

    Aaron Lara
    Member

    Todd, did you share the file before you changed the colors? Asking because it looks like the default one. With the modified colors it would have more content, like KEYWORD=\#ff00ff | false | false | false | false.

    I would suggest you edit it again with the colors you like and if it fails for you again, share the file with me so I can try at my end with the exact same colors. That would be really helpful.

    Of course I will also raise a bug and add protection so this sort of issues won’t happen in the future.

    Thanks!
    Aaron Lara

    #612804 Reply

    lainhart
    Participant

    Sorry Aaron – I shared the file after I reset to defaults, after encountering the errors that prompted this bug. The new file is below. Only some of the values took. When I first started to change colors, and selected “Apply” (not “Apply and Close”), I saw the two errors documented in the original post of this bug.

    — Todd

    
    DELIMITER=\#000000 | false | false | false | false
    FUNCTION=\#000000 | false | false | false | false
    KEYWORD=\#800040 | true | false | false | false
    NUMERIC=\#000000 | false | false | false | false
    OPERATOR=\#000000 | false | false | false | false
    PUNCTUATION=\#000000 | false | false | false | false
    STRING=\#0000ff | false | false | false | false
    SUPPORT=\#000000 | false | false | false | false
    VALUE=\#000000 | false | false | false | false
    VARIABLE=\#000000 | false | false | false | false
    com.genuitec.eclipse.code.extensionsmanager.shown=true
    deletedObsoleteMarkers=true
    eclipse.preferences.version=1
    editorsAddedAsDefault=js,
    editorsRemovedFromDefault=
    initializedAutoCloseTag=true
    initializedCodeMining=true
    initializedEditor=true
    initializedHTMLHint=true
    initializedIntellisense=true
    unsetCheckJs=true
    
    #612812 Reply

    Aaron Lara
    Member

    Thanks for the extra details! I will raise a bug to investigate this issue. Thanks again Todd! 🙂 You were on fire today! Have a good one!

    Cheers!
    Aaron Lara

    #612843 Reply

    Aaron Lara
    Member

    Todd, I was not able to replicate the issue but we added some protection to prevent it. This fix will be included in the next CodeMix release. It would be great if you can give it a try by following the instructions:

    1. Shut Down MyEclipse
    2. Download and extract the attached plugins.zip file.
    3. Back up the file MyEclipse_Install/plugins/com.genuitec.eclipse.code.ui_3.1.0.201904102257.jar.
    4. Replace the existing file with the one extracted in step 2.
    5. Start MyEclipse and channge the colors to the ones you desire (or just replace the pref file with the values you shared earlier before starting it).

    Let me know if that gets you up and going with the colors you prefer.

    Cheers!
    Aaron Lara

    Attachments:
    You must be logged in to view attached files.
    #612881 Reply

    lainhart
    Participant

    Much better on standalone JS files. I did see the following (multiple) errors, when editing some Javascript in an embedded Eclipse editor, and select “Open With->Javascript :: CodeMix”:

    
    eclipse.buildId=16.0.0.CI-004
    java.version=11.0.2
    java.vendor=Oracle Corporation
    BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
    Framework arguments:  -showLocation
    Command-line arguments:  -os win32 -ws win32 -arch x86_64 -data c:\eclipseWorkspaces\JiraRD.MyEclipse -showLocation
    
    com.genuitec.eclipse.code.ui
    Error
    Thu Apr 18 08:32:05 EDT 2019
    <null>
    
    org.eclipse.jface.text.BadLocationException
    	at org.eclipse.jface.text.ListLineTracker.getLineOffset(ListLineTracker.java:197)
    	at org.eclipse.jface.text.AbstractLineTracker.getLineOffset(AbstractLineTracker.java:160)
    	at org.eclipse.jface.text.AbstractDocument.getLineOffset(AbstractDocument.java:876)
    	at com.genuitec.eclipse.code.ui.editor.CodeDocumentUtil.toOffset(CodeDocumentUtil.java:60)
    	at com.genuitec.eclipse.code.ui.editor.CodeDocumentUtil.rangeToRegion(CodeDocumentUtil.java:92)
    	at com.genuitec.eclipse.code.ui.editor.SyntaxHighlighter.updateDocumentFromTokens(SyntaxHighlighter.java:200)
    	at com.genuitec.eclipse.code.ui.editor.SyntaxHighlighter.tokensChanged(SyntaxHighlighter.java:187)
    	at com.genuitec.eclipse.code.ui.editor.CodeEditor.lambda$8(CodeEditor.java:747)
    	at com.genuitec.eclipse.code.ui.editor.IncomingEventsQueue.processEvents(IncomingEventsQueue.java:164)
    	at com.genuitec.eclipse.code.ui.editor.IncomingEventsQueue.processQueue(IncomingEventsQueue.java:158)
    	at com.genuitec.eclipse.code.ui.editor.IncomingEventsQueue.lambda$0(IncomingEventsQueue.java:53)
    	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
    	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
    	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3919)
    	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3550)
    	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1173)
    	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
    	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1062)
    	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
    	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:636)
    	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
    	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:563)
    	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:151)
    	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:155)
    	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
    	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
    	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
    	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
    	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:595)
    	at org.eclipse.equinox.launcher.Main.run(Main.java:1501)
    	at org.eclipse.equinox.launcher.Main.main(Main.java:1474)
    
    
    #613068 Reply

    Aaron Lara
    Member

    Todd, great to know colors are looking much better for you now. Thanks for trying it out. Regarding the exception you shared we are going to work on a fix for it for next release too. What kind of file are you using in this case? is this javascript inside html file?

    Cheers,
    Aaron Lara

    #613093 Reply

    lainhart
    Participant

    Hi Aaron –

    It’s actually JS embedded in XML, *but*, the file is extracted from the XML into a (Eclipse-based) linked resource, prior to opening an editor on it.

    — Todd

    #613094 Reply

    Aaron Lara
    Member

    Todd, it would be really helpful if you can provide us with an example file so we can see and test locally, or if you have some steps we can follow up even better.

    Thanks!
    Aaron Lara

    #615856 Reply

    support-swapna
    Moderator

    Todd,

    Our latest release CodeMix CI 2019.6.11 is out with the fix for the exceptions that are logged when changing syntax coloring.
    Please update via Help > Check for Updates and let us know if you see any issues.

    –Swapna
    Genuitec Support

Viewing 12 posts - 1 through 12 (of 12 total)
Reply To: Syntax coloring on CodeMix 3.10.201904111446 raises exceptions

You must be logged in to post in the forum log in