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

Files with `.malloysql` extension do not allow tagged sections #461

Open asitemade4u opened 5 months ago

asitemade4u commented 5 months ago

What happens?

I want to save the result of a Malloy view into a Postgres 13/Postgis database. As per the documentation:

  1. I created a .malloysql document
  2. I began the document with >>>malloy to define a Malloy code block
  3. I also defined below a >>>sql code block.

However, Malloy immediately complains about the first block opener:

mismatched input '>' expecting {<EOF>, AGGREGATE, CALCULATE, DIMENSION, GROUP_BY, JOIN_CROSS, JOIN_ONE, JOIN_MANY, MEASURE, NEST, PROJECT, QUERY, RUN, SELECT, SOURCE, VIEW, ALL, AVG, CAST, COUNT, DAY, EXCLUDE, FALSE, HOUR, IMPORT, IS, MAX, MIN, MINUTE, MONTH, NOT, NOW, NULL, PICK, QUARTER, SECOND, SOURCE_KW, SUM, TABLE, TRUE, WEEK, YEAR, HACKY_REGEX, SQ_STRING, DQ_STRING, BQ_STRING, DOC_ANNOTATION, ANNOTATION, '(', '{', '-', ';', LITERAL_TIMESTAMP, LITERAL_HOUR, LITERAL_DAY, LITERAL_QUARTER, LITERAL_MONTH, LITERAL_WEEK, LITERAL_YEAR, IDENTIFIER, NUMERIC_LITERAL, INTEGER_LITERAL, '"""'}
  | >>>malloy

What am I doing wrong? S.

To Reproduce

  1. In VS Code, create a tst.malloysql document
  2. Open a Malloy code block by >>>malloy
  3. Immediately, Malloy throws an error.

OS:

Ubuntu 20.04

Malloy Client:

self-hosted CodeServer bare metal on Ubuntu 20.04

Malloy Client Version:

VS Code Extension v0.3.1714196298 (pre-release)

Database Connection:

Postgres 13