Sanity check notification when incorrectly accessing Array length in JS

Issue #2201 closed
Matthew Chevalier created an issue

I’m ashamed to say how much time I waste debugging issues that are just a result of me calling .size() instead of length on arrays in js.

A notification/popup from IC that says “hey did you mean length, because you’re not writing apex atm, your writing js”

or just the john cena “are you sure about that” gif would suffice

I know this is a silly small thing, but I honestly do waste a lot of time with it and would love a little nudge when my brain forgets I’m not writing apex anymore.

Comments (5)

  1. Scott Wells repo owner

    Matthew, if you’re using a commercial JetBrains IDE with IC2 and are applying best practices for strong data types to facilitate type inference by the IDE, it should already tell you that those are invalid, e.g.:

    In that case I’ve used a doc-based type hint on the variable declaration. IC2 even includes a code intention to help add such type hints when missing:

    Does that not resolve the issue for you?

  2. Scott Wells repo owner

    I'm going to resolve this assuming that the information provided here...which builds upon the native smarts of a base commercial JetBrains IDE...addresses the issue for you.

  3. Log in to comment