facebook

Bug when setting mark in a java source file.

  1. Copilot4Eclipse – GitHub Copilot on Eclipse
  2.  > 
  3. General Discussion

Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #699444 Reply

    JBcopilot
    Participant

    I get the following stacktrace when attempting to set the mark in a source file. This is a Copliot4Eclipse bug. I couldn’t find anywhere but this discussion forum to report the bug.

    java.lang.ClassCastException: class org.eclipse.jface.text.MarkSelection cannot be cast to class org.eclipse.jface.text.ITextSelection (org.eclipse.jface.text.MarkSelection and org.eclipse.jface.text.ITextSelection are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @2387f552)
            at com.genuitec.copilot4eclipse.CopilotEditSession.handleSelectionEvent(Unknown Source)
            at com.genuitec.copilot4eclipse.CopilotEditSession$1.selectionChanged(Unknown Source)
    
    #699446 Reply

    support-swapna
    Moderator

    Hi,

    Thank you for trying CoPilot and reporting this bug.
    I ran few tests with adding book mark in the editor and could not replicate the problem.
    Can you please clarify how you are setting the mark? If possible, please attach a screenshot to help us get a visual.
    Also share the Eclipse Version and distribution details.

    Apologies for inconvenience caused.

    –Swapna
    Genuitec Support

    #699449 Reply

    JBcopilot
    Participant

    “Setting the mark” means typing <CTRL>-space in the java file (emacs keybinding mode). It marks the position in the text so you can then select a region with the keyboard.

    You can see what the bug has to be from the stacktrace snippet I sent. It’s in genuitec code: com.genuitec.copilot4eclipse.CopilotEditSession.handleSelectionEvent

    and in that code you’re casting an org.eclipse.jface.text.MarkSelection to org.eclipse.jface.text.ITextSelection

    which is not a valid cast since MarkSelection is not in the type hierarchy for ITextSelection.

    The type hierarchy for MarkSelection is ISelection -> IMarkSelection -> MarkSelection
    ITextSelection splits off further up the tree: ISelection -> ITextSelection

    See: https://help.eclipse.org/latest/nftopic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/viewers/ISelection.html

    Hope that helps!

    (Eclipse details:
    Eclipse IDE for Enterprise Java and Web Developers (includes Incubating components)

    Version: 2023-12 (4.30.0)
    Build id: 20231201-2043)

    • This reply was modified 9 months, 3 weeks ago by JBcopilot.
    #699454 Reply

    wayne
    Moderator

    Thx for sharing the details. We will be investigating asap. Our next planned release is 1.0 production in early Jan. We will update you on the status of this issue as we work on a fix and when it will be available.
    Wayne

    #699461 Reply

    JBcopilot
    Participant

    Great. FYI: the same bug is tickled if I type <CTRL>-s (incremental find). I guess that also sets the mark.

    #699464 Reply

    wayne
    Moderator

    Again thx. Submitted a fix and should be in next release.
    W

    #699802 Reply

    wayne
    Moderator

    We just released the 1.0.0 version of Copilot4Eclipse that resolves the bug you reported.
    Details here
    Please share if this update resolves your network issues.
    Wayne

    • This reply was modified 8 months, 3 weeks ago by wayne.
Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Bug when setting mark in a java source file.

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