antonnyman / vscode-go-sql-highlight

A syntax highlighter for inline SQL in Go
2 stars 0 forks source link

Plugin broken #1

Open Skeeve opened 1 week ago

Skeeve commented 1 week ago

When I save my program containing:

        rows, err = tx.Query(ctx, /* sql */ `
            UPDATE clientips AS ips
            SET test_start = CASE -- keep test date, when the previous failed

the linter converts it to

        rows, err = tx.Query(ctx /* sql */, `
            UPDATE clientips AS ips
            SET test_start = CASE -- keep test date, when the previous failed

and so the highlighting is gone.

Skeeve commented 1 week ago

This should fix it:

https://github.com/antonnyman/vscode-go-sql-highlight/blob/92f829bf4c8d14b44e6a27249e907e905eb60cd9/syntaxes/go-sql-highlight.json#L7

"begin": "\\s*+(/\\* [sS][qQ][lL] \\*/)\\s*,?\\s*(`)",
Skeeve commented 1 week ago

P.S. Changing my code to

        rows, err = tx.Query(ctx,
            /* sql */ `
            UPDATE clientips AS ips
            SET test_start = CASE -- keep test date, when the previous failed

Also worked… I think it's a matter of personal taste.