Skip to content

Procedures with triple quote literal description do not have correct syntax highlighting #88

Description

@quackemi-inmar

If you use the triple double quote literal description syntax to have multiple lines in the description, it causes the highlighting in the rest of the procedure to go a bit wonky.

Using this test procedure:

CREATE OR REPLACE PROCEDURE mqh_test.my_procedure_name()
OPTIONS (
    description = """
        This is the first line of the procedure description.
        This is the second line.
        New lines and indentation are preserved in the metadata.
    """
)
BEGIN
    DECLARE my_variable STRING;

    SET my_variable = 'Hello, World!';
    -- Procedure body goes here
    CREATE OR REPLACE TEMP TABLE my_temp_table 
    AS
    SELECT 
        ARRAY_AGG(name) AS names,
        SAFE_CAST(id AS INTEGER) IS NULL
    FROM
        mqh_test.retailer;
END;

You get the following colors:

Image

If I remove the description like this:

CREATE OR REPLACE PROCEDURE mqh_test.my_procedure_name()
BEGIN
    DECLARE my_variable STRING;

    SET my_variable = 'Hello, World!';
    -- Procedure body goes here
    CREATE OR REPLACE TEMP TABLE my_temp_table 
    AS
    SELECT 
        ARRAY_AGG(name) AS names,
        SAFE_CAST(id AS INTEGER) IS NULL
    FROM
        mqh_test.retailer;
END;

then the highlighting corrects itself:

Image

This happens with the several VS Code color themes, but the one shown is Visual Studio Dark.

Yours is the only SQL extension I have installed.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions