Skip to Main Content

SQL Developer for VS Code

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Bug: Syntax Error When Using Non-PL/SQL Code in Irrelevant Branch of a Selection Directive

Philipp SalvisbergDec 14 2024 — edited Dec 14 2024

The next procedure compiles without errors in Oracle Database 23ai but produces a syntax error in the VS Code extension 24.3.1.

create or replace procedure p is
begin
   $if false $then
      This branch can contain arbitrary text.
      See https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/plsql-language-fundamentals.html#LNPLS-GUID-78F2074C-C799-4CF9-9290-EB8473D0C8FB.
      It must not be evaluated by the PL/SQL compiler.
      The PL/SQL compiler ignores this block, but the parser in VS Code tries to parse it and reports a syntax error.
      There are also frameworks in the wild that use this feature to store metadata in the source code.
   $end
   null;
end;
/
show errors

Here's the screenshot showing the complete error message:

Comments
Post Details
Added on Dec 14 2024
10 comments
266 views