Bug when displaying quoted string in editor

Try this in a test window :

Code:
BEGIN
  dbms_output.put_line(q'['(Hello)' World]');
END;

This is accepted and can be executed without problem.
But it is displayed with wrong colour because editor consider )' as end of quoted string which is wrong (should be ]').

With PL/SQL Developer 11.0.5
 
Last edited:
Ig00VXL.png


At least 3 years passed since this bug is known?

Quoted strings are used just anywhere in anything bigger than HelloWorld in PL/SQL.
This is realy a shame.
 
Nope, even the brackets/braces/parentheses do not work fine. The example of Benjamin L's has valid point. The problem is that plsqldev recognizes its own, predefined set of qstring-closing char sequences, whereas it instead should read the qstring-opening sequence and match it with its proper qstring-closing sequence.

Examples:

Code:
BEGIN
    dbms_output.put_line(q'[a string that's well highlighted]');
    dbms_output.put_line(q'(a string that's well highlighted)');
    dbms_output.put_line(q'[a string that)'s wrongly highlighted]');
END;

Copy and paste it to plsqldev and see for yourself.

If you still don't know what we mean, that let's try it otherwise:
For syntax highlighting of strings your regular grammar based parsing won't be enough anymore, you are going to have to use context-free grammar (to keep the context of opening qstring sequence).
 
Last edited:
Dear developers of PLSD!
It is easy to fix that bug. You just need to make highlight regexp rules more accurate.
Fix refers to main form' (PLSQLDevForm: TPLSQLDevForm) objects SyntaxManager.SyntAnal*, which contains TokenRules with definitions of q-strings highlightings.
You should change all of 4 matches of

Code:
item
          DisplayName = 'String 2'
          StyleName = 'String'
          TokenType = 4
          Expression = '(?s)Q'#39'[\<\{\[\(].*?([\>\}\]\)]'#39'|\Z)'
          ColumnFrom = 0
          ColumnTo = 0
        end

to

Code:
item
          DisplayName = 'String 2'
          StyleName = 'String'
          TokenType = 4
          Expression = '(?s)Q'#39'\<.*?(\>'#39'|\Z)'
          ColumnFrom = 0
          ColumnTo = 0
        end
        item
          DisplayName = 'String 3'
          StyleName = 'String'
          TokenType = 4
          Expression = '(?s)Q'#39'\{.*?(\}'#39'|\Z)'
          ColumnFrom = 0
          ColumnTo = 0
        end
        item
          DisplayName = 'String 4'
          StyleName = 'String'
          TokenType = 4
          Expression = '(?s)Q'#39'\[.*?(\]'#39'|\Z)'
          ColumnFrom = 0
          ColumnTo = 0
        end
        item
          DisplayName = 'String 5'
          StyleName = 'String'
          TokenType = 4
          Expression = '(?s)Q'#39'\(.*?(\)'#39'|\Z)'
          ColumnFrom = 0
          ColumnTo = 0
        end
        item
          DisplayName = 'String 6'
          StyleName = 'String'
          TokenType = 4
          Expression = '(?s)Q'#39'(.).*?('#39'|\Z)'
          ColumnFrom = 0
          ColumnTo = 0
        end

I do it myself with help of Resource Tuner and it works fine with code examples of Peter H. and even with this:

Code:
BEGIN
SYS.DBMS_OUTPUT.put_line(q'#a string that's well highlighted q'{too}#');
END;

 
as I said before, I use "Resource Tuner" to find and change executable's resources.
My post is primarily intended for PLSD developers and their ambassador Marco :)
Described changes for common users need reversing of application, so it is not good idea to explain the process on that forum.
 
Wow, it's been a loooooong time since I tweaked EXE resources, I truly forgot about this option. Thank you, "lost" for refreshing my rather old memory, you're a star! This indeed opens a whole new world of possibilities (... which will be lost on each pldev update ;-)).
 
Peter H. said:
Wow, it's been a loooooong time since I tweaked EXE resources, I truly forgot about this option. Thank you, "lost" for refreshing my rather old memory, you're a star! This indeed opens a whole new world of possibilities (... which will be lost on each pldev update ;-)).
You're welcome ;)
Btw, same way I patch PLSD for NOT reading of "Run details" in DBMS Scheduler interface. Because open info of job is too slow, if you haven't index ON sys.scheduler$_event_log.
Or to show a scheme name of DB object source (when there was not such option). But, that fix was in code, not only in resources.
 
Back
Top