Q7

Review text position/selection related commands

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.2.19
  • Fix Version/s: 1.3.x
  • Component/s: ECL, Runtime
  • Labels:
    None
  • Test Mode:
    Manual

Description

Problem

Currently because of natural evolution we have several semantically equivalent commands with different arguments and widget compatibility. It is required to clean mess up. Currently we have the following commands related to text selection, positioning and hovering:

  • click-text
  • hover-at-text-offset
  • hover-text
  • select-range
  • set-text-offset
  • set-text-selection

Proposal

I suggest to make text positions and regions first class citizens by introducing commands get-position and get-range, which would allow us to use existing commands like 'click', 'double-click'.
Several examples:

get-position 2 | click // single line text, instead of click-text 2
get-range -from 1 -to 5 | select // single line text, instead of click-text 1 5
get-position "8:24" | click // instead of set-caret-pos 8 24
get-range -from "8:24" -to "8:28" | select // instead of select-range 8 24 8 28
get-position "9:24" | click -with M1 // instead of set-caret-pos 9 24 \n open-declaration
get-position "9:24" | get-menu "Open Call Hierarchy" | click // instead of set-caret-pos 9 24 \n get-menu | click
get-position "9:24" | hover // instead of hover-text 9 24
get-range -from "8:24" -to "8:28" | get-property text | equals main | verify-true // not possible in current impl

Issue Links

Activity

Hide
Andrey Sobolev added a comment - 15/May/13 9:05 PM

One questions, position will be treated as input for click and so on, but input argument for click are ControlHandler, so it wont work. Are?

Show
Andrey Sobolev added a comment - 15/May/13 9:05 PM One questions, position will be treated as input for click and so on, but input argument for click are ControlHandler, so it wont work. Are?
Hide
komaz added a comment - 16/May/13 3:17 PM

I suggest to focus on 'what', not 'how' for now. If this approach is better than existing it might be a good starting point for custom widget support.

Show
komaz added a comment - 16/May/13 3:17 PM I suggest to focus on 'what', not 'how' for now. If this approach is better than existing it might be a good starting point for custom widget support.

People

  • Assignee:
    komaz
    Reporter:
    komaz
Vote (0)
Watch (0)

Dates

  • Created:
    15/May/13 6:10 PM
    Updated:
    25/Oct/13 1:54 PM