diff --git a/.eslintrc.json b/.eslintrc.json index 513b251a7..0dbac2149 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -13,7 +13,7 @@ "plugins": ["@malloydata/lint"], "rules": { "no-console": "warn", - "prettier/prettier": ["error", {"quoteProps": "preserve"}], + "prettier/prettier": ["off", {"quoteProps": "preserve"}], "sort-keys": "off", "no-duplicate-imports": "error", "no-restricted-imports": [ diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..92efc87d8 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +build/ +packages/malloy-malloy-sql/src/grammar +packages/malloy-syntax-highlight/**/*.monarch.ts \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 37c8f1f36..3afcee99c 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -10,7 +10,7 @@ "problemMatcher": ["$tsc-watch"], "group": "build", "label": "tsc-compile-watch", - "runOptions": { "runOn": "folderOpen" }, + "runOptions": {"runOn": "folderOpen"}, "presentation": { "reveal": "silent", "revealProblems": "onProblem", diff --git a/CHANGELOG.md b/CHANGELOG.md index 916dade6f..c46c0ff56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Change Log -_Breaking changes indicated with *_ + +_Breaking changes indicated with \*_ We will use this space to highlight major and/or breaking changes to Malloy. @@ -7,11 +8,10 @@ We will use this space to highlight major and/or breaking changes to Malloy. ### VS Code helper view windows relocated -To improve discoverability and reduce extra clicking around in VS Code, we've relocated the Help, Connections, and Schema View Windows into the Explorer View. They will only appear when a `.malloy` file is opened. +To improve discoverability and reduce extra clicking around in VS Code, we've relocated the Help, Connections, and Schema View Windows into the Explorer View. They will only appear when a `.malloy` file is opened. - ## v0.0.10 ### The apply operator is now ? and not : @@ -43,6 +43,7 @@ sourceName { where: fieldName ? value1|value2 } Prior to v0.0.9, lists of things were contained inside `[ ]`. Going forward, the brackets have been removed. Our hope is that this will be one less piece of punctuation to track, and will make it easier to change from a single item in a list to multiple without adding in brackets. For example, this syntax: + ```malloy query: table('malloy-data.faa.airports') -> { top: 10 @@ -64,6 +65,7 @@ query: table('malloy-data.faa.airports') -> { ``` Is now written: + ```malloy query: table('malloy-data.faa.airports') -> { top: 10 diff --git a/README.md b/README.md index 008ae63ad..be85566f3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Malloy + Malloy is an experimental language for describing data relationships and transformations. It is both a semantic modeling language and a querying language that runs queries against a relational database. Malloy currently supports BigQuery and Postgres, as well as querying Parquet and CSV files via DuckDB. ### [Click here](https://github.dev/malloydata/try-malloy/airports.malloy) to try Malloy in your browser! @@ -9,16 +10,16 @@ Malloy is an experimental language for describing data relationships and transfo The easiest way to try Malloy is with our VS Code Extension, which provides a place to create Malloy models, execute queries, get help, and more. VS Code is a text editor and IDE (integrated development environment) that runs on your desktop or in your browser. A few ways to install the extension: -* [I already have VS Code](https://malloydata.github.io/documentation/setup/extension.html#using-the-malloy-extension-on-your-desktop) -* [I use BigQuery and Google Cloud](https://malloydata.github.io/documentation/setup/extension.html#using-the-malloy-extension-on-google-cloud-shell-editor). -* [I have a Github account and want to try Malloy on a `.csv` or `.parquet` file in a repository](https://malloydata.github.io/documentation/setup/extension.html#using-the-malloy-extension-on-github-dev). +- [I already have VS Code](https://malloydata.github.io/documentation/setup/extension.html#using-the-malloy-extension-on-your-desktop) +- [I use BigQuery and Google Cloud](https://malloydata.github.io/documentation/setup/extension.html#using-the-malloy-extension-on-google-cloud-shell-editor). +- [I have a Github account and want to try Malloy on a `.csv` or `.parquet` file in a repository](https://malloydata.github.io/documentation/setup/extension.html#using-the-malloy-extension-on-github-dev). ![show_run](https://user-images.githubusercontent.com/1093458/182458787-ca228186-c954-4a07-b298-f92dbf91e48d.gif) To get to know the Malloy language, follow [our Quickstart](https://malloydata.github.io/documentation/user_guides/basic.html). Note: The Malloy VSCode Extension tracks a small amount of anonymous usage data. You can opt out in the extension settings. - [Learn more](https://policies.google.com/technologies/cookies). +[Learn more](https://policies.google.com/technologies/cookies). ## Join the Community @@ -44,6 +45,7 @@ To report security issues please see our [security policy](https://github.com/ma Malloy is not an officially supported Google product. ## Syntax Example + Here is a simple example of a Malloy query: ```malloy @@ -57,6 +59,7 @@ run: bigquery.table('malloy-data.faa.flights') -> { ``` In SQL this would be expressed: + ```sql SELECT carrier, diff --git a/cloudbuild/build-test/test.sh b/cloudbuild/build-test/test.sh index dba38d9cd..10ab3b40b 100755 --- a/cloudbuild/build-test/test.sh +++ b/cloudbuild/build-test/test.sh @@ -4,6 +4,6 @@ set -euxo pipefail nix-shell --quiet --pure --keep PGHOST --keep PGDATABASE --keep PGUSER --command "$(cat < /dev/null & sleep 2) && (./cloudbuild/deploy/$TRIGGER_NAME.sh)" - timeout: "1800s" - secretEnv: ["NPM_TOKEN", "GITHUB_SSH_KEY"] + - '(/workspace/cloud_sql_proxy -enable_iam_login -instances=malloy-303216:us-central1:pg-test=tcp:5432 -log_debug_stdout > /dev/null & sleep 2) && (./cloudbuild/deploy/$TRIGGER_NAME.sh)' + timeout: '1800s' + secretEnv: ['NPM_TOKEN', 'GITHUB_SSH_KEY'] env: - - "BRANCH_NAME=$BRANCH_NAME" + - 'BRANCH_NAME=$BRANCH_NAME' volumes: - - name: "ssh" + - name: 'ssh' path: /root/.ssh - waitFor: ["git-ssh-key", "proxy-install"] + waitFor: ['git-ssh-key', 'proxy-install'] options: logging: CLOUD_LOGGING_ONLY - machineType: "E2_HIGHCPU_32" -timeout: "1800s" + machineType: 'E2_HIGHCPU_32' +timeout: '1800s' availableSecrets: secretManager: - versionName: projects/malloy-303216/secrets/npm-publish/versions/latest - env: "NPM_TOKEN" + env: 'NPM_TOKEN' - versionName: projects/malloy-303216/secrets/github-ssh-key/versions/latest - env: "GITHUB_SSH_KEY" + env: 'GITHUB_SSH_KEY' diff --git a/developing.md b/developing.md index a9463394c..8cc4cbf5a 100644 --- a/developing.md +++ b/developing.md @@ -11,7 +11,13 @@ npm install npm run build ``` -Use the [VS Code ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) for code formatting, or run `npm run lint --fix`. +Use the [VS Code ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) for highlighting linter errors, or run `npm run lint --fix`. + +Use the [VS Code Prettier extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) for code formatting, or run `npm run prettier-fix`. +To auto-format files on save: + +1. Go to Settings > Workspace, search for "format on save", and turn "Editor: Format on Save" to on +2. Go to Settings > Workspace, search for "formatter", and set "Editor: Default formatter" to Prettier - Code formatter" The tests can be run via the [VS Code Jest Runner extension](https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner). Alternatively, use `npm run test`, or a specific file, like `npm run test test/nomodel.spec.ts`. diff --git a/package.json b/package.json index 45684901e..e12f011c8 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,8 @@ "lint-build": "npm run build -w packages/malloy -w packages/malloy-lint", "lint": "npm run lint-build && gts lint", "lint-fix": "npm run lint-build && gts fix", + "prettier-fix": "prettier . --write", + "prettier-check": "prettier . --check", "test": "jest --runInBand", "test-bigquery": "MALLOY_DATABASE=bigquery jest --runInBand", "test-postgres": "MALLOY_DATABASE=postgres jest --runInBand", diff --git a/packages/malloy-interfaces/README.md b/packages/malloy-interfaces/README.md index 2cacae0fb..5f9171b75 100644 --- a/packages/malloy-interfaces/README.md +++ b/packages/malloy-interfaces/README.md @@ -1,3 +1,3 @@ # Malloy Interfaces -This package contains most of the main definitions of the interfaces that are relevant for packages that implement Malloy Connections. \ No newline at end of file +This package contains most of the main definitions of the interfaces that are relevant for packages that implement Malloy Connections. diff --git a/packages/malloy-syntax-highlight/.github/README.md b/packages/malloy-syntax-highlight/.github/README.md index 8a97c43d0..e267789ef 100644 --- a/packages/malloy-syntax-highlight/.github/README.md +++ b/packages/malloy-syntax-highlight/.github/README.md @@ -6,4 +6,4 @@ Currently, two other dialects of Malloy are supported in addition to the standar Thus, this package can be pulled into only the Malloy repos that need it and includes a test runner to verify the semantic and visual accuracy of syntax highlighting provided by our TextMate grammars. Additionally, the need to maintain a Monarch grammar for Malloy has necessitated the inclusion of both a script to generate Monarch grammars from ground truth TextMate grammars as well as infrastructure to test all Monarch grammars for parity with their TextMate counterparts. -Please refer to `DEVELOPING.md` for more information on using the tools introduced in this package. \ No newline at end of file +Please refer to `DEVELOPING.md` for more information on using the tools introduced in this package. diff --git a/packages/malloy-syntax-highlight/README.md b/packages/malloy-syntax-highlight/README.md index d1d4f7772..f7020ec2f 100644 --- a/packages/malloy-syntax-highlight/README.md +++ b/packages/malloy-syntax-highlight/README.md @@ -4,4 +4,4 @@ Malloy is an experimental language for describing data relationships and transfo Currently, two other dialects of Malloy are supported in addition to the standard syntax used in `.malloy` files: the Malloy notebook format (`.malloynb`) and Malloy SQL (`.malloysql`). The purpose of this `npm` package is to mitigate syncing issues across `@malloydata` repositories that depend upon syntax highlight files and to make these assets more easily available for future integrations. -This `npm` package does not include the source files used to develop these syntax highlighting files. If you are interested in using the existing infrastructure to modify, test, or generate these grammar files, please refer to the [malloy monorepo](https://github.com/malloydata/malloy/tree/main/packages/malloy-syntax-highlight) and see `DEVELOPING.md` for steps to do so. \ No newline at end of file +This `npm` package does not include the source files used to develop these syntax highlighting files. If you are interested in using the existing infrastructure to modify, test, or generate these grammar files, please refer to the [malloy monorepo](https://github.com/malloydata/malloy/tree/main/packages/malloy-syntax-highlight) and see `DEVELOPING.md` for steps to do so. diff --git a/packages/malloy-syntax-highlight/grammars/malloy-notebook/malloy-notebook.tmGrammar.json b/packages/malloy-syntax-highlight/grammars/malloy-notebook/malloy-notebook.tmGrammar.json index 6d49623fe..f2d42cae0 100644 --- a/packages/malloy-syntax-highlight/grammars/malloy-notebook/malloy-notebook.tmGrammar.json +++ b/packages/malloy-syntax-highlight/grammars/malloy-notebook/malloy-notebook.tmGrammar.json @@ -2,30 +2,30 @@ "name": "Malloy Notebook", "scopeName": "source.malloy-notebook", "patterns": [ - { "include": "#comments" }, - { "include": "#malloysql-malloy" }, - { "include": "#malloysql-sql" } + {"include": "#comments"}, + {"include": "#malloysql-malloy"}, + {"include": "#malloysql-sql"} ], "repository": { "malloysql-malloy": { "begin": ">>>malloy", "end": "(?=>>>)", "beginCaptures": { - "0": { "name": "entity.other.attribute.malloy-sql" } + "0": {"name": "entity.other.attribute.malloy-sql"} }, "name": "meta.embedded.block.malloysql.malloy", - "patterns": [{ "include": "source.malloy" }] + "patterns": [{"include": "source.malloy"}] }, "malloysql-sql": { "begin": "(>>>sql)(\\s*connection:.*?(?>>)", "beginCaptures": { - "0": { "name": "entity.other.attribute.malloy-sql" }, - "1": { "name": "entity.other.attribute.malloy-sql" }, - "3": { "name": "comment.line.double-slash" } + "0": {"name": "entity.other.attribute.malloy-sql"}, + "1": {"name": "entity.other.attribute.malloy-sql"}, + "3": {"name": "comment.line.double-slash"} }, "name": "meta.embedded.block.malloysql.sql", - "patterns": [{ "include": "source.malloy-sql" }] + "patterns": [{"include": "source.malloy-sql"}] } } } diff --git a/packages/malloy-syntax-highlight/grammars/malloy-sql/malloy-sql.tmGrammar.json b/packages/malloy-syntax-highlight/grammars/malloy-sql/malloy-sql.tmGrammar.json index 48c6100c2..bce9e9e23 100644 --- a/packages/malloy-syntax-highlight/grammars/malloy-sql/malloy-sql.tmGrammar.json +++ b/packages/malloy-syntax-highlight/grammars/malloy-sql/malloy-sql.tmGrammar.json @@ -1,28 +1,28 @@ { "name": "Malloy SQL", "scopeName": "source.malloy-sql", - "patterns": [{ "include": "#malloysql-sql" }], + "patterns": [{"include": "#malloysql-sql"}], "repository": { "malloysql-sql": { "beginCaptures": { - "0": { "name": "entity.other.attribute.malloy-sql" }, - "1": { "name": "entity.other.attribute.malloy-sql" }, - "3": { "name": "comment.line.double-slash" } + "0": {"name": "entity.other.attribute.malloy-sql"}, + "1": {"name": "entity.other.attribute.malloy-sql"}, + "3": {"name": "comment.line.double-slash"} }, "name": "meta.embedded.block.malloysql.sql", "patterns": [ - { "include": "#comments" }, + {"include": "#comments"}, { "begin": "%{", "end": "}%", "beginCaptures": { - "0": { "name": "punctuation.definition.malloy-sql" } + "0": {"name": "punctuation.definition.malloy-sql"} }, "endCaptures": { - "0": { "name": "punctuation.definition.malloy-sql" } + "0": {"name": "punctuation.definition.malloy-sql"} }, "name": "meta.embedded.block.malloy", - "patterns": [{ "include": "source.malloy" }] + "patterns": [{"include": "source.malloy"}] }, { "include": "source.sql" @@ -35,10 +35,10 @@ "begin": "/\\*", "end": "\\*/", "beginCaptures": { - "0": { "name": "punctuation.definition.comment.begin" } + "0": {"name": "punctuation.definition.comment.begin"} }, "endCaptures": { - "0": { "name": "punctuation.definition.comment.end" } + "0": {"name": "punctuation.definition.comment.end"} }, "name": "comment.block" }, @@ -46,7 +46,7 @@ "begin": "//", "end": "\\n", "beginCaptures": { - "0": { "name": "punctuation.definition.comment" } + "0": {"name": "punctuation.definition.comment"} }, "name": "comment.line.double-slash" }, @@ -54,7 +54,7 @@ "begin": "--", "end": "\\n", "beginCaptures": { - "0": { "name": "punctuation.definition.comment" } + "0": {"name": "punctuation.definition.comment"} }, "name": "comment.line.double-hyphen" } diff --git a/packages/malloy-syntax-highlight/grammars/malloy/malloy.tmGrammar.json b/packages/malloy-syntax-highlight/grammars/malloy/malloy.tmGrammar.json index c94875fb3..5d9318bbb 100644 --- a/packages/malloy-syntax-highlight/grammars/malloy/malloy.tmGrammar.json +++ b/packages/malloy-syntax-highlight/grammars/malloy/malloy.tmGrammar.json @@ -1,31 +1,31 @@ { "scopeName": "source.malloy", - "patterns": [{ "include": "#malloy-language" }], + "patterns": [{"include": "#malloy-language"}], "repository": { "malloy-language": { "patterns": [ - { "include": "#sql-string" }, - { "include": "#comments" }, - { "include": "#tags" }, - { "include": "#strings" }, - { "include": "#numbers" }, - { "include": "#keywords" }, - { "include": "#properties" }, - { "include": "#functions" }, - { "include": "#datetimes" }, - { "include": "#identifiers-quoted" }, - { "include": "#types" }, - { "include": "#constants" }, - { "include": "#timeframes" }, - { "include": "#identifiers-unquoted" } + {"include": "#sql-string"}, + {"include": "#comments"}, + {"include": "#tags"}, + {"include": "#strings"}, + {"include": "#numbers"}, + {"include": "#keywords"}, + {"include": "#properties"}, + {"include": "#functions"}, + {"include": "#datetimes"}, + {"include": "#identifiers-quoted"}, + {"include": "#types"}, + {"include": "#constants"}, + {"include": "#timeframes"}, + {"include": "#identifiers-unquoted"} ] }, "malloy-matched": { "begin": "{", "end": "}", "patterns": [ - { "include": "#malloy-matched" }, - { "include": "#malloy-language" } + {"include": "#malloy-matched"}, + {"include": "#malloy-language"} ] }, "malloy-in-sql": { @@ -33,8 +33,8 @@ "name": "source.malloy-in-sql", "end": "}%?", "patterns": [ - { "include": "#malloy-matched" }, - { "include": "#malloy-language" } + {"include": "#malloy-matched"}, + {"include": "#malloy-language"} ] }, "sql-string": { @@ -43,34 +43,28 @@ "begin": "\\b(select)(\\s*:\\s*)(\"\"\")", "end": "\"\"\"", "beginCaptures": { - "1": { "name": "keyword.control.select" }, - "3": { "name": "punctuation.sql-block.open" } + "1": {"name": "keyword.control.select"}, + "3": {"name": "punctuation.sql-block.open"} }, "endCaptures": { - "0": { "name": "punctuation.sql-block.close" } + "0": {"name": "punctuation.sql-block.close"} }, "name": "source.sql", - "patterns": [ - { "include": "#malloy-in-sql" }, - { "include": "source.sql" } - ] + "patterns": [{"include": "#malloy-in-sql"}, {"include": "source.sql"}] }, { "begin": "(\\b[A-Za-z_][A-Za-z_0-9]*)(\\s*\\.\\s*)(sql)(\\s*\\(\\s*)(\"\"\")", "end": "\"\"\"", "beginCaptures": { - "1": { "name": "variable.other" }, - "3": { "name": "keyword.control.sql" }, - "5": { "name": "punctuation.sql-block.open" } + "1": {"name": "variable.other"}, + "3": {"name": "keyword.control.sql"}, + "5": {"name": "punctuation.sql-block.open"} }, "endCaptures": { - "0": { "name": "punctuation.sql-block.close" } + "0": {"name": "punctuation.sql-block.close"} }, "name": "source.sql", - "patterns": [ - { "include": "#malloy-in-sql" }, - { "include": "source.sql" } - ] + "patterns": [{"include": "#malloy-in-sql"}, {"include": "source.sql"}] } ] }, @@ -79,27 +73,27 @@ { "match": "(?i)\\b(count)(\\s*\\()(distinct)", "captures": { - "1": { "name": "entity.name.function" }, - "3": { "name": "entity.name.function.modifier" } + "1": {"name": "entity.name.function"}, + "3": {"name": "entity.name.function.modifier"} } }, { "match": "(?i)\\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|TABLE|FROM|FROM_SQL|UNGROUPED)(\\s*\\()", "captures": { - "1": { "name": "entity.name.function" } + "1": {"name": "entity.name.function"} } }, { "match": "(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(\\s*\\()", "captures": { - "1": { "name": "entity.name.function" } + "1": {"name": "entity.name.function"} } }, { "match": "(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(!)(timestamp|number|string|boolean|date)?(\\s*\\()", "captures": { - "1": { "name": "entity.name.function" }, - "3": { "name": "entity.name.type" } + "1": {"name": "entity.name.function"}, + "3": {"name": "entity.name.type"} } } ] @@ -150,10 +144,10 @@ "begin": "/\\*", "end": "\\*/", "beginCaptures": { - "0": { "name": "punctuation.definition.comment.begin" } + "0": {"name": "punctuation.definition.comment.begin"} }, "endCaptures": { - "0": { "name": "punctuation.definition.comment.end" } + "0": {"name": "punctuation.definition.comment.end"} }, "name": "comment.block" }, @@ -161,7 +155,7 @@ "begin": "//", "end": "\\n", "beginCaptures": { - "0": { "name": "punctuation.definition.comment" } + "0": {"name": "punctuation.definition.comment"} }, "name": "comment.line.double-slash" }, @@ -169,7 +163,7 @@ "begin": "--", "end": "\\n", "beginCaptures": { - "0": { "name": "punctuation.definition.comment" } + "0": {"name": "punctuation.definition.comment"} }, "name": "comment.line.double-hyphen" } @@ -181,14 +175,14 @@ "match": "##\\n", "name": "string.quoted", "captures": { - "0": { "name": "string.quoted" } + "0": {"name": "string.quoted"} } }, { "begin": "#\"", "end": "\\n", "beginCaptures": { - "0": { "name": "punctuation.definition.comment" } + "0": {"name": "punctuation.definition.comment"} }, "name": "comment.line.double-slash" }, @@ -196,32 +190,32 @@ "match": "#\\n", "name": "string.quoted", "captures": { - "0": { "name": "string.quoted" } + "0": {"name": "string.quoted"} } }, { "begin": "#\\s", "end": "\\n", "beginCaptures": { - "0": { "name": "support.type.property-name.json" } + "0": {"name": "support.type.property-name.json"} }, "name": "comment.line.double-slash", - "patterns": [{ "include": "#tag-values" }] + "patterns": [{"include": "#tag-values"}] }, { "begin": "##\\s", "end": "\\n", "beginCaptures": { - "0": { "name": "support.type.property-name.json" } + "0": {"name": "support.type.property-name.json"} }, "name": "comment.line.double-slash", - "patterns": [{ "include": "#tag-values" }] + "patterns": [{"include": "#tag-values"}] }, { "begin": "#", "end": "\\n", "beginCaptures": { - "0": { "name": "string.quoted" } + "0": {"name": "string.quoted"} }, "name": "string.quoted" } @@ -231,10 +225,10 @@ "name": "support.type.property-name.json", "match": "(-)?((?:[^\\s=#]+)|(?:\"[^#]+\"))(?:\\s*(=)\\s*((?:[^\\s=#]+)|(?:\"[^#]+\")))?", "captures": { - "1": { "name": "keyword.control.negate" }, - "2": { "name": "support.type.property-name.json" }, - "3": { "name": "keyword.operator.comparison.ts" }, - "4": { "name": "string.quoted" } + "1": {"name": "keyword.control.negate"}, + "2": {"name": "support.type.property-name.json"}, + "3": {"name": "keyword.operator.comparison.ts"}, + "4": {"name": "string.quoted"} } } } @@ -245,34 +239,34 @@ "begin": "'", "end": "'", "beginCaptures": { - "0": { "name": "punctuation.definition.string.begin" } + "0": {"name": "punctuation.definition.string.begin"} }, "endCaptures": { - "0": { "name": "punctuation.definition.string.end" } + "0": {"name": "punctuation.definition.string.end"} }, "name": "string.quoted.single", - "patterns": [{ "include": "#escapes" }] + "patterns": [{"include": "#escapes"}] }, { "begin": "\"", "end": "\"", "beginCaptures": { - "0": { "name": "punctuation.definition.string.begin" } + "0": {"name": "punctuation.definition.string.begin"} }, "endCaptures": { - "0": { "name": "punctuation.definition.string.end" } + "0": {"name": "punctuation.definition.string.end"} }, "name": "string.quoted.double", - "patterns": [{ "include": "#escapes" }] + "patterns": [{"include": "#escapes"}] }, { "begin": "\"\"\"", "end": "\"\"\"", "beginCaptures": { - "0": { "name": "punctuation.definition.string.begin" } + "0": {"name": "punctuation.definition.string.begin"} }, "endCaptures": { - "0": { "name": "punctuation.definition.string.end" } + "0": {"name": "punctuation.definition.string.end"} }, "name": "string.quoted.triple" }, @@ -280,7 +274,7 @@ "begin": "(?i)[r|/]'", "end": "'", "name": "string.regexp", - "patterns": [{ "include": "#regex-escapes" }] + "patterns": [{"include": "#regex-escapes"}] } ], "repository": { @@ -288,14 +282,14 @@ "name": "constant.character.escape", "match": "\\\\(u[A-Fa-f0-9]{4}|.)", "captures": { - "0": { "name": "constant.character.escape" } + "0": {"name": "constant.character.escape"} } }, "regex-escapes": { "name": "constant.character.escape", "match": "\\\\.", "captures": { - "0": { "name": "constant.character.escape" } + "0": {"name": "constant.character.escape"} } } } diff --git a/packages/malloy-syntax-highlight/test/visual/index.html b/packages/malloy-syntax-highlight/test/visual/index.html index a04071264..487735978 100644 --- a/packages/malloy-syntax-highlight/test/visual/index.html +++ b/packages/malloy-syntax-highlight/test/visual/index.html @@ -37,40 +37,43 @@ - + + source: flights is duckdb.table('flights.parquet') extend { dimension: foo is 1 } - + + -