Print Thread
Page 1 of 2 1 2
Request: syntax highlight record when clicked and only record member when clicked
#36155 10/20/09 12:14 PM
Joined: Dec 2005
Posts: 2,004
Roima Denmark
Member
OP Offline
Member
Joined: Dec 2005
Posts: 2,004
Roima Denmark
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.

Re: Request: syntax highlight record when clicked and only record member when clicked
Claus Pedersen #36168 10/21/09 07:57 AM
Joined: Dec 2005
Posts: 2,004
Roima Denmark
Member
OP Offline
Member
Joined: Dec 2005
Posts: 2,004
Roima Denmark
BTW, code completion does show "x" and "y" when typing "my_record."

Re: Request: syntax highlight record when clicked and only record member when clicked
Claus Pedersen #36177 10/21/09 11:06 AM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
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.


Marco Kalter
Allround Automations
Re: Request: syntax highlight record when clicked and only record member when clicked
Marco Kalter #36186 10/21/09 01:34 PM
Joined: Dec 2005
Posts: 2,004
Roima Denmark
Member
OP Offline
Member
Joined: Dec 2005
Posts: 2,004
Roima Denmark
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.

Re: Request: syntax highlight record when clicked and only record member when clicked
Claus Pedersen #36187 10/21/09 01:35 PM
Joined: Dec 2005
Posts: 2,004
Roima Denmark
Member
OP Offline
Member
Joined: Dec 2005
Posts: 2,004
Roima Denmark
Marco, can the code completion issue be treated as a bug?

Re: Request: syntax highlight record when clicked and only record member when clicked
Claus Pedersen #36190 10/21/09 04:57 PM
Joined: Feb 2006
Posts: 619
Sao Paulo, Brazil
G
Member
Offline
Member
G
Joined: Feb 2006
Posts: 619
Sao Paulo, Brazil
Claus, I like Marco's interpretation on highlight better. If we were to have a change, this should be an option.

Regards,
Gustavo


There are 10 types of people: those who know binary and those who don't.
Re: Request: syntax highlight record when clicked and only record member when clicked
Marco Kalter #36191 10/21/09 07:30 PM
Joined: Jul 2004
Posts: 592
W
Member
Offline
Member
W
Joined: Jul 2004
Posts: 592
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 smile

Re: Request: syntax highlight record when clicked and only record member when clicked
Worker #36194 10/22/09 08:05 AM
Joined: Apr 2007
Posts: 95
Germany
E
Member
Offline
Member
E
Joined: Apr 2007
Posts: 95
Germany
I agree 100% with Worker.

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

SQL Query
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.

Re: Request: syntax highlight record when clicked and only record member when clicked
ed10k #36204 10/22/09 11:42 AM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
[quote]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.[/quote]
I'm not sure I understand. What exactly is the bug?


Marco Kalter
Allround Automations
Re: Request: syntax highlight record when clicked and only record member when clicked
Marco Kalter #36213 10/23/09 08:19 AM
Joined: Apr 2007
Posts: 95
Germany
E
Member
Offline
Member
E
Joined: Apr 2007
Posts: 95
Germany
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.

Page 1 of 2 1 2

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.045s Queries: 16 (0.016s) Memory: 2.5625 MB (Peak: 3.0380 MB) Data Comp: Off Server Time: 2024-05-04 15:45:34 UTC
Valid HTML 5 and Valid CSS