Menu

#121 Highlight occurences

None
pending
None
5
2016-09-23
2016-08-24
Bernd Sahre
No

Problem statement: If a user sets his cursor to a variable, object, parameter or method, Eclipse highlights all occurences in the editor. Unfortunately, other users cannot see these highlights, which the first user tends to be unaware of and may start talking about the occurences without his/her partner(s) begin able to follow.

Idea: It would be desiderable that all other users in the session could see this occurences marked by that first user.

Considerations:

  • There should be no interference between remote and local highlights.
  • If two or even more developers simultaneously set their cursor on a variable, those highlights could get confusing. To the very least, each highlight should be traceable to the user from whom it originated, e.g. by coloring it accordingly. Overall, this needs to be tried out practically -- maybe this feature should be limited to the follow mode?
  • Eclipse allows to toggle the local feature ("Toggle Mark Occurences", ALT+SHIFT+O). Maybe there should be second toggle button for these remote highlights?

Discussion

  • Donut

    Donut - 2016-08-24

    Depending on the entity to highlight this can get very messy. You also have to take into account, that there might be code already highlighted.

     
  • Bernd Sahre

    Bernd Sahre - 2016-08-24

    We(agsedo team) work on this ticket.
    The eclipse method which highlight the occurences is selectAndReveal() in the AbstractTextEditor.class (package org.eclipse.ui.texteditor; in org.eclipse.workbench.texteditor). The problem here is to understand all calls and Models of this "Annotation", how we can change the color and how the highlighting doesnt disappear after another user highlights occurences.

     
  • Franz Zieris

    Franz Zieris - 2016-08-24
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1 +1,8 @@
    -If a user sets his cursor to a variable, object, parameter or method, Eclipse highlights all occurences in the field of view of the user. Unfortunately, other users cannot see this occurences (unless they set their cursor to this position, too). It would be desiderable that all other users in this session could see this occurences marked by one user. Also, the highlighting should be in the color of the user, and should not delete or overwrite the highlightings of other users.
    +**Problem statement:** If a user sets his cursor to a variable, object, parameter or method, Eclipse highlights all occurences in the editor. Unfortunately, other users cannot see these highlights, which the first user tends to be unaware of and may start talking about the occurences without his/her partner(s) begin able to follow.
    +
    +**Idea:** It would be desiderable that all other users in the session could see this occurences marked by that first user.
    +
    +**Considerations:**
    +* There should be no interference between remote and local highlights.
    +* If two or even more developers simultaneously set their cursor on a variable, those highlights could get confusing. To the very least, each highlight should be traceable to the user from whom it originated, e.g. by coloring it accordingly. Overall, this needs to be tried out practically -- maybe this feature should be limited to the follow mode?
    +* Eclipse allows to toggle the local feature. Maybe there should be second toggle button for these remote highlights?
    
     
  • Franz Zieris

    Franz Zieris - 2016-08-24
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -3,6 +3,7 @@
     **Idea:** It would be desiderable that all other users in the session could see this occurences marked by that first user.
    
     **Considerations:**
    +
     * There should be no interference between remote and local highlights.
     * If two or even more developers simultaneously set their cursor on a variable, those highlights could get confusing. To the very least, each highlight should be traceable to the user from whom it originated, e.g. by coloring it accordingly. Overall, this needs to be tried out practically -- maybe this feature should be limited to the follow mode?
     * Eclipse allows to toggle the local feature. Maybe there should be second toggle button for these remote highlights?
    
     
  • Franz Zieris

    Franz Zieris - 2016-08-24
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -6,4 +6,4 @@
    
     * There should be no interference between remote and local highlights.
     * If two or even more developers simultaneously set their cursor on a variable, those highlights could get confusing. To the very least, each highlight should be traceable to the user from whom it originated, e.g. by coloring it accordingly. Overall, this needs to be tried out practically -- maybe this feature should be limited to the follow mode?
    -* Eclipse allows to toggle the local feature. Maybe there should be second toggle button for these remote highlights?
    +* Eclipse allows to toggle the local feature ("Toggle Mark Occurences", ALT+SHIFT+O). Maybe there should be second toggle button for these remote highlights?
    
     
  • Michaela B

    Michaela B - 2016-08-24

    We have got two ideas so far.
    In fu_berlin.inf.dpp.editor.internal.LocationAnnotationManager.setSelection we added the following lines:

    Option 1:

        ISelectionProvider selectionProvider = textEditor
            .getSelectionProvider();
    
        ITextSelection eclipseSelection = new TextSelection(offset, length);
        selectionProvider.setSelection(eclipseSelection);
    

    Option 2:

        textEditor.selectAndReveal(offset, length);
    

    Both Options lead to the following result:
    If the cursor is set to a variable in the remote editor and all the variables occurences are marked, the local editor will mark the variable too. As soon as the local curser is set to an other variable though, the mark of the variable will disappear and the new one will be marked.
    We haven't found an option to change the color yet or to solve that problem.

    I think here or in the following called methods, it is defenitely the right place to trigger the "mark all occurences of a variable" part, I am just not sure whether this is the right way to solve it.

     

    Last edit: Michaela B 2016-08-24
  • Franz Zieris

    Franz Zieris - 2016-09-23
    • status: open --> pending
    • assigned_to: Bernd Sahre --> Stefan Rossbach
     

Log in to post a comment.