Select to view content in your preferred language

Use IDE for writing Arcade expressions

3016
6
02-28-2022 01:35 PM
Bud
by
Esteemed Contributor

Do developers use an IDE when writing lengthy Arcade expressions? (specifically Calculation Attribute Rules)

Example:
https://github.com/Esri/arcade-expressions/blob/master/Industry/Gas/Calculation/Assembly-Generate_ID...

What's your workflow?
Do you write (and save) the script in an IDE, and then paste it into ArcGIS Pro to see if it runs?
Or something else?

Thanks.

6 Replies
Luke_Pinner
MVP Regular Contributor

I use Visual Studio Code with the language set to Javascript. Seems other users do too. Not ideal but ok for syntax highlighting. Any IDE that supports JS should work.

You can just copy/paste between VSCode and Pro, but you might be able to save in your IDE and load in Pro. I use Arcade for popup configs and save as a .lxp (Label Expression File (LXP)) which is plain text format in VSCode then import in the popup expression builder.  You might be able to do the same for attribute expressions.

jcarlson
MVP Esteemed Contributor

Agreed, I use VSCode for developing mine. Especially when working on Data Expressions in Dashboards, where you can't properly save your expression until it's returning a FeatureSet. I've toyed with the idea of making a language extension, but the standard JS settings work well enough. I would really like some intellisense popups, though.

- Josh Carlson
Kendall County GIS
MikeMillerGIS
Esri Frequent Contributor

I use pycharm, as I do mostly python development.  I typically save my arcade as .js files.  For the most part it works pretty good.  @PaulLeBlanc1  put together this syntax for arcade in n++ a while back.  Probably needs to be updated for some of the new methods.

 

JohannesLindner
MVP Frequent Contributor

I'm severely limited by IT restrictions. No chance to get an IDE or even Notepad++. I only have access to Python because it comes with ArcGIS, I can't get packages other than the ones that are preinstalled...

So, I use the expression window in ArcGIS Pro, even for really long expressions. It needs a button to maximize it, but else it's doable.


Have a great day!
Johannes
Bud
by
Esteemed Contributor

For what it's worth, I don't have admin privileges on my work computer either (Windows 10). Yet, I noticed that I could install VS Code without needing admin rights. The same applies to some SQL clients and even R.

I just thought I'd mention that.
At first, I assumed there'd be no way to get an IDE like VS Code without admin rights. But to my surprise, it worked.

0 Kudos
Bud
by
Esteemed Contributor

For software that requires admin privileges, I sometimes resort to using my home computer, on fake data. It's not great, but sometimes it's better than not having the software at all on my work computer.

0 Kudos