malloydata / malloy-vscode-extension

The Malloy Visual Studio Code extension facilitates building Malloy data models, querying and transforming data, and creating simple visualizations and dashboards
http://www.malloydata.dev
MIT License
13 stars 12 forks source link

SQL code highlighting is broken #451

Open mtoy-googly-moogly opened 6 months ago

mtoy-googly-moogly commented 6 months ago

Once upon a time, I think, we highlighted SQL Inside of Malloy properly. Something like:

source: MOCK_DATES is duckdb.sql(
"""SELECT
  ts::DATE as MOCK_DATE_COLUMN
  FROM generate_series(
    TIMESTAMP '2000-01-01',
    TIMESTAMP '2030-01-01',
    INTERVAL '1' DAY) AS t(ts)
""")

There are two problems.

1) Someone (I suspect me) broke this. 2) There was no test to stop me from breaking this.

whscullin commented 6 months ago

It's a little finicky -

source: MOCK_DATES is duckdb.sql("""
SELECT
  ts::DATE as MOCK_DATE_COLUMN
  FROM generate_series(
    TIMESTAMP '2000-01-01',
    TIMESTAMP '2030-01-01',
    INTERVAL '1' DAY) AS t(ts)
""")

works. So we're just missing a like \s* somewhere