Program Window x REM comments and syntax highlight

Gustavo

Member³
Syntax highlight can't handle the ['] character within REM comments.
Sample code:
Code:
-- Testing comments '
/* Testing comments ' */
REM Testing comments '
Create Or Replace ...
Can this be enhanced for v12?

Best regards,
Gustavo
 
I think I posted on this a while ago and decided to enclose all the REM lines in such files with /* ... */.

I suspect it might be tricky to handle as "REM" at the start of a line is not a comment in PL/SQL, but maybe the "ignore unrecognised PL/SQL" option can be enhanced to treat the all lines in a Program Window that are outside their top level unit as command window and apply comment rules accordingly.

When a typical script we use for package spec and body is displayed as a Program Window it currently has 3 tabs. The first of which starts with REM lines for the file mod history followed by the package spec, the second has "show errors" followed by the package body and the third just "show errors". The "/" to actually build the package (spec) is added when the file is saved. If the "save errors" could be usefully automated on file open/save, too then that would be fab. I think I saw an extension for that...

Maybe it would help to further separate such files, e.g.:

Code:
(Tab 1 - Command Window Style)
REM Mod history ...
REM ..
REM SQL*Plus comments aren't processed here, yet

(Tab 2 - Program Window Style)
create or replace package wibble as
  // PL/SQL Comment
  procedure setGlobal(p_input pls_integer);
  function getGlobal return pls_integer;
end wibble;

(Tab 3 - Program Window Style)
create or replace package body wibble as
  g_global pls_integer;
  procedure setGlobal(p_input pls_integer) is
  begin
    g_Global := p_Global;
  end setGlobal;
  function getGlobal return pls_integer is
  begin
    return g_Global;
  end setGlobal;
end wibble;
(Tab 4 - Command Window Style)

REM More SQL*Plus comments, commands, ...

exec wibble.setGlobal(42);

This way also we can find the program unit line from an error report more easily without having to ignore the preceding REM lines manually.

Just a couple of thoughts ...

Thanks,
Tim
 
Thx, Tim! I had considered this option, but I hope the tool to help me get around my errors, not the opposite. ;)
 
Back
Top