# Coming in 8.1.18: Script editor improvements

**URL:** <https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629>\
**Category:** Ignition\
**Created:** [May 16, 2022, 6:39pm UTC](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629 "2022-05-16T18:39:17Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 1, 2022, 8:52pm UTC](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629/42 "2022-07-01T20:52:21Z")

</div>

> [@bschroeder](#):
>
> On prior script editors, the opening parentheses, curly braces, brackets etc… are highlighted when you are one the closing of the same. However in 8.1.18 it doesn’t seem to be doing that.

This is fixed for 8.1.19/the next nightly build.

> [@pascal.fragnoud](#):
>
> But the first frustration came very quicky:  
> start typing `"{}".format`…

This is "fixed" for 8.1.19/the next nightly; you will no longer get an incorrect autocompletion for the (builtin) `format` method that looks like it's a string instance autocompletion. You will _not_ get string instance autocompletion, unfortunately, but smarter 'local' autocompletion is probably the next item I'd like to address.

> [@bschroeder](#):
>
> When opening up a scripts that is quite long… the right hand side where there are normally all the functions created by the script is blank. This is super annoying.

The inner problem that causes this is now caught, so if the fold parsing logic breaks, you won't get any folds, but everything else will still work. A fix for the fold parsing logic will hopefully come soon.

> [@bkarabinchak.psi](#):
>
> assume (hope) this functionality extends when I am writing a script on a button `onAction`?

And yes, project library autocompletion throughout the designer.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/3/c3e149a7f8abe5641fc0bbc7435b5743f627ca4c.jpeg)

As a small bonus convenience feature, we also added an option to select which hint scope to provide for autocompletion while authoring project library scripts:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/e/7eb45a0517e6a1f67227d153f25fa88cf0b84d5a.png)  
This setting will persist with your script library, but does _not_ affect actual execution in any way; it's just a convenience to help with script authoring.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 1, 2022, 11:19pm UTC](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629/43 "2022-07-01T23:19:35Z")

</div>

> [@paul-griffith](#):
>
> As a small bonus convenience feature, we also added an option to select which hint scope to provide for autocompletion while authoring project library scripts

What would be really awesome is if you had some type of option to make the script console _execute_ in gateway scope.

Barring that any chance we could get this same option on the script console?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 5, 2022, 4:45pm UTC](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629/44 "2022-07-05T16:45:47Z")

</div>

I have an immediate knee-jerk aversion to that (since it’s essentially `exec`, but in the context of your gateway), but at the same time, it’s not appreciably different/more risky from what you can already do in the designer (e.g. Perspective, gateway event scripts, tag event scripts), so I can’t really articulate a good reason not to do it 🙂. I do worry that it will only further confuse some folks, since Ignition’s split scripting environments are already a bit of a nightmare, but it may be something to consider.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 5, 2022, 4:48pm UTC](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629/45 "2022-07-05T16:48:46Z")

</div>

> [@paul-griffith](#):
>
> I have an immediate knee-jerk aversion to that

With you. Don't do it.

Gateway message handlers can be used to perform such testing, but require understanding of what executes where. That is a clear win, I think. If one doesn't understand the scope model, one cannot easily do damage in the gateway.

---

<div class="post-metadata">

**Author:** ![ryanjmclaughlin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryanjmclaughlin/32/4318_2.png) [@ryanjmclaughlin](https://forum.inductiveautomation.com/u/ryanjmclaughlin)\
**Post date:** [July 5, 2022, 5:03pm UTC](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629/46 "2022-07-05T17:03:54Z")

</div>

> [@paul-griffith](#):
>
> it’s not appreciably different/more risky from what you can already do in the designer (e.g. Perspective, gateway event scripts, tag event scripts)

This would be my exact use case, debugging/developing gateway event scripts. The gateway context is running under a different service account and has access to differing LANs, currently debugging of these scripts can be difficult in some cases as it takes some extra work to setup properly to run them the same way they would execute in the gateway script. It _can_ be done today, but it could be easier.

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [July 6, 2022, 12:48pm UTC](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629/47 "2022-07-06T12:48:20Z")

</div>

What about having a set of “Required Designer Roles” for gateway scope execution?

---

<div class="post-metadata">

**Author:** ![Bradley\_Phillips](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@Bradley\_Phillips](https://forum.inductiveautomation.com/u/Bradley_Phillips)\
**Post date:** [July 7, 2022, 5:28am UTC](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629/48 "2022-07-07T05:28:35Z")

</div>

> **[PEP 484 – Type Hints | peps.python.org](https://peps.python.org/pep-0484/#stub-files)**
>
> Python Enhancement Proposals (PEPs)

---

<div class="post-metadata">

**Author:** ![Bradley\_Phillips](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@Bradley\_Phillips](https://forum.inductiveautomation.com/u/Bradley_Phillips)\
**Post date:** [July 7, 2022, 5:34am UTC](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629/49 "2022-07-07T05:34:29Z")

</div>

This is awesome!!

IMO, so much work would be required to reach the featureset and quality of something like VSCode, and VSCode already exists and is free to use.

The work that César Román has done in his repository could be coupled with VSCode as the ‘standard’ for scripting in IA.

Then the development and maintenance of the inbuilt IDE is no longer required. Freeing up resources to work on other bugs and features.

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [July 7, 2022, 10:12am UTC](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629/50 "2022-07-07T10:12:22Z")

</div>

@paul-griffith,

New release for the script editor in 8.1.19 nightly is really awesome ! 🤩

A few minor possible improvements:

- functions inside a script are not available for autocompletion if you don’t add the package name.
- an option to sort the function list in alphabetic order or the file order.
- some keyboard shortcut for Find Previous/Find Next
- right mouse click on function to generate docstrings
- blue mark for # TODO: IntelliJ like 😉

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 8, 2022, 3:21pm UTC](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629/51 "2022-07-08T15:21:33Z")

</div>

> [@Bradley\_Phillips](#):
>
> IMO, so much work would be required to reach the featureset and quality of something like VSCode, and VSCode already exists and is free to use.
> 
> The work that César Román has done in his repository could be coupled with VSCode as the ‘standard’ for scripting in IA.

Reaching parity with VSCode is definitely not a goal (nor is it feasible, for obvious reasons). However, bundling VSCode is also not feasible. I _would_ like to see a system in the future where external code editors are supported, but making the core product better is an obviously good step in the short term.

> [@mazeyrat](#):
>
> functions inside a script are not available for autocompletion if you don’t add the package name.

Yes, there's still no true AST parsing of the file you're currently editing (because it's a hard problem, since you could have any number of syntax errors). With project library stuff, it's relatively easy to consume, because in the vast majority of cases a project lib file you're not actively editing will be valid code. This is something I'm planning to work on, but no timeline; that would be the next big leap in capability for the script editing system.

---

<div class="post-metadata">

**Author:** ![Alex\_Taylor](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@Alex\_Taylor](https://forum.inductiveautomation.com/u/Alex_Taylor)\
**Post date:** [July 12, 2022, 6:14pm UTC](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629/52 "2022-07-12T18:14:01Z")

</div>

There’s a lot to like about the inline search feature in 2.1.18, but I’ve run into a couple of issues with it.

First, F3 no longer seems to work as a “repeat search” command. The ability to do this with a single keypress rather than hunt for and click the little down-chevron is much missed.

Second, it would be nice if performing the search would put input focus back into the editor, rather than leaving it in the search field. I also haven’t found a way to move focus back without using the mouse.

---

<div class="post-metadata">

**Author:** ![rbachman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rbachman/32/43718_2.png) [@rbachman](https://forum.inductiveautomation.com/u/rbachman)\
**Post date:** [July 12, 2022, 9:30pm UTC](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629/53 "2022-07-12T21:30:28Z")

</div>

I have discovered a little bit of a workaround to the issue with the missing functions on the right side of the Designer. When you open a script, if you do a **Ctrl+A** to select everything and then **Ctrl+/** to comment out everything, the functions all appear on the right hand side after about 1 second. Then just hit **Ctrl+/** again to uncomment everything, and the functions are still visible on the right side.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 26, 2022, 4:54am UTC](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629/54 "2022-07-26T04:54:37Z")

</div>

> [@paul-griffith](#):
>
> Coming soon…

Just wondering about this one (project class/function 'intellisense') so that I can prepare for when this is out. This might be obvious to someone from a software dev background, but for us other plebs...  
What is the best structure to follow in the doc strings to document library functions & classes so that it will work nicely with this functionality?

Some specific questions:

1. how should I document the return value?
2. how should I document the arguments of a function?

The PEP standards don't seem to cover this... unless I've just missed it?

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [July 26, 2022, 12:28pm UTC](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629/55 "2022-07-26T12:28:49Z")

</div>

I tend to do what I think is googles style but an example of something that works currnetly in 8.1.3 in script console

```auto
def exampleFunc(someNum):
    """
    Some small description of what the function does here.
    Args:
        someNum: int, this gets a 1 added to it
    Returns:
        int, the param with a 1 added to it
    """
    return someNum + 1

```

This doc string method currently works in script console going even using 8.1.3 - an example from a current project (though black text on a dark background - any way to change this?)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/7/673a86049577d4f688aa3328c05cabd2f5b8b732.png)

I do believe python expects that if there’s triple quotes immediately right after function declaration that its expected to be the docstring of the function and hence why Ignition is able to pick this up even before all these very nice improvements. I expect it will stay the same way though perhaps they will also offer an alternative to the triple quote method immediately after a function declaration.

Some examples - [Example Google Style Python Docstrings — napoleon 0.7 documentation](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 1, 2022, 3:36pm UTC](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629/56 "2022-08-01T15:36:19Z")

</div>

_If_ I can get this working at some point in the future, the way to do proper type-hints would be the suggested syntax for PEP-484 in Python 2: [PEP 484 – Type Hints | peps.python.org](https://peps.python.org/pep-0484/#suggested-syntax-for-python-2-7-and-straddling-code)

In the meantime, yes, all this does is pick up the docstring (first string expression following a declaration). There’s some trickery involving class bodies and ` __init__ ` methods, but other than that it’s fairly straightforward.

---

<div class="post-metadata">

**Author:** ![Matthew.gaitan](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Matthew.gaitan](https://forum.inductiveautomation.com/u/Matthew.gaitan)\
**Post date:** [August 3, 2022, 4:43pm UTC](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629/57 "2022-08-03T16:43:21Z")

</div>

Maybe I’m missing something, but is there any way to easily add the `optional` method parameters when it auto completes?

I still have to go back and forth to see what optional parameters a method takes

---

<div class="post-metadata">

**Author:** ![cesrom](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@cesrom](https://forum.inductiveautomation.com/u/cesrom)\
**Post date:** [August 4, 2022, 7:40pm UTC](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629/58 "2022-08-04T19:40:41Z")

</div>

Here’s a feature request.

When we type `system.db.` we only get the list of functions. My request is to also list the constants.

Same for `system.gui`, `system.serial` constants, and all other I am not listing.

---

<div class="post-metadata">

**Author:** ![cesrom](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@cesrom](https://forum.inductiveautomation.com/u/cesrom)\
**Post date:** [August 4, 2022, 7:57pm UTC](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629/59 "2022-08-04T19:57:20Z")

</div>

And if I may.

What about `com.inductiveautomation.*` and other Java libraries?

Thanks again

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 4, 2022, 7:59pm UTC](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629/60 "2022-08-04T19:59:59Z")

</div>

> [@cesrom](#):
>
> When we type `system.db.` we only get the list of functions. My request is to also list the constants.

That's planned, but may have to wait for 8.2 for the sake of API compatibility for third party module authors.

> [@cesrom](#):
>
> What about `com.inductiveautomation.*` and other Java libraries?

At some point, local AST parsing might be able to use reflection to offer limited autocomplete for local Java libraries. It probably won't ever work across scope boundaries, so there won't be any hints offered if you're in a Perspective or other gateway scope.

---

<div class="post-metadata">

**Author:** ![cesrom](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@cesrom](https://forum.inductiveautomation.com/u/cesrom)\
**Post date:** [August 4, 2022, 9:03pm UTC](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629/61 "2022-08-04T21:03:32Z")

</div>

Of course for both of these scenarios one may use `ignition-api` (PyCharm and Visual Studio Code) and/or `ignition-api-stubs` ([PyCharm](https://www.jetbrains.com/help/pycharm/stubs.html#reuse-stubs)).

Both will provide autocompletion for the constants under `db`, `gui`, and `serial`, as well as some (not all) `com.inductiveautomation.*` classes and other supporting Java libraries.

Had I mentioned this before? 😝

[Previous page](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629.md?page=2)

[Next page](https://forum.inductiveautomation.com/t/coming-in-8-1-18-script-editor-improvements/59629.md?page=4)
