@arcgis/coding-components 4.31.0-next.5 → 4.31.0-next.7
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/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
- package/dist/arcgis-coding-components/index.esm.js +2 -2
- package/dist/arcgis-coding-components/p-24128ac2.js +6 -0
- package/dist/arcgis-coding-components/p-2ba0dc32.js +6 -0
- package/dist/arcgis-coding-components/{p-7f776266.js → p-51cb7124.js} +2 -2
- package/dist/arcgis-coding-components/{p-ae6af9eb.js → p-56ef1db2.js} +2 -2
- package/dist/arcgis-coding-components/{p-e31be2c5.js → p-57b9aa11.js} +1 -1
- package/dist/arcgis-coding-components/{p-e89166f0.js → p-5fbefa40.js} +1 -1
- package/dist/arcgis-coding-components/{p-7bd74de6.entry.js → p-6d76b473.entry.js} +2 -2
- package/dist/arcgis-coding-components/{p-2d32fb1b.js → p-7f1b7590.js} +2 -2
- package/dist/arcgis-coding-components/{p-28d34a6e.entry.js → p-827f1fff.entry.js} +2 -2
- package/dist/arcgis-coding-components/p-8a789638.js +6 -0
- package/dist/arcgis-coding-components/p-a3af83b2.js +6 -0
- package/dist/arcgis-coding-components/{p-c41f6d7c.js → p-b7927956.js} +2 -2
- package/dist/arcgis-coding-components/{p-de85c014.js → p-c753e2e1.js} +1 -1
- package/dist/arcgis-coding-components/{p-3d5b8c4b.js → p-c9173dd7.js} +10 -10
- package/dist/arcgis-coding-components/{p-2c85c4b2.js → p-d610db5e.js} +2 -2
- package/dist/arcgis-coding-components/{p-aa9d06e6.js → p-de0ced33.js} +2 -2
- package/dist/arcgis-coding-components/{p-5b62a1ac.entry.js → p-dec9545b.entry.js} +2 -2
- package/dist/arcgis-coding-components/{p-60739af5.js → p-eca45afe.js} +2 -2
- package/dist/arcgis-coding-components/p-fd9abbee.js +6 -0
- package/dist/cjs/{app-globals-886c7ef0.js → app-globals-95a58c45.js} +1 -1
- package/dist/cjs/{arcade-defaults-56b6742a.js → arcade-defaults-adce528c.js} +4 -4
- package/dist/cjs/arcade-language-features-72d4b0d4.js +274 -0
- package/dist/cjs/{arcade-mode-2175ca7d.js → arcade-mode-a8f7893e.js} +7 -266
- package/dist/cjs/arcgis-arcade-editor_6.cjs.entry.js +6 -6
- package/dist/cjs/arcgis-coding-components.cjs.js +3 -3
- package/dist/cjs/arcgis-sql-expression-editor.cjs.entry.js +4 -4
- package/dist/cjs/arcgis-sql-expression-fields.cjs.entry.js +4 -4
- package/dist/cjs/{css-b5a232da.js → css-10717df1.js} +1 -1
- package/dist/cjs/{cssMode-f67c30d4.js → cssMode-af6b6837.js} +3 -3
- package/dist/cjs/{html-d57fda6b.js → html-e871b2ae.js} +3 -3
- package/dist/cjs/{htmlMode-c1513225.js → htmlMode-33758987.js} +3 -3
- package/dist/cjs/{index-6563aa26.js → index-2c90e42e.js} +1 -1
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/{javascript-d7362563.js → javascript-03d1437c.js} +4 -4
- package/dist/cjs/{jsonMode-1ea2f163.js → jsonMode-3013c90b.js} +3 -3
- package/dist/cjs/{language-defaults-base-66e1921b.js → language-defaults-base-081fe837.js} +30 -46
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{sql-expr-defaults-e30d7627.js → sql-expr-defaults-a8b942e3.js} +13 -18
- package/dist/cjs/{sql-expr-mode-74c5c2c2.js → sql-expr-mode-7f91696f.js} +11531 -14828
- package/dist/cjs/{tsMode-9db1a5aa.js → tsMode-a47d5976.js} +3 -3
- package/dist/cjs/{typescript-f6d1b2b4.js → typescript-eebe50a0.js} +3 -3
- package/dist/components/arcade-defaults.js +1 -1
- package/dist/components/arcade-language-features.js +271 -0
- package/dist/components/arcade-mode.js +4 -264
- package/dist/components/arcade-results.js +2 -2
- package/dist/components/arcade-suggestions.js +2 -2
- package/dist/components/arcade-variables.js +2 -2
- package/dist/components/arcgis-arcade-editor.js +2 -2
- 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 +1 -1
- package/dist/components/arcgis-assets.js +1 -1
- 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 +2 -2
- package/dist/components/arcgis-sql-expression-fields.js +1 -1
- package/dist/components/{chunk-6TARY3NN.js → chunk-3IUJHIAA.js} +11 -16
- package/dist/components/code-editor.js +2 -2
- package/dist/components/fields.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +1 -1
- package/dist/components/language-api-panel.js +2 -2
- package/dist/components/language-defaults-base.js +21 -37
- package/dist/components/markdown.js +1 -1
- package/dist/components/sql-expr-defaults.js +1 -1
- package/dist/components/sql-expr-mode.js +11529 -14825
- package/dist/components/sql-expression-fields.js +2 -2
- package/dist/components/useT9n.js +2 -2
- package/dist/components/utilities.js +1 -1
- package/dist/esm/{app-globals-4531df03.js → app-globals-9b568679.js} +1 -1
- package/dist/esm/{arcade-defaults-d85fe608.js → arcade-defaults-3b370e7f.js} +4 -4
- package/dist/esm/arcade-language-features-09dbac1a.js +269 -0
- package/dist/esm/{arcade-mode-121c8f8b.js → arcade-mode-dc12cdd7.js} +4 -263
- package/dist/esm/arcgis-arcade-editor_6.entry.js +6 -6
- package/dist/esm/arcgis-coding-components.js +4 -4
- package/dist/esm/arcgis-sql-expression-editor.entry.js +4 -4
- package/dist/esm/arcgis-sql-expression-fields.entry.js +4 -4
- package/dist/esm/{css-f03ce15d.js → css-2ac5d369.js} +1 -1
- package/dist/esm/{cssMode-9350af4a.js → cssMode-ee67ef12.js} +3 -3
- package/dist/esm/{html-8a5ee186.js → html-db02f025.js} +3 -3
- package/dist/esm/{htmlMode-dbcde814.js → htmlMode-d98c6313.js} +3 -3
- package/dist/esm/{index-71c8a762.js → index-79a2905d.js} +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/{javascript-b11dc132.js → javascript-49434450.js} +4 -4
- package/dist/esm/{jsonMode-7afef1a4.js → jsonMode-7eb9940c.js} +3 -3
- package/dist/esm/{language-defaults-base-47e8d77c.js → language-defaults-base-bb09da9f.js} +31 -47
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{sql-expr-defaults-fa9b2d75.js → sql-expr-defaults-1aedce82.js} +13 -18
- package/dist/esm/{sql-expr-mode-931857be.js → sql-expr-mode-3c0c4ee2.js} +11531 -14828
- package/dist/esm/{tsMode-76190ec2.js → tsMode-abf1ffe4.js} +3 -3
- package/dist/esm/{typescript-346e9d47.js → typescript-6ebd28ac.js} +3 -3
- package/dist/loader/cdn.js +1 -1
- package/dist/loader/index.cjs.js +1 -1
- package/dist/loader/index.es2017.js +1 -1
- package/dist/loader/index.js +1 -1
- package/dist/types/components/arcade-editor/arcade-editor.d.ts +1 -1
- package/dist/types/components/arcade-results/arcade-results.d.ts +1 -1
- package/dist/types/components/arcade-suggestions/arcade-suggestions.d.ts +1 -1
- package/dist/types/components/arcade-variables/arcade-variables.d.ts +1 -1
- package/dist/types/components/language-api-panel/language-api-panel.d.ts +1 -1
- package/dist/types/utils/arcade-monaco/arcade-language-features.d.ts +1 -0
- package/dist/types/utils/profile/types.d.ts +29 -69
- package/dist/types/utils/profile/utils.d.ts +4 -7
- package/dist/types/utils/sql-expr-monaco/sql-expr-completion.d.ts +3 -2
- package/dist/types/utils/sql-expr-monaco/sql-expr-language-features.d.ts +6 -485
- package/package.json +10 -10
- package/dist/arcgis-coding-components/p-43da2244.js +0 -6
- package/dist/arcgis-coding-components/p-65bb8c77.js +0 -6
- package/dist/arcgis-coding-components/p-88b5d206.js +0 -6
- package/dist/arcgis-coding-components/p-cbf4fec2.js +0 -6
|
@@ -1,10 +1,10 @@
|
|
|
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.7
|
|
5
5
|
*/
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h } from '@stencil/core/internal/client';
|
|
7
|
-
import { u as useControllerManager } from './chunk-
|
|
7
|
+
import { u as useControllerManager } from './chunk-3IUJHIAA.js';
|
|
8
8
|
import { s as sqlExprDefaults } from './sql-expr-defaults.js';
|
|
9
9
|
import "@esri/calcite-components/dist/components/calcite-block.js";
|
|
10
10
|
import "@esri/calcite-components/dist/components/calcite-flow.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
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.7
|
|
5
5
|
*/
|
|
6
|
-
import { m as makeController, w as watch } from './chunk-
|
|
6
|
+
import { m as makeController, w as watch } from './chunk-3IUJHIAA.js';
|
|
7
7
|
import { n as startLocaleObserver, p as getElementLocales } from './index2.js';
|
|
8
8
|
import { getArcgisAssetPath as getAssetPath } from "./arcgis-assets.js";
|
|
9
9
|
|
|
@@ -1,10 +1,10 @@
|
|
|
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.7
|
|
5
5
|
*/
|
|
6
|
-
import { L as LanguageDefaultsBase, i as isPredefinedProfile, c as convertToEditorProfileDefinition, f as fetchT9nStringsBundle, E as EditorProfile, U as Uri } from './language-defaults-base-
|
|
7
|
-
import { g as getAssetPath } from './index-
|
|
6
|
+
import { L as LanguageDefaultsBase, i as isPredefinedProfile, c as convertToEditorProfileDefinition, f as fetchT9nStringsBundle, E as EditorProfile, U as Uri } from './language-defaults-base-bb09da9f.js';
|
|
7
|
+
import { g as getAssetPath } from './index-79a2905d.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Returns the arcade diagnostic service.
|
|
@@ -38,7 +38,7 @@ async function getArcadeWorker(uri) {
|
|
|
38
38
|
* @returns arcade mode module
|
|
39
39
|
*/
|
|
40
40
|
async function getMode() {
|
|
41
|
-
return await import('./arcade-mode-
|
|
41
|
+
return await import('./arcade-mode-dc12cdd7.js');
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
const arcadeLanguageId = "arcade";
|
|
@@ -0,0 +1,269 @@
|
|
|
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.7
|
|
5
|
+
*/
|
|
6
|
+
import { e as editor, M as MarkerSeverity, F as main, R as Range, u as languages, N as debounce } from './language-defaults-base-bb09da9f.js';
|
|
7
|
+
|
|
8
|
+
//#region Diagnostic
|
|
9
|
+
class DiagnosticsAdapter {
|
|
10
|
+
constructor(_languageId, _worker, { defaults, diagnosticsService, }) {
|
|
11
|
+
this._languageId = _languageId;
|
|
12
|
+
this._worker = _worker;
|
|
13
|
+
this._disposables = [];
|
|
14
|
+
this._listener = new Map();
|
|
15
|
+
this._diagnosticsService = diagnosticsService;
|
|
16
|
+
this._defaults = defaults;
|
|
17
|
+
const onModelAdd = (model) => {
|
|
18
|
+
const languageId = model.getLanguageId();
|
|
19
|
+
if (languageId !== this._languageId) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const debouncedValidate = debounce(() => {
|
|
23
|
+
this._doValidate(model, languageId).catch((err) => {
|
|
24
|
+
throw err;
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
this._listener.set(model.uri.toString(), model.onDidChangeContent(debouncedValidate));
|
|
28
|
+
this._doValidate(model, languageId).catch(console.error);
|
|
29
|
+
};
|
|
30
|
+
const onModelRemoved = (model) => {
|
|
31
|
+
const uriStr = model.uri.toString();
|
|
32
|
+
editor.setModelMarkers(model, this._languageId, []);
|
|
33
|
+
const listener = this._listener.get(uriStr);
|
|
34
|
+
if (listener) {
|
|
35
|
+
listener.dispose();
|
|
36
|
+
this._listener.delete(uriStr);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
this._disposables.push(editor.onDidCreateModel(onModelAdd));
|
|
40
|
+
this._disposables.push(editor.onWillDisposeModel((model) => {
|
|
41
|
+
onModelRemoved(model);
|
|
42
|
+
}));
|
|
43
|
+
this._disposables.push(editor.onDidChangeModelLanguage((event) => {
|
|
44
|
+
onModelRemoved(event.model);
|
|
45
|
+
onModelAdd(event.model);
|
|
46
|
+
}));
|
|
47
|
+
this._disposables.push(defaults.onDidChange(() => {
|
|
48
|
+
editor.getModels().forEach((model) => {
|
|
49
|
+
if (model.getLanguageId() === this._languageId) {
|
|
50
|
+
onModelRemoved(model);
|
|
51
|
+
onModelAdd(model);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}));
|
|
55
|
+
this._disposables.push(defaults.onModelContextDidChange((key) => {
|
|
56
|
+
editor.getModels().forEach((model) => {
|
|
57
|
+
if (model.getLanguageId() === this._languageId && model.uri.toString() === key) {
|
|
58
|
+
this._doValidate(model, this._languageId).catch(console.error);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}));
|
|
62
|
+
this._disposables.push({
|
|
63
|
+
dispose: () => {
|
|
64
|
+
this._listener.forEach((value) => value.dispose());
|
|
65
|
+
this._listener.clear();
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
editor.getModels().forEach(onModelAdd);
|
|
69
|
+
}
|
|
70
|
+
dispose() {
|
|
71
|
+
this._disposables.forEach((d) => d.dispose());
|
|
72
|
+
this._disposables = [];
|
|
73
|
+
}
|
|
74
|
+
async _doValidate(model, languageId) {
|
|
75
|
+
if (!model.isAttachedToEditor()) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
try {
|
|
79
|
+
const workerProxy = await this._worker(model.uri);
|
|
80
|
+
const context = this._defaults.getApiContextForModel(model.uri);
|
|
81
|
+
const diagnostics = await workerProxy.doValidation(model.uri.toString(), context);
|
|
82
|
+
const markers = diagnostics.map((d) => toMarker(model.uri, d));
|
|
83
|
+
this._diagnosticsService.fireDiagnosticsChange(model.uri, diagnostics);
|
|
84
|
+
editor.setModelMarkers(model, languageId, markers);
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
console.error(err);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function toSeverity(languageServiceSeverity) {
|
|
92
|
+
switch (languageServiceSeverity) {
|
|
93
|
+
case main.exports.DiagnosticSeverity.Error:
|
|
94
|
+
return MarkerSeverity.Error;
|
|
95
|
+
case main.exports.DiagnosticSeverity.Warning:
|
|
96
|
+
return MarkerSeverity.Warning;
|
|
97
|
+
case main.exports.DiagnosticSeverity.Information:
|
|
98
|
+
return MarkerSeverity.Info;
|
|
99
|
+
case main.exports.DiagnosticSeverity.Hint:
|
|
100
|
+
return MarkerSeverity.Hint;
|
|
101
|
+
default:
|
|
102
|
+
return MarkerSeverity.Info;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function toMarker(_resource, diag) {
|
|
106
|
+
// Diagnostics positions are zero-based, MarkerData are 1-based
|
|
107
|
+
return {
|
|
108
|
+
severity: toSeverity(diag.severity),
|
|
109
|
+
startLineNumber: diag.range.start.line + 1,
|
|
110
|
+
startColumn: diag.range.start.character + 1,
|
|
111
|
+
endLineNumber: diag.range.end.line + 1,
|
|
112
|
+
endColumn: diag.range.end.character + 1,
|
|
113
|
+
message: diag.message,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region Completion
|
|
118
|
+
function fromPosition(position) {
|
|
119
|
+
// Language service is zero based
|
|
120
|
+
return { character: position.column - 1, line: position.lineNumber - 1 };
|
|
121
|
+
}
|
|
122
|
+
function toRange(range) {
|
|
123
|
+
return new Range(range.start.line + 1, range.start.character + 1, range.end.line + 1, range.end.character + 1);
|
|
124
|
+
}
|
|
125
|
+
function toTextEdit(textEdit) {
|
|
126
|
+
return {
|
|
127
|
+
range: toRange(textEdit.range),
|
|
128
|
+
text: textEdit.newText,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function isInsertReplaceEdit(edit) {
|
|
132
|
+
return (typeof edit.insert !== "undefined" &&
|
|
133
|
+
typeof edit.replace !== "undefined");
|
|
134
|
+
}
|
|
135
|
+
// TODO: extract this function to common util
|
|
136
|
+
function toCompletionItemKind(kind) {
|
|
137
|
+
const mItemKind = languages.CompletionItemKind;
|
|
138
|
+
switch (kind) {
|
|
139
|
+
case main.exports.CompletionItemKind.Text:
|
|
140
|
+
return mItemKind.Text;
|
|
141
|
+
case main.exports.CompletionItemKind.Method:
|
|
142
|
+
return mItemKind.Method;
|
|
143
|
+
case main.exports.CompletionItemKind.Function:
|
|
144
|
+
return mItemKind.Function;
|
|
145
|
+
case main.exports.CompletionItemKind.Constructor:
|
|
146
|
+
return mItemKind.Constructor;
|
|
147
|
+
case main.exports.CompletionItemKind.Field:
|
|
148
|
+
return mItemKind.Field;
|
|
149
|
+
case main.exports.CompletionItemKind.Variable:
|
|
150
|
+
return mItemKind.Variable;
|
|
151
|
+
case main.exports.CompletionItemKind.Class:
|
|
152
|
+
return mItemKind.Class;
|
|
153
|
+
case main.exports.CompletionItemKind.Interface:
|
|
154
|
+
return mItemKind.Interface;
|
|
155
|
+
case main.exports.CompletionItemKind.Module:
|
|
156
|
+
return mItemKind.Module;
|
|
157
|
+
case main.exports.CompletionItemKind.Property:
|
|
158
|
+
return mItemKind.Property;
|
|
159
|
+
case main.exports.CompletionItemKind.Unit:
|
|
160
|
+
return mItemKind.Unit;
|
|
161
|
+
case main.exports.CompletionItemKind.Value:
|
|
162
|
+
return mItemKind.Value;
|
|
163
|
+
case main.exports.CompletionItemKind.Enum:
|
|
164
|
+
return mItemKind.Enum;
|
|
165
|
+
case main.exports.CompletionItemKind.Keyword:
|
|
166
|
+
return mItemKind.Keyword;
|
|
167
|
+
case main.exports.CompletionItemKind.Snippet:
|
|
168
|
+
return mItemKind.Snippet;
|
|
169
|
+
case main.exports.CompletionItemKind.Color:
|
|
170
|
+
return mItemKind.Color;
|
|
171
|
+
case main.exports.CompletionItemKind.File:
|
|
172
|
+
return mItemKind.File;
|
|
173
|
+
case main.exports.CompletionItemKind.Reference:
|
|
174
|
+
return mItemKind.Reference;
|
|
175
|
+
case main.exports.CompletionItemKind.Folder:
|
|
176
|
+
return mItemKind.Folder;
|
|
177
|
+
case main.exports.CompletionItemKind.EnumMember:
|
|
178
|
+
return mItemKind.EnumMember;
|
|
179
|
+
case main.exports.CompletionItemKind.Constant:
|
|
180
|
+
return mItemKind.Constant;
|
|
181
|
+
case main.exports.CompletionItemKind.Struct:
|
|
182
|
+
return mItemKind.Struct;
|
|
183
|
+
case main.exports.CompletionItemKind.Event:
|
|
184
|
+
return mItemKind.Event;
|
|
185
|
+
case main.exports.CompletionItemKind.Operator:
|
|
186
|
+
return mItemKind.Operator;
|
|
187
|
+
case main.exports.CompletionItemKind.TypeParameter:
|
|
188
|
+
return mItemKind.TypeParameter;
|
|
189
|
+
default:
|
|
190
|
+
return mItemKind.Property;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
class CompletionProvider {
|
|
194
|
+
constructor(_worker, _defaults) {
|
|
195
|
+
this._worker = _worker;
|
|
196
|
+
this._defaults = _defaults;
|
|
197
|
+
this.triggerCharacters = [".", "("];
|
|
198
|
+
}
|
|
199
|
+
async provideCompletionItems(model, position) {
|
|
200
|
+
const worker = await this._worker(model.uri);
|
|
201
|
+
const context = this._defaults.getApiContextForModel(model.uri);
|
|
202
|
+
const completionList = await worker.doComplete(model.uri.toString(), fromPosition(position), context);
|
|
203
|
+
const wordInfo = model.getWordUntilPosition(position);
|
|
204
|
+
const wordRange = new Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn);
|
|
205
|
+
const items = completionList.items.map((entry) => {
|
|
206
|
+
const item = {
|
|
207
|
+
label: entry.label,
|
|
208
|
+
insertText: entry.insertText || entry.label,
|
|
209
|
+
sortText: entry.sortText,
|
|
210
|
+
filterText: entry.filterText,
|
|
211
|
+
detail: entry.detail,
|
|
212
|
+
range: wordRange,
|
|
213
|
+
kind: toCompletionItemKind(entry.kind),
|
|
214
|
+
};
|
|
215
|
+
if (entry.textEdit) {
|
|
216
|
+
if (isInsertReplaceEdit(entry.textEdit)) {
|
|
217
|
+
item.range = {
|
|
218
|
+
insert: toRange(entry.textEdit.insert),
|
|
219
|
+
replace: toRange(entry.textEdit.replace),
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
item.range = toRange(entry.textEdit.range);
|
|
224
|
+
}
|
|
225
|
+
item.insertText = entry.textEdit.newText;
|
|
226
|
+
}
|
|
227
|
+
if (entry.additionalTextEdits) {
|
|
228
|
+
item.additionalTextEdits = entry.additionalTextEdits.map(toTextEdit);
|
|
229
|
+
}
|
|
230
|
+
if (entry.insertTextFormat === main.exports.InsertTextFormat.Snippet) {
|
|
231
|
+
item.insertTextRules = languages.CompletionItemInsertTextRule.InsertAsSnippet;
|
|
232
|
+
}
|
|
233
|
+
if (entry.documentation) {
|
|
234
|
+
if (typeof entry.documentation === "string") {
|
|
235
|
+
item.documentation = entry.documentation;
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
item.documentation = {
|
|
239
|
+
supportThemeIcons: false,
|
|
240
|
+
value: entry.documentation.value,
|
|
241
|
+
supportHtml: true,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return item;
|
|
246
|
+
});
|
|
247
|
+
return {
|
|
248
|
+
incomplete: completionList.isIncomplete,
|
|
249
|
+
suggestions: items,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
//#endregion
|
|
254
|
+
//#region Formatter
|
|
255
|
+
class FormattingProvider {
|
|
256
|
+
constructor(_worker, _defaults) {
|
|
257
|
+
this._worker = _worker;
|
|
258
|
+
this._defaults = _defaults;
|
|
259
|
+
}
|
|
260
|
+
async provideDocumentFormattingEdits(model) {
|
|
261
|
+
const worker = await this._worker(model.uri);
|
|
262
|
+
const context = this._defaults.getApiContextForModel(model.uri.toString());
|
|
263
|
+
const edits = await worker.doFormat(model.uri.toString(), context);
|
|
264
|
+
return edits.map((e) => ({ range: toRange(e.range), text: e.newText }));
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
//#endregion
|
|
268
|
+
|
|
269
|
+
export { CompletionProvider as C, DiagnosticsAdapter as D, FormattingProvider as F, toCompletionItemKind as t };
|
|
@@ -1,10 +1,11 @@
|
|
|
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.7
|
|
5
5
|
*/
|
|
6
|
-
import { F as main, e as editor,
|
|
7
|
-
import './
|
|
6
|
+
import { F as main, e as editor, u as languages, J as Emitter } from './language-defaults-base-bb09da9f.js';
|
|
7
|
+
import { C as CompletionProvider, F as FormattingProvider, D as DiagnosticsAdapter } from './arcade-language-features-09dbac1a.js';
|
|
8
|
+
import './index-79a2905d.js';
|
|
8
9
|
|
|
9
10
|
var V={False:"false",Null:"null",True:"true"},f={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"},Ee=["++","--"],Je=["-","+","!","~"],Qe=["=","/=","*=","%=","+=","-="],Ze=["||","&&"],Lt=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"];var U=[[],[],[]];Ee.forEach(t=>U[t.length-1]?.push(t));Je.forEach(t=>U[t.length-1]?.push(t));Ze.forEach(t=>U[t.length-1]?.push(t));Qe.forEach(t=>U[t.length-1]?.push(t));Lt.forEach(t=>U[t.length-1]?.push(t));var ft=Object.values(f),gt=Object.values(V);gt.map(t=>({label:t,kind:main.exports.CompletionItemKind.Constant}));ft.map(t=>({label:t,kind:main.exports.CompletionItemKind.Keyword}));
|
|
10
11
|
|
|
@@ -216,266 +217,6 @@ const arcadeMonarchLanguage = {
|
|
|
216
217
|
},
|
|
217
218
|
};
|
|
218
219
|
|
|
219
|
-
//#region Diagnostic
|
|
220
|
-
class DiagnosticsAdapter {
|
|
221
|
-
constructor(_languageId, _worker, { defaults, diagnosticsService, }) {
|
|
222
|
-
this._languageId = _languageId;
|
|
223
|
-
this._worker = _worker;
|
|
224
|
-
this._disposables = [];
|
|
225
|
-
this._listener = new Map();
|
|
226
|
-
this._diagnosticsService = diagnosticsService;
|
|
227
|
-
this._defaults = defaults;
|
|
228
|
-
const onModelAdd = (model) => {
|
|
229
|
-
const languageId = model.getLanguageId();
|
|
230
|
-
if (languageId !== this._languageId) {
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
const debouncedValidate = debounce(() => {
|
|
234
|
-
this._doValidate(model, languageId).catch((err) => {
|
|
235
|
-
throw err;
|
|
236
|
-
});
|
|
237
|
-
});
|
|
238
|
-
this._listener.set(model.uri.toString(), model.onDidChangeContent(debouncedValidate));
|
|
239
|
-
this._doValidate(model, languageId).catch(console.error);
|
|
240
|
-
};
|
|
241
|
-
const onModelRemoved = (model) => {
|
|
242
|
-
const uriStr = model.uri.toString();
|
|
243
|
-
editor.setModelMarkers(model, this._languageId, []);
|
|
244
|
-
const listener = this._listener.get(uriStr);
|
|
245
|
-
if (listener) {
|
|
246
|
-
listener.dispose();
|
|
247
|
-
this._listener.delete(uriStr);
|
|
248
|
-
}
|
|
249
|
-
};
|
|
250
|
-
this._disposables.push(editor.onDidCreateModel(onModelAdd));
|
|
251
|
-
this._disposables.push(editor.onWillDisposeModel((model) => {
|
|
252
|
-
onModelRemoved(model);
|
|
253
|
-
}));
|
|
254
|
-
this._disposables.push(editor.onDidChangeModelLanguage((event) => {
|
|
255
|
-
onModelRemoved(event.model);
|
|
256
|
-
onModelAdd(event.model);
|
|
257
|
-
}));
|
|
258
|
-
this._disposables.push(defaults.onDidChange(() => {
|
|
259
|
-
editor.getModels().forEach((model) => {
|
|
260
|
-
if (model.getLanguageId() === this._languageId) {
|
|
261
|
-
onModelRemoved(model);
|
|
262
|
-
onModelAdd(model);
|
|
263
|
-
}
|
|
264
|
-
});
|
|
265
|
-
}));
|
|
266
|
-
this._disposables.push(defaults.onModelContextDidChange((key) => {
|
|
267
|
-
editor.getModels().forEach((model) => {
|
|
268
|
-
if (model.getLanguageId() === this._languageId && model.uri.toString() === key) {
|
|
269
|
-
this._doValidate(model, this._languageId).catch(console.error);
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
}));
|
|
273
|
-
this._disposables.push({
|
|
274
|
-
dispose: () => {
|
|
275
|
-
this._listener.forEach((value) => value.dispose());
|
|
276
|
-
this._listener.clear();
|
|
277
|
-
},
|
|
278
|
-
});
|
|
279
|
-
editor.getModels().forEach(onModelAdd);
|
|
280
|
-
}
|
|
281
|
-
dispose() {
|
|
282
|
-
this._disposables.forEach((d) => d.dispose());
|
|
283
|
-
this._disposables = [];
|
|
284
|
-
}
|
|
285
|
-
async _doValidate(model, languageId) {
|
|
286
|
-
if (!model.isAttachedToEditor()) {
|
|
287
|
-
return;
|
|
288
|
-
}
|
|
289
|
-
try {
|
|
290
|
-
const workerProxy = await this._worker(model.uri);
|
|
291
|
-
const context = this._defaults.getApiContextForModel(model.uri);
|
|
292
|
-
const diagnostics = await workerProxy.doValidation(model.uri.toString(), context);
|
|
293
|
-
const markers = diagnostics.map((d) => toMarker(model.uri, d));
|
|
294
|
-
this._diagnosticsService.fireDiagnosticsChange(model.uri, diagnostics);
|
|
295
|
-
editor.setModelMarkers(model, languageId, markers);
|
|
296
|
-
}
|
|
297
|
-
catch (err) {
|
|
298
|
-
console.error(err);
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
function toSeverity(languageServiceSeverity) {
|
|
303
|
-
switch (languageServiceSeverity) {
|
|
304
|
-
case main.exports.DiagnosticSeverity.Error:
|
|
305
|
-
return MarkerSeverity.Error;
|
|
306
|
-
case main.exports.DiagnosticSeverity.Warning:
|
|
307
|
-
return MarkerSeverity.Warning;
|
|
308
|
-
case main.exports.DiagnosticSeverity.Information:
|
|
309
|
-
return MarkerSeverity.Info;
|
|
310
|
-
case main.exports.DiagnosticSeverity.Hint:
|
|
311
|
-
return MarkerSeverity.Hint;
|
|
312
|
-
default:
|
|
313
|
-
return MarkerSeverity.Info;
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
function toMarker(_resource, diag) {
|
|
317
|
-
// Diagnostics positions are zero-based, MarkerData are 1-based
|
|
318
|
-
return {
|
|
319
|
-
severity: toSeverity(diag.severity),
|
|
320
|
-
startLineNumber: diag.range.start.line + 1,
|
|
321
|
-
startColumn: diag.range.start.character + 1,
|
|
322
|
-
endLineNumber: diag.range.end.line + 1,
|
|
323
|
-
endColumn: diag.range.end.character + 1,
|
|
324
|
-
message: diag.message,
|
|
325
|
-
};
|
|
326
|
-
}
|
|
327
|
-
//#endregion
|
|
328
|
-
//#region Completion
|
|
329
|
-
function fromPosition(position) {
|
|
330
|
-
// Language service is zero based
|
|
331
|
-
return { character: position.column - 1, line: position.lineNumber - 1 };
|
|
332
|
-
}
|
|
333
|
-
function toRange(range) {
|
|
334
|
-
return new Range(range.start.line + 1, range.start.character + 1, range.end.line + 1, range.end.character + 1);
|
|
335
|
-
}
|
|
336
|
-
function toTextEdit(textEdit) {
|
|
337
|
-
return {
|
|
338
|
-
range: toRange(textEdit.range),
|
|
339
|
-
text: textEdit.newText,
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
function isInsertReplaceEdit(edit) {
|
|
343
|
-
return (typeof edit.insert !== "undefined" &&
|
|
344
|
-
typeof edit.replace !== "undefined");
|
|
345
|
-
}
|
|
346
|
-
function toCompletionItemKind(kind) {
|
|
347
|
-
const mItemKind = languages.CompletionItemKind;
|
|
348
|
-
switch (kind) {
|
|
349
|
-
case main.exports.CompletionItemKind.Text:
|
|
350
|
-
return mItemKind.Text;
|
|
351
|
-
case main.exports.CompletionItemKind.Method:
|
|
352
|
-
return mItemKind.Method;
|
|
353
|
-
case main.exports.CompletionItemKind.Function:
|
|
354
|
-
return mItemKind.Function;
|
|
355
|
-
case main.exports.CompletionItemKind.Constructor:
|
|
356
|
-
return mItemKind.Constructor;
|
|
357
|
-
case main.exports.CompletionItemKind.Field:
|
|
358
|
-
return mItemKind.Field;
|
|
359
|
-
case main.exports.CompletionItemKind.Variable:
|
|
360
|
-
return mItemKind.Variable;
|
|
361
|
-
case main.exports.CompletionItemKind.Class:
|
|
362
|
-
return mItemKind.Class;
|
|
363
|
-
case main.exports.CompletionItemKind.Interface:
|
|
364
|
-
return mItemKind.Interface;
|
|
365
|
-
case main.exports.CompletionItemKind.Module:
|
|
366
|
-
return mItemKind.Module;
|
|
367
|
-
case main.exports.CompletionItemKind.Property:
|
|
368
|
-
return mItemKind.Property;
|
|
369
|
-
case main.exports.CompletionItemKind.Unit:
|
|
370
|
-
return mItemKind.Unit;
|
|
371
|
-
case main.exports.CompletionItemKind.Value:
|
|
372
|
-
return mItemKind.Value;
|
|
373
|
-
case main.exports.CompletionItemKind.Enum:
|
|
374
|
-
return mItemKind.Enum;
|
|
375
|
-
case main.exports.CompletionItemKind.Keyword:
|
|
376
|
-
return mItemKind.Keyword;
|
|
377
|
-
case main.exports.CompletionItemKind.Snippet:
|
|
378
|
-
return mItemKind.Snippet;
|
|
379
|
-
case main.exports.CompletionItemKind.Color:
|
|
380
|
-
return mItemKind.Color;
|
|
381
|
-
case main.exports.CompletionItemKind.File:
|
|
382
|
-
return mItemKind.File;
|
|
383
|
-
case main.exports.CompletionItemKind.Reference:
|
|
384
|
-
return mItemKind.Reference;
|
|
385
|
-
case main.exports.CompletionItemKind.Folder:
|
|
386
|
-
return mItemKind.Folder;
|
|
387
|
-
case main.exports.CompletionItemKind.EnumMember:
|
|
388
|
-
return mItemKind.EnumMember;
|
|
389
|
-
case main.exports.CompletionItemKind.Constant:
|
|
390
|
-
return mItemKind.Constant;
|
|
391
|
-
case main.exports.CompletionItemKind.Struct:
|
|
392
|
-
return mItemKind.Struct;
|
|
393
|
-
case main.exports.CompletionItemKind.Event:
|
|
394
|
-
return mItemKind.Event;
|
|
395
|
-
case main.exports.CompletionItemKind.Operator:
|
|
396
|
-
return mItemKind.Operator;
|
|
397
|
-
case main.exports.CompletionItemKind.TypeParameter:
|
|
398
|
-
return mItemKind.TypeParameter;
|
|
399
|
-
default:
|
|
400
|
-
return mItemKind.Property;
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
class CompletionProvider {
|
|
404
|
-
constructor(_worker, _defaults) {
|
|
405
|
-
this._worker = _worker;
|
|
406
|
-
this._defaults = _defaults;
|
|
407
|
-
this.triggerCharacters = [".", "("];
|
|
408
|
-
}
|
|
409
|
-
async provideCompletionItems(model, position) {
|
|
410
|
-
const worker = await this._worker(model.uri);
|
|
411
|
-
const context = this._defaults.getApiContextForModel(model.uri);
|
|
412
|
-
const completionList = await worker.doComplete(model.uri.toString(), fromPosition(position), context);
|
|
413
|
-
const wordInfo = model.getWordUntilPosition(position);
|
|
414
|
-
const wordRange = new Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn);
|
|
415
|
-
const items = completionList.items.map((entry) => {
|
|
416
|
-
const item = {
|
|
417
|
-
label: entry.label,
|
|
418
|
-
insertText: entry.insertText || entry.label,
|
|
419
|
-
sortText: entry.sortText,
|
|
420
|
-
filterText: entry.filterText,
|
|
421
|
-
detail: entry.detail,
|
|
422
|
-
range: wordRange,
|
|
423
|
-
kind: toCompletionItemKind(entry.kind),
|
|
424
|
-
};
|
|
425
|
-
if (entry.textEdit) {
|
|
426
|
-
if (isInsertReplaceEdit(entry.textEdit)) {
|
|
427
|
-
item.range = {
|
|
428
|
-
insert: toRange(entry.textEdit.insert),
|
|
429
|
-
replace: toRange(entry.textEdit.replace),
|
|
430
|
-
};
|
|
431
|
-
}
|
|
432
|
-
else {
|
|
433
|
-
item.range = toRange(entry.textEdit.range);
|
|
434
|
-
}
|
|
435
|
-
item.insertText = entry.textEdit.newText;
|
|
436
|
-
}
|
|
437
|
-
if (entry.additionalTextEdits) {
|
|
438
|
-
item.additionalTextEdits = entry.additionalTextEdits.map(toTextEdit);
|
|
439
|
-
}
|
|
440
|
-
if (entry.insertTextFormat === main.exports.InsertTextFormat.Snippet) {
|
|
441
|
-
item.insertTextRules = languages.CompletionItemInsertTextRule.InsertAsSnippet;
|
|
442
|
-
}
|
|
443
|
-
if (entry.documentation) {
|
|
444
|
-
if (typeof entry.documentation === "string") {
|
|
445
|
-
item.documentation = entry.documentation;
|
|
446
|
-
}
|
|
447
|
-
else {
|
|
448
|
-
item.documentation = {
|
|
449
|
-
supportThemeIcons: false,
|
|
450
|
-
value: entry.documentation.value,
|
|
451
|
-
supportHtml: true,
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
return item;
|
|
456
|
-
});
|
|
457
|
-
return {
|
|
458
|
-
incomplete: completionList.isIncomplete,
|
|
459
|
-
suggestions: items,
|
|
460
|
-
};
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
//#endregion
|
|
464
|
-
//#region Formatter
|
|
465
|
-
class FormattingProvider {
|
|
466
|
-
constructor(_worker, _defaults) {
|
|
467
|
-
this._worker = _worker;
|
|
468
|
-
this._defaults = _defaults;
|
|
469
|
-
}
|
|
470
|
-
async provideDocumentFormattingEdits(model) {
|
|
471
|
-
const worker = await this._worker(model.uri);
|
|
472
|
-
const context = this._defaults.getApiContextForModel(model.uri.toString());
|
|
473
|
-
const edits = await worker.doFormat(model.uri.toString(), context);
|
|
474
|
-
return edits.map((e) => ({ range: toRange(e.range), text: e.newText }));
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
//#endregion
|
|
478
|
-
|
|
479
220
|
/**
|
|
480
221
|
* Manager to create our arcade worker and client proxy
|
|
481
222
|
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
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.7
|
|
5
5
|
*/
|
|
6
|
-
import { g as getAssetPath, r as registerInstance, c as createEvent, h, F as Fragment, H as Host, a as getElement } from './index-
|
|
7
|
-
import { a as importArcade, e as editor, s as startLocaleObserver, g as getElementLocales, b as isURL, h as hasSameOrigin, d as importRequest, D as Deferred, j as generateGuid, k as getElementTheme, K as KeyCode, l as setValuesInString, q as quoteString, m as supportedFields, n as generateTokensCSSForColorMap, S as StandaloneServices, I as IStandaloneThemeService, o as commonjsGlobal, p as setFocusOnElement, r as filterCollection, t as createFilterExpression, u as languages, R as Range, v as observeAncestorsMutation, U as Uri, w as KeyMod, x as addLTRMark } from './language-defaults-base-
|
|
8
|
-
import { m as makeController, w as watch, u as useControllerManager, g as getSet, s as sqlExprDefaults } from './sql-expr-defaults-
|
|
9
|
-
import { b as arcadeDefaults, g as getArcadeDiagnosticService, c as getMode$1 } from './arcade-defaults-
|
|
6
|
+
import { g as getAssetPath, r as registerInstance, c as createEvent, h, F as Fragment, H as Host, a as getElement } from './index-79a2905d.js';
|
|
7
|
+
import { a as importArcade, e as editor, s as startLocaleObserver, g as getElementLocales, b as isURL, h as hasSameOrigin, d as importRequest, D as Deferred, j as generateGuid, k as getElementTheme, K as KeyCode, l as setValuesInString, q as quoteString, m as supportedFields, n as generateTokensCSSForColorMap, S as StandaloneServices, I as IStandaloneThemeService, o as commonjsGlobal, p as setFocusOnElement, r as filterCollection, t as createFilterExpression, u as languages, R as Range, v as observeAncestorsMutation, U as Uri, w as KeyMod, x as addLTRMark } from './language-defaults-base-bb09da9f.js';
|
|
8
|
+
import { m as makeController, w as watch, u as useControllerManager, g as getSet, s as sqlExprDefaults } from './sql-expr-defaults-1aedce82.js';
|
|
9
|
+
import { b as arcadeDefaults, g as getArcadeDiagnosticService, c as getMode$1 } from './arcade-defaults-3b370e7f.js';
|
|
10
10
|
|
|
11
11
|
const DevelopersWebSitePath = "https://developers.arcgis.com/arcade/";
|
|
12
12
|
const MaxArrayItems = 100;
|
|
@@ -4188,7 +4188,7 @@ languages.onLanguage(arcadeDefaults.languageId, () => {
|
|
|
4188
4188
|
* @returns sql-expression mode module
|
|
4189
4189
|
*/
|
|
4190
4190
|
async function getMode() {
|
|
4191
|
-
return await import('./sql-expr-mode-
|
|
4191
|
+
return await import('./sql-expr-mode-3c0c4ee2.js');
|
|
4192
4192
|
}
|
|
4193
4193
|
// Register the language in Monaco
|
|
4194
4194
|
languages.register({
|
|
@@ -1,11 +1,11 @@
|
|
|
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.7
|
|
5
5
|
*/
|
|
6
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
7
|
-
export { s as setNonce } from './index-
|
|
8
|
-
import { g as globalScripts } from './app-globals-
|
|
6
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-79a2905d.js';
|
|
7
|
+
export { s as setNonce } from './index-79a2905d.js';
|
|
8
|
+
import { g as globalScripts } from './app-globals-9b568679.js';
|
|
9
9
|
|
|
10
10
|
/*
|
|
11
11
|
Stencil Client Patch Browser v4.17.1 | MIT Licensed | https://stenciljs.com
|