From 195659e6e0c3a3c2fbd391ce466baed15a10c027 Mon Sep 17 00:00:00 2001 From: Kristian Ekenes Date: Tue, 3 Dec 2024 22:35:18 -0800 Subject: [PATCH] enh(arcade) - update list of keywords, functions, and profile variables to match Arcade version 1.29 (#4181) --- CHANGES.md | 2 ++ src/languages/arcade.js | 13 ++++++++++++- test/markup/arcade/profile.expect.txt | 11 ++++++++++- test/markup/arcade/profile.txt | 11 ++++++++++- 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 745affddbf..6a3b2368a6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,7 @@ CAVEATS / POTENTIALLY BREAKING CHANGES Core Grammars: - fix(makefile) - allow strings inside `$()` expressions [aneesh98][] +- enh(arcade) updated to ArcGIS Arcade version 1.29 [Kristian Ekenes][] - enh(css) add all properties listed on MDN (96 additions including `anchor-name`, `aspect-ratio`, `backdrop-filter`, `container`, `margin-trim`, `place-content`, `scroll-timeline`, ...) [BaliBalo][] - enh(erlang) OTP 27 triple-quoted strings [nixxquality][] - enh(erlang) OTP 27 doc attribute [nixxquality][] @@ -87,6 +88,7 @@ CONTRIBUTORS [clsource]: https://github.com/clsource [Jake Leahy]: https://github.com/ire4ever1190 [Laurel King]: https://github.com/laurelthorburn +[Kristian Ekenes]: https://github.com/ekenes ## Version 11.10.0 diff --git a/src/languages/arcade.js b/src/languages/arcade.js index c7863467f5..f248dd8dfb 100644 --- a/src/languages/arcade.js +++ b/src/languages/arcade.js @@ -1,7 +1,6 @@ /* Language: ArcGIS Arcade Category: scripting - Author: John Foster Website: https://developers.arcgis.com/arcade/ Description: ArcGIS Arcade is an expression language used in many Esri ArcGIS products such as Pro, Online, Server, Runtime, JavaScript, and Python */ @@ -26,6 +25,7 @@ export default function(hljs) { "import", "in", "new", + "of", "return", "switch", "try", @@ -96,6 +96,7 @@ export default function(hljs) { "Disjoint", "Distance", "DistanceGeodetic", + "DistanceToCoordinate", "Distinct", "Domain", "DomainCode", @@ -107,6 +108,7 @@ export default function(hljs) { "Expects", "Extent", "Feature", + "FeatureInFilter", "FeatureSet", "FeatureSetByAssociation", "FeatureSetById", @@ -115,6 +117,7 @@ export default function(hljs) { "FeatureSetByRelationshipClass", "FeatureSetByRelationshipName", "Filter", + "FilterBySubtypeCode", "Find", "First|0", "Floor", @@ -149,6 +152,7 @@ export default function(hljs) { "IsNan", "IsSelfIntersecting", "IsSimple", + "KnowledgeGraphByPortalItem", "Left|0", "Length", "Length3D", @@ -158,6 +162,7 @@ export default function(hljs) { "Map", "Max", "Mean", + "MeasureToCoordinate", "Mid", "Millisecond", "Min", @@ -175,6 +180,7 @@ export default function(hljs) { "OrderBy", "Overlaps", "Point", + "PointToCoordinate", "Polygon", "Polyline", "Pop", @@ -182,6 +188,7 @@ export default function(hljs) { "Pow", "Proper", "Push", + "QueryGraph", "Random", "Reduce", "Relate", @@ -202,6 +209,7 @@ export default function(hljs) { "Splice", "Split", "Sqrt", + "StandardizeFilename", "StandardizeGuid", "Stdev", "SubtypeCode", @@ -264,6 +272,7 @@ export default function(hljs) { "feedfeature", "fencefeature", "fencenotificationtype", + "graph", "join", "layer", "locationupdate", @@ -281,7 +290,9 @@ export default function(hljs) { "targetdatastore", "targetfeature", "targetlayer", + "userInput", "value", + "variables", "view" ]; const SYMBOL = { diff --git a/test/markup/arcade/profile.expect.txt b/test/markup/arcade/profile.expect.txt index 111073ac8d..21c9a57b68 100644 --- a/test/markup/arcade/profile.expect.txt +++ b/test/markup/arcade/profile.expect.txt @@ -25,5 +25,14 @@ } n+=i; } +return n; -return n; \ No newline at end of file +var a = [2,4,6,8,10]; +var total = 0; +for (var v of a) { + total += v; +} + +var result = DistanceToCoordinate($userInput, 1038); + +return result.coordinate.x + total; \ No newline at end of file diff --git a/test/markup/arcade/profile.txt b/test/markup/arcade/profile.txt index d44f508f09..0a98bc783d 100644 --- a/test/markup/arcade/profile.txt +++ b/test/markup/arcade/profile.txt @@ -25,5 +25,14 @@ for(var i=1; i<100; i++) { } n+=i; } +return n; -return n; \ No newline at end of file +var a = [2,4,6,8,10]; +var total = 0; +for (var v of a) { + total += v; +} + +var result = DistanceToCoordinate($userInput, 1038); + +return result.coordinate.x + total; \ No newline at end of file