Request: syntax highlight record when clicked and only record member when clicked

Claus Pedersen

Member³
When clicking on a record variable (without member specification, for instance when declared), all lines with the record is syntax highlighted.

When clicking on a record variable with member specification, only the use of this member specification is highlighted. This is a bug-fix from version 7.1 and is OK.

But when clicking on the first part of a record variable (before the member specification), all uses of the record should be highlighted.

E.g.:
Code:
DECLARE
  TYPE my_type IS RECORD (
    x NUMBER,
    y NUMBER);
  my_record my_type;       -- line 5
BEGIN
  my_record.x := 2;        -- line 7
  my_record.y := 3;        -- line 8
  IF my_record.y = 2 THEN  -- line 9
    my_record.x := 7;      -- line 10
  END IF;
END;

When 'my_record' in line 5 is clicked, lines 5,7,8,9,and 10 are highlighted. When 'my_record.x' is clicked, lines 5, 7, and 10 are highligthed.
My request is that when 'my_record' in line 7 is clicked, the same lines are highlighted as when 'my_record' is clicked in line 5.
Only when 'x' in line 7 is clicked, should lines 5, 7, and 10 should be highlighted.
 
This is by design:
  • Placing the cursor on my_record.x will highlight all occurrences of my_record and my_record.x, but not my_record.y.
  • Placing the cursor on my_record will highlight all occurrences of my_record, my_record.x, and my_record.y.
This seems correct for impact analysis.
 
I would expect that when placing cursor anywhere on the 'word' my_record would mark all instances, no matter whether my_record was followed by .x or not.

E.g. placing cursor on variable declaration my_record would highlight my_record, my_record.x, and my_record.y
But placing the cursor on the 'word' my_record in my_record.x, for instance in position 4, would act similarly.

But placing the cursor on the 'word' x in my_record.x (position 10), would highlight only my_record.x and nothing else.

I.e. the record variable is to be treated in two different ways depending on the cursor position (before or after the dot).

I hope you can understand my rather wordy explanation.
 
Claus, I like Marco's interpretation on highlight better. If we were to have a change, this should be an option.

Regards,
Gustavo
 
I can see Claus' point. With the current implementation, the only way to highlight all occurrences of my_record is to put the cursor in the variable declaration, because for record types that is usually the only place it appears without a member.

The following design would make sense to me (which I think is also what Claus suggested):
  • Placing the cursor on my_record (regardless of existence of trailing period and member) will highlight all occurrences of my_record (regardless of existence of, and without highlighting any trailing period and member).
  • Placing the cursor on the ".member" part of a record will highlight the complete "my_record.member", all occurrences thereof, and also all occurrences of my_record where it is used without a trailing period and member (for impact analysis).
But I'm sure I can survive with the current design as well :)
 
I agree 100% with Worker.

Also please note that the current implementation has a little bug:

SQL:
DECLARE
  TYPE my_type IS RECORD (
    x NUMBER,
    y NUMBER);
  my_record my_type;       -- line 5
BEGIN
  my_record.x := 2;        -- line 7
  my_record.y := 3;        -- line 8
  IF my_record.y = 2 THEN  -- line 9
    my_record.x := 7;      -- line 10
  END IF;
END;

If you click at line 7 then lines 5, 7 and 10 are highlighted. OK.
If you click after that at the line 7 then nothing chanches.
Should be: highlight of lines 5, 7 .. 10.
 
If you click at line 7 then lines 5, 7 and 10 are highlighted. OK.
If you click after that at the line 7 then nothing chanches.
Should be: highlight of lines 5, 7 .. 10.
I'm not sure I understand. What exactly is the bug?
 
Excuse me, a little mistake.
Right version:
If you click at line 7 then lines 5, 7 and 10 are highlighted. OK.
If you click after that at the line 75 then nothing chanches.
Should be: highlight of lines 5, 7 .. 10.
 
Are there any changes planned for highlighting record types? I know you said the current implementation is by design, but a co-worker mentioned disliking the current implementation and I want to share the good news with him if there is any :)
 
The current behavior makes it difficult to highlight every occurrence of a record because you need to click somewhere where the record is used without a member. If you click on a record+member, only occurrences of record+member are highlighted and not record+othermember.

The behavior described earlier in this thread by Claus and myself would make record-highlighting smarter and more powerful (and IMHO, more logical).
 
Back
Top