@arcgis/coding-components 4.31.0-next.6 → 4.31.0-next.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -3
- package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ar.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.bg.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.bs.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ca.json +6 -6
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.cs.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.da.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.de.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.el.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.es.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.et.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.fi.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.fr.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.he.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.hr.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.id.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.it.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ko.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.nb.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.nl.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pl.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pt-BR.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pt-PT.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ru.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sk.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sl.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sr.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sv.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.th.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.tr.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.uk.json +5 -5
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.vi.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-CN.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-HK.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-TW.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.ca.json +2 -2
- package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.de.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.he.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-variables/t9n/arcade-variables.t9n.ca.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-variables/t9n/arcade-variables.t9n.it.json +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/arcade.worker.js +3 -3
- package/dist/arcgis-coding-components/assets/code-editor/sql-expr.worker.js +460 -7
- package/dist/arcgis-coding-components/assets/language-api-panel/t9n/language-api-panel.t9n.ca.json +1 -1
- package/dist/arcgis-coding-components/assets/sql-expression-editor/api/sql-expression-api.t9n.en.json +30 -30
- package/dist/arcgis-coding-components/assets/sql-expression-editor/t9n/sql-expression-editor.t9n.en.json +4 -0
- package/dist/arcgis-coding-components/assets/sql-expression-fields/t9n/sql-expression-fields.t9n.en.json +4 -0
- package/dist/arcgis-coding-components/index.esm.js +2 -2
- package/dist/arcgis-coding-components/p-0dfb0b51.js +6 -0
- package/dist/arcgis-coding-components/p-15ab1669.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-41c932b5.js → p-2ce01944.js} +3 -3
- package/dist/arcgis-coding-components/p-324d3441.js +6 -0
- package/dist/arcgis-coding-components/{p-022df536.js → p-32f69143.js} +1 -1
- package/dist/arcgis-coding-components/p-48a82879.js +7 -0
- package/dist/arcgis-coding-components/p-49d247b3.js +68 -0
- package/dist/arcgis-coding-components/p-4aacb744.js +6 -0
- package/dist/arcgis-coding-components/p-65666d7d.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-19b4f0e9.js → p-b67f1c54.js} +2 -2
- package/dist/arcgis-coding-components/{p-14ab3ed5.js → p-bd510fac.js} +1 -1
- package/dist/arcgis-coding-components/{p-10cab8d9.js → p-c02b5cb7.js} +2 -2
- package/dist/arcgis-coding-components/{p-e11999af.js → p-c79a1a66.js} +2 -2
- package/dist/arcgis-coding-components/{p-38534c31.js → p-d339d7c5.js} +3 -3
- package/dist/arcgis-coding-components/p-d39b4fa7.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-8c6a6176.js → p-d3e821fe.js} +3 -3
- package/dist/arcgis-coding-components/p-ee4ad3e1.js +6 -0
- package/dist/arcgis-coding-components/{p-2a7ef2fd.js → p-f8728f4d.js} +2 -2
- package/dist/cjs/{app-globals-8991f48d.js → app-globals-2c78c6b1.js} +1 -1
- package/dist/cjs/arcade-defaults-8f210819.js +350 -0
- package/dist/cjs/{arcade-mode-ee5f5a57.js → arcade-mode-ba7da99f.js} +18 -5
- package/dist/cjs/arcgis-arcade-editor_6.cjs.entry.js +59 -103
- package/dist/cjs/arcgis-coding-components.cjs.js +5 -5
- package/dist/cjs/arcgis-sql-expression-editor.cjs.entry.js +32 -11
- package/dist/cjs/arcgis-sql-expression-fields.cjs.entry.js +16 -10
- package/dist/cjs/{css-c0ad88d7.js → css-7588aae5.js} +1 -1
- package/dist/cjs/{cssMode-deeb6f90.js → cssMode-0be00954.js} +2 -3
- package/dist/cjs/{html-be08d94a.js → html-310c2662.js} +2 -3
- package/dist/cjs/{htmlMode-f5b8239a.js → htmlMode-30d8e99b.js} +2 -3
- package/dist/cjs/{index-358de60d.js → index-cba76501.js} +203 -156
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/{javascript-37d3d13f.js → javascript-2094999f.js} +3 -4
- package/dist/cjs/{jsonMode-12a2a091.js → jsonMode-389bdf05.js} +2 -3
- package/dist/cjs/{language-defaults-base-1f082ad7.js → language-defaults-base-7cb3bee2.js} +812 -1036
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/{sql-expr-defaults-dca57c68.js → sql-expr-defaults-50a75e9d.js} +226 -75
- package/dist/cjs/sql-expr-mode-0b3d7972.js +480 -0
- package/dist/cjs/{tsMode-d33a7021.js → tsMode-1ef47d68.js} +2 -3
- package/dist/cjs/{typescript-f3be2ce7.js → typescript-e19c8c21.js} +2 -3
- package/dist/components/arcade-defaults.js +239 -4
- package/dist/components/arcade-mode.js +18 -4
- package/dist/components/arcade-results.js +3 -3
- package/dist/components/arcade-suggestions.js +2 -2
- package/dist/components/arcade-variables.js +2 -2
- package/dist/components/arcgis-arcade-editor.js +21 -13
- package/dist/components/arcgis-arcade-results.js +1 -1
- package/dist/components/arcgis-arcade-suggestions.js +1 -1
- package/dist/components/arcgis-arcade-variables.js +1 -1
- package/dist/components/arcgis-assets.d.ts +26 -26
- package/dist/components/arcgis-assets.js +2 -2
- package/dist/components/arcgis-code-editor.js +1 -1
- package/dist/components/arcgis-language-api-panel.js +1 -1
- package/dist/components/arcgis-sql-expression-editor.js +33 -11
- package/dist/components/arcgis-sql-expression-fields.js +1 -1
- package/dist/components/{chunk-3IUJHIAA.js → chunk-WEX2VUZV.js} +87 -92
- package/dist/components/code-editor.js +17 -23
- package/dist/components/fields.js +4 -4
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +4 -4
- package/dist/components/language-api-panel.js +22 -4
- package/dist/components/language-defaults-base.js +61 -287
- package/dist/components/markdown.js +1 -1
- package/dist/components/sql-expr-defaults.js +77 -24
- package/dist/components/sql-expr-mode.js +294 -24950
- package/dist/components/sql-expression-fields.js +15 -8
- package/dist/components/useT9n.js +41 -2
- package/dist/components/utilities.js +1 -1
- package/dist/esm/{app-globals-3e4e0353.js → app-globals-ad05b915.js} +1 -1
- package/dist/esm/arcade-defaults-84c53fa5.js +345 -0
- package/dist/esm/{arcade-mode-4a83348d.js → arcade-mode-6fbd4168.js} +18 -5
- package/dist/esm/arcgis-arcade-editor_6.entry.js +55 -99
- package/dist/esm/arcgis-coding-components.js +6 -6
- package/dist/esm/arcgis-sql-expression-editor.entry.js +32 -11
- package/dist/esm/arcgis-sql-expression-fields.entry.js +16 -10
- package/dist/esm/{css-bad8d1c3.js → css-9731ed75.js} +1 -1
- package/dist/esm/{cssMode-68a5f601.js → cssMode-6a20bb2b.js} +2 -3
- package/dist/esm/{html-9b27df1a.js → html-b32a642f.js} +2 -3
- package/dist/esm/{htmlMode-361ad282.js → htmlMode-e39916d3.js} +2 -3
- package/dist/esm/{index-8a552796.js → index-3c00d77e.js} +203 -156
- package/dist/esm/index.js +4 -4
- package/dist/esm/{javascript-8004e14f.js → javascript-e3306e60.js} +3 -4
- package/dist/esm/{jsonMode-91a0be74.js → jsonMode-2ba190f8.js} +2 -3
- package/dist/esm/{language-defaults-base-df906b3d.js → language-defaults-base-9d97d855.js} +809 -1036
- package/dist/esm/loader.js +5 -5
- package/dist/esm/{sql-expr-defaults-ae0be602.js → sql-expr-defaults-49ca931c.js} +225 -74
- package/dist/esm/sql-expr-mode-b1ab06a1.js +476 -0
- package/dist/esm/{tsMode-2756c213.js → tsMode-6fe69b0a.js} +2 -3
- package/dist/esm/{typescript-1aaf3ddd.js → typescript-d757eb0b.js} +2 -3
- package/dist/loader/cdn.js +2 -3
- package/dist/loader/index.cjs.js +2 -3
- package/dist/loader/index.d.ts +3 -0
- package/dist/loader/index.es2017.js +2 -3
- package/dist/loader/index.js +2 -3
- package/dist/types/components/arcade-editor/arcade-editor.d.ts +16 -5
- package/dist/types/components/code-editor/code-editor.d.ts +14 -4
- package/dist/types/components/language-api-panel/language-api-panel.d.ts +1 -0
- package/dist/types/components/sql-expression-editor/sql-expression-editor.d.ts +31 -3
- package/dist/types/components/sql-expression-fields/sql-expression-fields.d.ts +17 -0
- package/dist/types/components.d.ts +40 -13
- package/dist/types/data/arcgis-web-compoments/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stencil.config.d.ts +3 -0
- package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/arcade-editor/arcade-editor.stories.d.ts +8 -1
- package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/arcade-editor/editorContext.d.ts +5 -1
- package/dist/types/stencil-public-runtime.d.ts +3 -10
- package/dist/types/utils/arcade-monaco/arcade-defaults.d.ts +1 -0
- package/dist/types/utils/arcade-monaco/arcade-language-features.d.ts +1 -0
- package/dist/types/utils/arcade-monaco/arcade-profile-strategy.d.ts +9 -0
- package/dist/types/utils/arcade-monaco/arcade-worker-manager.d.ts +6 -0
- package/dist/types/utils/fields.d.ts +2 -2
- package/dist/types/utils/profile/editor-profile.d.ts +7 -6
- package/dist/types/utils/profile/types.d.ts +28 -0
- package/dist/types/utils/profile/utils.d.ts +5 -1
- package/dist/types/utils/sql-expr-monaco/sql-expr-completion.d.ts +56 -5
- package/dist/types/utils/sql-expr-monaco/sql-expr-constants.d.ts +61 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-contribution.d.ts +1 -11
- package/dist/types/utils/sql-expr-monaco/sql-expr-defaults.d.ts +0 -1
- package/dist/types/utils/sql-expr-monaco/sql-expr-language-features.d.ts +18 -534
- package/dist/types/utils/sql-expr-monaco/sql-expr-mode.d.ts +34 -1
- package/dist/types/utils/sql-expr-monaco/sql-expr-parser-utils.d.ts +30 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-service-accessors.d.ts +19 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-validation-diagnostic-adapter.d.ts +0 -7
- package/dist/types/utils/sql-expr-monaco/sql-expr-validation-utils.d.ts +73 -77
- package/dist/types/utils/sql-expr-monaco/sql-expr-validation.d.ts +5 -6
- package/dist/types/utils/sql-expr-monaco/sql-expr-worker-manager.d.ts +8 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr.worker.d.ts +11 -8
- package/dist/types/utils/sql-expr-monaco/sql-expression-profile-strategy.d.ts +13 -0
- package/dist/types/utils/sql-expr-monaco/types.d.ts +30 -28
- package/package.json +19 -19
- package/dist/arcgis-coding-components/p-1baf3624.entry.js +0 -6
- package/dist/arcgis-coding-components/p-8e61744c.js +0 -68
- package/dist/arcgis-coding-components/p-933de2b5.entry.js +0 -6
- package/dist/arcgis-coding-components/p-9dfc06ea.js +0 -6
- package/dist/arcgis-coding-components/p-a536144e.js +0 -6
- package/dist/arcgis-coding-components/p-cd67026d.js +0 -6
- package/dist/arcgis-coding-components/p-d7e83ea1.entry.js +0 -6
- package/dist/arcgis-coding-components/p-e055c041.js +0 -6
- package/dist/arcgis-coding-components/p-f1fab45e.js +0 -7
- package/dist/cjs/arcade-defaults-2d36c400.js +0 -116
- package/dist/cjs/sql-expr-mode-c644220d.js +0 -25135
- package/dist/esm/arcade-defaults-1adb5004.js +0 -111
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/sql-expr-mode-1821b2b9.js +0 -25132
- package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stencil.config.d.ts +0 -3
- package/dist/types/utils/profile/predefined-profile.d.ts +0 -4
- package/dist/types/utils/sql-expr-monaco/DependentFiles/DateOnly.d.ts +0 -41
- package/dist/types/utils/sql-expr-monaco/DependentFiles/SqlInterval.d.ts +0 -16
- package/dist/types/utils/sql-expr-monaco/DependentFiles/SqlTimestampOffset.d.ts +0 -26
- package/dist/types/utils/sql-expr-monaco/DependentFiles/TimeOnly.d.ts +0 -37
- package/dist/types/utils/sql-expr-monaco/DependentFiles/UnknownTimeZone.d.ts +0 -11
- package/dist/types/utils/sql-expr-monaco/DependentFiles/WhereGrammar.d.ts +0 -122
- package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlCompareUtils.d.ts +0 -5
- package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlDateParsingUtils.d.ts +0 -18
- package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlUtils.d.ts +0 -6
- package/dist/types/utils/sql-expr-monaco/DependentFiles/standardizedFunctions.d.ts +0 -156
- package/dist/types/utils/sql-expr-monaco/DependentFiles/support.d.ts +0 -150
- package/dist/types/utils/sql-expr-monaco/PeggyGrammar/sql92grammar.d.ts +0 -1397
- package/dist/types/utils/sql-expr-monaco/libraries/date/properties/index.d.ts +0 -59
- package/dist/types/utils/sql-expr-monaco/libraries/numeric/properties/index.d.ts +0 -295
- package/dist/types/utils/sql-expr-monaco/libraries/string/properties/index.d.ts +0 -135
- package/dist/types/utils/sql-expr-monaco/sql-expr-validation-adapter.d.ts +0 -3
- package/dist/types/utils/sql-expr-profile/predefined-profile.d.ts +0 -2
- /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/code-editor/code-editor.stories.d.ts +0 -0
- /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/sql-expression-editor/sql-expression-editor.stories.d.ts +0 -0
- /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/reference/stories/arcade-editor.stories.d.ts +0 -0
- /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/support/sass-inline-url-importer.d.ts +0 -0
- /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/support/sass-json-importer.d.ts +0 -0
- /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/support/stencil-monaco-plugins.d.ts +0 -0
|
@@ -77,17 +77,17 @@
|
|
|
77
77
|
"name": "extract",
|
|
78
78
|
"bundle": "date",
|
|
79
79
|
"description": "Returns a single part of a datetime, such as year, month, day, hour, minute, or second.",
|
|
80
|
-
"examples": "\n##### Examples\n\nReturns 12\n\n```sql\nEXTRACT(MONTH FROM '12/21/2016')\n```\n\nReturns 21\n\n```sql\nEXTRACT(DAY FROM '12/21/2016 12:00')\n```\n\nReturns 30\n\n```sql\nEXTRACT(
|
|
80
|
+
"examples": "\n##### Examples\n\nReturns 12\n\n```sql\nEXTRACT(MONTH FROM DATE '12/21/2016')\n```\n\nReturns 21\n\n```sql\nEXTRACT(DAY FROM TIMESTAMP '12/21/2016 12:00')\n```\n\nReturns 30\n\n```sql\nEXTRACT(SECOND FROM TIME '10:50:30')\n```\n\n",
|
|
81
81
|
"completion": {
|
|
82
82
|
"label": "EXTRACT",
|
|
83
83
|
"detail": "EXTRACT(part, datetime) -> Number",
|
|
84
|
-
"insertText": "EXTRACT(${1:part_}
|
|
84
|
+
"insertText": "EXTRACT(${1:part_} FROM ${2:datetime_})$0",
|
|
85
85
|
"insertTextMode": 2,
|
|
86
86
|
"insertTextFormat": 2,
|
|
87
87
|
"kind": 3,
|
|
88
88
|
"documentation": {
|
|
89
89
|
"kind": "markdown",
|
|
90
|
-
"value": "Returns a single part of a datetime, such as year, month, day, hour, minute, or second.\n\n**Parameters**\n\n- **part**: The part to extract from the date. Possible values: `YEAR`, `MONTH`, `DAY`, `HOUR`, `MINUTE`, `SECOND
|
|
90
|
+
"value": "Returns a single part of a datetime, such as year, month, day, hour, minute, or second.\n\n**Parameters**\n\n- **part**: The part to extract from the date. Possible values: `YEAR`, `MONTH`, `DAY`, `HOUR`, `MINUTE`, `SECOND`.\n- **datetime**: The date to extract a part from.\n\n**Return value**:"
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
93
|
"parametersInfo": {
|
|
@@ -128,8 +128,8 @@
|
|
|
128
128
|
"type": "function",
|
|
129
129
|
"name": "acos",
|
|
130
130
|
"bundle": "numeric",
|
|
131
|
-
"description": "Returns the arc cosine of a number.
|
|
132
|
-
"examples": "\n##### Example\n\nReturns 1.
|
|
131
|
+
"description": "Returns the arc cosine of a number.",
|
|
132
|
+
"examples": "\n##### Example\n\nReturns 1.26610367\n\n```sql\nACOS(0.3)\n```\n\n",
|
|
133
133
|
"completion": {
|
|
134
134
|
"label": "ACOS",
|
|
135
135
|
"detail": "ACOS(number) -> Number",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"kind": 3,
|
|
140
140
|
"documentation": {
|
|
141
141
|
"kind": "markdown",
|
|
142
|
-
"value": "Returns the arc cosine of a number
|
|
142
|
+
"value": "Returns the arc cosine of a number.\n\n**Parameter**\n\n- **number**: A number between -1 and 1 on which to perform the operation.\n\n**Return value**:"
|
|
143
143
|
}
|
|
144
144
|
},
|
|
145
145
|
"parametersInfo": {
|
|
@@ -151,8 +151,8 @@
|
|
|
151
151
|
"type": "function",
|
|
152
152
|
"name": "asin",
|
|
153
153
|
"bundle": "numeric",
|
|
154
|
-
"description": "Returns the arc sine of a number.
|
|
155
|
-
"examples": "\n##### Example\n\nReturns 0.
|
|
154
|
+
"description": "Returns the arc sine of a number.",
|
|
155
|
+
"examples": "\n##### Example\n\nReturns 0.30469265\n\n```sql\nASIN(0.3)\n```\n\n",
|
|
156
156
|
"completion": {
|
|
157
157
|
"label": "ASIN",
|
|
158
158
|
"detail": "ASIN(number) -> Number",
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
"kind": 3,
|
|
163
163
|
"documentation": {
|
|
164
164
|
"kind": "markdown",
|
|
165
|
-
"value": "Returns the arc sine of a number
|
|
165
|
+
"value": "Returns the arc sine of a number.\n\n**Parameter**\n\n- **number**: A number between -1 and 1 on which to perform the operation.\n\n**Return value**:"
|
|
166
166
|
}
|
|
167
167
|
},
|
|
168
168
|
"parametersInfo": {
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
"name": "atan",
|
|
176
176
|
"bundle": "numeric",
|
|
177
177
|
"description": "Returns the arc tangent of a number.",
|
|
178
|
-
"examples": "\n##### Example\n\nReturns 0.
|
|
178
|
+
"examples": "\n##### Example\n\nReturns 0.78539816\n\n```sql\nATAN(1)\n```\n\n",
|
|
179
179
|
"completion": {
|
|
180
180
|
"label": "ATAN",
|
|
181
181
|
"detail": "ATAN(number) -> Number",
|
|
@@ -202,13 +202,13 @@
|
|
|
202
202
|
"completion": {
|
|
203
203
|
"label": "CAST",
|
|
204
204
|
"detail": "CAST(value, dataType) -> Number,Datetime,String",
|
|
205
|
-
"insertText": "CAST(${1:value_}
|
|
205
|
+
"insertText": "CAST(${1:value_} AS ${2:dataType_})$0",
|
|
206
206
|
"insertTextMode": 2,
|
|
207
207
|
"insertTextFormat": 2,
|
|
208
208
|
"kind": 3,
|
|
209
209
|
"documentation": {
|
|
210
210
|
"kind": "markdown",
|
|
211
|
-
"value": "Converts a value from one data type to another. The dataType parameter will determine what type the value is converted to. FLOAT converts the value to a double, INTEGER converts the value to an integer, etc.\n\n**Parameters**\n\n- **value**: The value to convert to another data type.\n- **dataType**: The data type to convert the value to. Possible values: `DATE`, `FLOAT`, `INTEGER`, `REAL`, `SMALLINT`, `TIME`, `TIMESTAMP`, `VARCHAR
|
|
211
|
+
"value": "Converts a value from one data type to another. The dataType parameter will determine what type the value is converted to. FLOAT converts the value to a double, INTEGER converts the value to an integer, etc.\n\n**Parameters**\n\n- **value**: The value to convert to another data type.\n- **dataType**: The data type to convert the value to. Possible values: `DATE`, `FLOAT`, `INTEGER`, `REAL`, `SMALLINT`, `TIME`, `TIMESTAMP`, `VARCHAR`.\n\n**Return value**:"
|
|
212
212
|
}
|
|
213
213
|
},
|
|
214
214
|
"parametersInfo": {
|
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
"name": "cos",
|
|
245
245
|
"bundle": "numeric",
|
|
246
246
|
"description": "Returns the trigonometric cosine of the number, which is assumed to be an angle in radians.",
|
|
247
|
-
"examples": "\n##### Example\n\nReturns -0.
|
|
247
|
+
"examples": "\n##### Example\n\nReturns -0.41614684\n\n```sql\nCOS(2)\n```\n\n",
|
|
248
248
|
"completion": {
|
|
249
249
|
"label": "COS",
|
|
250
250
|
"detail": "COS(number) -> Number",
|
|
@@ -300,7 +300,7 @@
|
|
|
300
300
|
"kind": 3,
|
|
301
301
|
"documentation": {
|
|
302
302
|
"kind": "markdown",
|
|
303
|
-
"value": "Returns the natural logarithm (base e) of the number.\n\n**Parameter**\n\n- **number**: A number on which to perform the operation.\n\n**Return value**:"
|
|
303
|
+
"value": "Returns the natural logarithm (base e) of the number.\n\n**Parameter**\n\n- **number**: A number greater than 0 on which to perform the operation.\n\n**Return value**:"
|
|
304
304
|
}
|
|
305
305
|
},
|
|
306
306
|
"parametersInfo": {
|
|
@@ -359,7 +359,7 @@
|
|
|
359
359
|
"name": "nullif",
|
|
360
360
|
"bundle": "numeric",
|
|
361
361
|
"description": "Returns `NULL` if expression1 is equal to expression2. NULLIF is commonly used to prevent divide-by-zero errors by setting expression2 to 0.",
|
|
362
|
-
"examples": "\n##### Examples\n\nReturns `null`\n\n```sql\nNULLIF(
|
|
362
|
+
"examples": "\n##### Examples\n\nReturns `null`\n\n```sql\nNULLIF('Monday', 'Monday')\n```\n\nReturns 32\n\n```sql\nNULLIF(32, 0)\n```\n\nReturns `null` if POP18 is equal to 0, otherwise, returns the value of TOTALPOP / POP18.\n\n```sql\nTOTALPOP / NULLIF(POP18, 0)\n```\n\n",
|
|
363
363
|
"completion": {
|
|
364
364
|
"label": "NULLIF",
|
|
365
365
|
"detail": "NULLIF(expression1, expression2) -> Number,String,Datetime",
|
|
@@ -451,7 +451,7 @@
|
|
|
451
451
|
"name": "sin",
|
|
452
452
|
"bundle": "numeric",
|
|
453
453
|
"description": "Returns the trigonometric sine of the number, which is assumed to be an angle in radians.",
|
|
454
|
-
"examples": "\n##### Example\n\nReturns 0.
|
|
454
|
+
"examples": "\n##### Example\n\nReturns 0.84147098\n\n```sql\nSIN(1)\n```\n\n",
|
|
455
455
|
"completion": {
|
|
456
456
|
"label": "SIN",
|
|
457
457
|
"detail": "SIN(number) -> Number",
|
|
@@ -474,7 +474,7 @@
|
|
|
474
474
|
"name": "tan",
|
|
475
475
|
"bundle": "numeric",
|
|
476
476
|
"description": "Returns the tangent of a number, which is assumed to be an angle in radians.",
|
|
477
|
-
"examples": "\n##### Example\n\nReturns 2.
|
|
477
|
+
"examples": "\n##### Example\n\nReturns 2.57215162\n\n```sql\nTAN(1.2)\n```\n\n",
|
|
478
478
|
"completion": {
|
|
479
479
|
"label": "TAN",
|
|
480
480
|
"detail": "TAN(number) -> Number",
|
|
@@ -497,7 +497,7 @@
|
|
|
497
497
|
"name": "truncate",
|
|
498
498
|
"bundle": "numeric",
|
|
499
499
|
"description": "Returns a truncated number.",
|
|
500
|
-
"examples": "\n##### Examples\n\nReturns 91.3\n\n```sql\nTRUNCATE(91.367, 1)\n```\n\nReturns 124\n\n```sql\nTRUNCATE(124.45, 0)\n```\n\nReturns 1900\n\n```sql\nTRUNCATE(1982.83
|
|
500
|
+
"examples": "\n##### Examples\n\nReturns 91.3\n\n```sql\nTRUNCATE(91.367, 1)\n```\n\nReturns 124\n\n```sql\nTRUNCATE(124.45, 0)\n```\n\nReturns 1900\n\n```sql\nTRUNCATE(1982.83, -2)\n```\n\n",
|
|
501
501
|
"completion": {
|
|
502
502
|
"label": "TRUNCATE",
|
|
503
503
|
"detail": "TRUNCATE(number, decimals) -> Number",
|
|
@@ -549,7 +549,7 @@
|
|
|
549
549
|
"name": "coalesce",
|
|
550
550
|
"bundle": "string",
|
|
551
551
|
"description": "Returns the first value in the list that is not `NULL`.",
|
|
552
|
-
"examples": "\n##### Examples\n\nReturns 'Green goldfish'\n\n```sql\nCOALESCE(
|
|
552
|
+
"examples": "\n##### Examples\n\nReturns 'Green goldfish'\n\n```sql\nCOALESCE(null, null, 'Green goldfish', null, 'Purple cow')\n```\n\nReturns -21\n\n```sql\nCOALESCE(null, -21, 33, null)\n```\n\n",
|
|
553
553
|
"completion": {
|
|
554
554
|
"label": "COALESCE",
|
|
555
555
|
"detail": "COALESCE(val_1, val_2, val_n) -> String,Number",
|
|
@@ -618,17 +618,17 @@
|
|
|
618
618
|
"name": "position",
|
|
619
619
|
"bundle": "string",
|
|
620
620
|
"description": "Returns the first occurrence of a substring in another text string. Returns 0 if the substring is not found.",
|
|
621
|
-
"examples": "\n##### Examples\n\nReturns 6\n\n```sql\nPOSITION('com'
|
|
621
|
+
"examples": "\n##### Examples\n\nReturns 6\n\n```sql\nPOSITION('com' IN 'esri.com')\n```\n\nReturns 9\n\n```sql\nPOSITION('sum' IN 'Lorem ipsum')\n```\n\n",
|
|
622
622
|
"completion": {
|
|
623
623
|
"label": "POSITION",
|
|
624
624
|
"detail": "POSITION(substring, string) -> Number",
|
|
625
|
-
"insertText": "POSITION(${1:substring_}
|
|
625
|
+
"insertText": "POSITION(${1:substring_} IN ${2:string_})$0",
|
|
626
626
|
"insertTextMode": 2,
|
|
627
627
|
"insertTextFormat": 2,
|
|
628
628
|
"kind": 3,
|
|
629
629
|
"documentation": {
|
|
630
630
|
"kind": "markdown",
|
|
631
|
-
"value": "Returns the first occurrence of a substring in another text string. Returns 0 if the substring is not found.\n\n**Parameters**\n\n- **substring**: The text string to search for
|
|
631
|
+
"value": "Returns the first occurrence of a substring in another text string. Returns 0 if the substring is not found.\n\n**Parameters**\n\n- **substring**: The text string to search for.\n- **string**: The string that will be searched for the substring.\n\n**Return value**:"
|
|
632
632
|
}
|
|
633
633
|
},
|
|
634
634
|
"parametersInfo": {
|
|
@@ -669,7 +669,7 @@
|
|
|
669
669
|
"completion": {
|
|
670
670
|
"label": "SUBSTRING",
|
|
671
671
|
"detail": "SUBSTRING(string, start, length) -> String",
|
|
672
|
-
"insertText": "SUBSTRING(${1:string_}
|
|
672
|
+
"insertText": "SUBSTRING(${1:string_} FROM ${2:start_} FOR ${3:length_})$0",
|
|
673
673
|
"insertTextMode": 2,
|
|
674
674
|
"insertTextFormat": 2,
|
|
675
675
|
"kind": 3,
|
|
@@ -688,23 +688,23 @@
|
|
|
688
688
|
"type": "function",
|
|
689
689
|
"name": "trim",
|
|
690
690
|
"bundle": "string",
|
|
691
|
-
"description": "Returns a text string where all of the leading and/or trailing spaces have been removed. LEADING will trim the leading side of the text string, TRAILING will trim the trailing side of the text string, while BOTH will trim both sides of the text string.",
|
|
692
|
-
"examples": "\n##### Examples\n\nReturns '
|
|
691
|
+
"description": "Returns a text string where all of the leading and/or trailing spaces or other specified characters have been removed. LEADING will trim the leading side of the text string, TRAILING will trim the trailing side of the text string, while BOTH will trim both sides of the text string.",
|
|
692
|
+
"examples": "\n##### Examples\n\nReturns 'myFunc'\n\n```sql\nTRIM(LEADING 't' FROM 'tMyFunc')\n```\n\nReturns ' hello world'\n\n```sql\nTRIM(TRAILING ' ' FROM ' hello world ')\n```\n\nReturns 'hello world'\n\n```sql\nTRIM(BOTH ' ' FROM ' hello world ')\n```\n\n",
|
|
693
693
|
"completion": {
|
|
694
694
|
"label": "TRIM",
|
|
695
|
-
"detail": "TRIM(side, string) -> String",
|
|
696
|
-
"insertText": "TRIM(${1:side_}
|
|
695
|
+
"detail": "TRIM(side, character, string) -> String",
|
|
696
|
+
"insertText": "TRIM(${1:side_} ${2:character_} FROM ${3:string_})$0",
|
|
697
697
|
"insertTextMode": 2,
|
|
698
698
|
"insertTextFormat": 2,
|
|
699
699
|
"kind": 3,
|
|
700
700
|
"documentation": {
|
|
701
701
|
"kind": "markdown",
|
|
702
|
-
"value": "Returns a text string where all of the leading and/or trailing spaces have been removed. LEADING will trim the leading side of the text string, TRAILING will trim the trailing side of the text string, while BOTH will trim both sides of the text string.\n\n**Parameters**\n\n- **side**: The side of the text string where
|
|
702
|
+
"value": "Returns a text string where all of the leading and/or trailing spaces or other specified characters have been removed. LEADING will trim the leading side of the text string, TRAILING will trim the trailing side of the text string, while BOTH will trim both sides of the text string.\n\n**Parameters**\n\n- **side**: The side of the text string where the space(s) or character(s) will be removed. Possible values: `LEADING`, `TRAILING`, `BOTH`.\n- **character**: The character(s) that will be trimmed from the text string.\n- **string**: The text string to trim.\n\n**Return value**:"
|
|
703
703
|
}
|
|
704
704
|
},
|
|
705
705
|
"parametersInfo": {
|
|
706
|
-
"min":
|
|
707
|
-
"max":
|
|
706
|
+
"min": 3,
|
|
707
|
+
"max": 3
|
|
708
708
|
}
|
|
709
709
|
},
|
|
710
710
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.60
|
|
5
5
|
*/
|
|
6
|
-
export{a as arcade}from"./p-
|
|
6
|
+
export{a as arcade}from"./p-324d3441.js";import"./p-49d247b3.js";import"./p-48a82879.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
+
* v4.31.0-next.60
|
|
5
|
+
*/
|
|
6
|
+
import{m as e,g as t,O as s,R as n,x as r,P as i,D as a,Q as o}from"./p-49d247b3.js";var c=[[],[],[]];["++","--"].forEach((e=>c[e.length-1]?.push(e))),["-","+","!","~"].forEach((e=>c[e.length-1]?.push(e))),["||","&&"].forEach((e=>c[e.length-1]?.push(e))),["=","/=","*=","%=","+=","-="].forEach((e=>c[e.length-1]?.push(e))),["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"].forEach((e=>c[e.length-1]?.push(e)));var u=Object.values({Break:"break",Continue:"continue",Else:"else",For:"for",From:"from",Function:"function",If:"if",Import:"import",Export:"export",In:"in",Return:"return",Var:"var",While:"while"});Object.values({False:"false",Null:"null",True:"true"}).map((t=>({label:t,kind:e.exports.CompletionItemKind.Constant}))),u.map((t=>({label:t,kind:e.exports.CompletionItemKind.Keyword})));const l={wordPattern:/(-?\d*\.\d\w*)|([^`~!#%\^&\*\(\)\-=\+\[\{\]\}\\\|;:'",\.<>\/\?\s]+)/gu,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"`",close:"`",notIn:["string","comment"]}],autoCloseBefore:";:.,=}])` \n\t",folding:{markers:{start:/^\s*\/\/\s*#?region\b/u,end:/^\s*\/\/\s*#?endregion\b/u}},indentationRules:{decreaseIndentPattern:/^((?!.*?\/\*).*\*\/)?\s*[\}\]\)].*$/u,increaseIndentPattern:/^((?!\/\/).)*(\{[^}"'`]*|\([^)"'`]*|\[[^\]"'`]*)$/u}},g={defaultToken:"invalid",tokenPostfix:".arc",ignoreCase:!0,keywords:u.filter((e=>"from"!==e)),operators:["<=",">=","==","!=","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","=","+=","-=","*=","**=","/=","%="],constants:["true","false","null"],symbols:/[=><!~?:&|+\-*\/\^%]+/u,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/u,digits:/\d+(_+\d+)*/u,octaldigits:/[0-7]+(_+[0-7]+)*/u,binarydigits:/[0-1]+(_+[0-1]+)*/u,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/u,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/u,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/u,tokenizer:{root:[[/[{}]/u,"delimiter.bracket"],{include:"common"}],common:[[/import(?=\s)/u,{token:"keyword",next:"@import"}],[/[a-z_$][\w$]*/u,{cases:{"@constants":"constant","@keywords":"keyword","@default":"identifier"}}],{include:"@whitespace"},[/\/(?=([^\\\/]|\\.)+\/([gimsuy]*)(\s*)(\.|;|\/|,|\)|\]|\}|$))/u,{token:"regexp",bracket:"@open",next:"@regexp"}],[/[()\[\]]/u,"@brackets"],[/[<>](?!@symbols)/u,"@brackets"],[/@symbols/u,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/u,"number"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/u,"number"],[/0[xX](@hexdigits)/u,"number"],[/0[oO]?(@octaldigits)/u,"number"],[/0[bB](@binarydigits)/u,"number"],[/(@digits)/u,"number"],[/[;,.]/u,"delimiter"],[/"([^"\\]|\\.)*$/u,"string.invalid"],[/'([^'\\]|\\.)*$/u,"string.invalid"],[/"/u,"string","@string_double"],[/'/u,"string","@string_single"],[/`/u,"string","@string_backtick"]],import:[[/import(?=\s)/u,{token:"keyword"}],{include:"@whitespace"},[/[a-z_$][\w$]*/u,"identifier"],{include:"@whitespace"},[/from/u,{token:"keyword",next:"@popall"}]],whitespace:[[/[ \t\r\n]+/u,""],[/\/\*/u,"comment","@comment"],[/\/\/.*$/u,"comment"]],comment:[[/[^\/*]+/u,"comment"],[/\*\//u,"comment","@pop"],[/[\/*]/u,"comment"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/u,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/u,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/u,["regexp.escape.control","regexp.escape.control"]],[/[()]/u,"regexp.escape.control"],[/@regexpctl/u,"regexp.escape.control"],[/[^\\\/]/u,"regexp"],[/@regexpesc/u,"regexp.escape"],[/\\\./u,"regexp.invalid"],[/(\/)([gimsuy]*)/u,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/u,"regexp.escape.control"],[/\^/u,"regexp.invalid"],[/@regexpesc/u,"regexp.escape"],[/[^\]]/u,"regexp"],[/\]/u,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"]+/u,"string"],[/@escapes/u,"string.escape"],[/\\./u,"string.escape.invalid"],[/"/u,"string","@pop"]],string_single:[[/[^\\']+/u,"string"],[/@escapes/u,"string.escape"],[/\\./u,"string.escape.invalid"],[/'/u,"string","@pop"]],string_backtick:[[/\$\{/u,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/u,"string"],[/@escapes/u,"string.escape"],[/\\./u,"string.escape.invalid"],[/`/u,"string","@pop"]],bracketCounting:[[/\{/u,"delimiter.bracket","@bracketCounting"],[/\}/u,"delimiter.bracket","@pop"],{include:"common"}]}};class p{constructor(e,s,{defaults:n,diagnosticsService:r}){this._languageId=e,this._worker=s,this._disposables=[],this._listener=new Map,this._diagnosticsService=r,this._defaults=n;const a=e=>{const t=e.getLanguageId();if(t!==this._languageId)return;const s=i((()=>{this._doValidate(e,t).catch((e=>{throw e}))}));this._listener.set(e.uri.toString(),e.onDidChangeContent(s)),this._doValidate(e,t).catch(console.error)},o=e=>{const s=e.uri.toString();t.setModelMarkers(e,this._languageId,[]);const n=this._listener.get(s);n&&(n.dispose(),this._listener.delete(s))};this._disposables.push(t.onDidCreateModel(a)),this._disposables.push(t.onWillDisposeModel((e=>{o(e)}))),this._disposables.push(t.onDidChangeModelLanguage((e=>{o(e.model),a(e.model)}))),this._disposables.push(n.onDidChange((()=>{t.getModels().forEach((e=>{e.getLanguageId()===this._languageId&&(o(e),a(e))}))}))),this._disposables.push(n.onModelContextDidChange((e=>{t.getModels().forEach((t=>{t.getLanguageId()===this._languageId&&t.uri.toString()===e&&this._doValidate(t,this._languageId).catch(console.error)}))}))),this._disposables.push({dispose:()=>{this._listener.forEach((e=>e.dispose())),this._listener.clear()}}),t.getModels().forEach(a)}dispose(){this._disposables.forEach((e=>e.dispose())),this._disposables=[]}async _doValidate(e,s){if(e.isAttachedToEditor())try{const n=await this._worker(e.uri),r=this._defaults.getApiContextForModel(e.uri),i=await n.doValidation(e.uri.toString(),r),a=i.map((e=>{return{severity:d((t=e).severity),startLineNumber:t.range.start.line+1,startColumn:t.range.start.character+1,endLineNumber:t.range.end.line+1,endColumn:t.range.end.character+1,message:t.message};var t}));this._diagnosticsService.fireDiagnosticsChange(e.uri,i),t.setModelMarkers(e,s,a)}catch(e){console.error(e)}}}function d(t){switch(t){case e.exports.DiagnosticSeverity.Error:return s.Error;case e.exports.DiagnosticSeverity.Warning:return s.Warning;case e.exports.DiagnosticSeverity.Information:return s.Info;case e.exports.DiagnosticSeverity.Hint:return s.Hint;default:return s.Info}}function h(e){return new n(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}function m(e){return{range:h(e.range),text:e.newText}}function x(t){const s=r.CompletionItemKind;switch(t){case e.exports.CompletionItemKind.Text:return s.Text;case e.exports.CompletionItemKind.Method:return s.Method;case e.exports.CompletionItemKind.Function:return s.Function;case e.exports.CompletionItemKind.Constructor:return s.Constructor;case e.exports.CompletionItemKind.Field:return s.Field;case e.exports.CompletionItemKind.Variable:return s.Variable;case e.exports.CompletionItemKind.Class:return s.Class;case e.exports.CompletionItemKind.Interface:return s.Interface;case e.exports.CompletionItemKind.Module:return s.Module;case e.exports.CompletionItemKind.Property:return s.Property;case e.exports.CompletionItemKind.Unit:return s.Unit;case e.exports.CompletionItemKind.Value:return s.Value;case e.exports.CompletionItemKind.Enum:return s.Enum;case e.exports.CompletionItemKind.Keyword:return s.Keyword;case e.exports.CompletionItemKind.Snippet:return s.Snippet;case e.exports.CompletionItemKind.Color:return s.Color;case e.exports.CompletionItemKind.File:return s.File;case e.exports.CompletionItemKind.Reference:return s.Reference;case e.exports.CompletionItemKind.Folder:return s.Folder;case e.exports.CompletionItemKind.EnumMember:return s.EnumMember;case e.exports.CompletionItemKind.Constant:return s.Constant;case e.exports.CompletionItemKind.Struct:return s.Struct;case e.exports.CompletionItemKind.Event:return s.Event;case e.exports.CompletionItemKind.Operator:return s.Operator;case e.exports.CompletionItemKind.TypeParameter:return s.TypeParameter;default:return s.Property}}class w{constructor(e,t){this._worker=e,this._defaults=t,this.triggerCharacters=[".","("]}async provideCompletionItems(t,s){const i=await this._worker(t.uri),a=this._defaults.getApiContextForModel(t.uri),o=await i.doComplete(t.uri.toString(),function(e){return{character:e.column-1,line:e.lineNumber-1}}(s),a),c=t.getWordUntilPosition(s),u=new n(s.lineNumber,c.startColumn,s.lineNumber,c.endColumn),l=o.items.map((t=>{const s={label:t.label,insertText:t.insertText||t.label,sortText:t.sortText,filterText:t.filterText,detail:t.detail,range:u,kind:x(t.kind)};var n;return t.textEdit&&(s.range=void 0!==(n=t.textEdit).insert&&void 0!==n.replace?{insert:h(t.textEdit.insert),replace:h(t.textEdit.replace)}:h(t.textEdit.range),s.insertText=t.textEdit.newText),t.additionalTextEdits&&(s.additionalTextEdits=t.additionalTextEdits.map(m)),t.insertTextFormat===e.exports.InsertTextFormat.Snippet&&(s.insertTextRules=r.CompletionItemInsertTextRule.InsertAsSnippet),t.documentation&&(s.documentation="string"==typeof t.documentation?t.documentation:{supportThemeIcons:!1,value:t.documentation.value,supportHtml:!0}),s}));return{incomplete:o.isIncomplete,suggestions:l}}}class k{constructor(e,t){this._worker=e,this._defaults=t}async provideDocumentFormattingEdits(e){const t=await this._worker(e.uri),s=this._defaults.getApiContextForModel(e.uri.toString());return(await t.doFormat(e.uri.toString(),s)).map((e=>({range:h(e.range),text:e.newText})))}}let f,b=new a;class y{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange((()=>this.stopWorker()))}dispose(){this._configChangeListener.dispose(),this.stopWorker()}stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null,b=new a),this._client=null}static async waitForWorker(){return await b.promise}async _getClientProxy(){if(!this._client){const{languageId:e,languageOptions:s}=this._defaults;this._worker=t.createWebWorker({moduleId:"ArcadeWorker",label:e,createData:{languageId:e,languageOptions:s}}),b.resolve(this._worker),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){const t=await this._getClientProxy();return await(this._worker?.withSyncedResources(e)),t}}async function v(...e){return await y.waitForWorker(),await new Promise(((t,s)=>{f?t(f(...e)):s(new Error("Arcade not registered!"))}))}const C=new class{constructor(){this._onDiagnosticsChange=new o}get onDiagnosticsChange(){return this._onDiagnosticsChange.event}fireDiagnosticsChange(e,t){this._onDiagnosticsChange.fire({uri:e,diagnostics:t})}};function _(){return C}function F(e){const t=new y(e),s=async(...e)=>await t.getLanguageServiceWorker(...e);f=s,r.setMonarchTokensProvider(e.languageId,g),r.setLanguageConfiguration(e.languageId,l),r.registerCompletionItemProvider(e.languageId,new w(s,e)),r.registerDocumentFormattingEditProvider(e.languageId,new k(s,e)),new p(e.languageId,s,{defaults:e,diagnosticsService:C})}export{_ as getArcadeDiagnosticService,v as getArcadeWorker,F as setupMode}
|