Sanity check notification when incorrectly accessing Array length in JS
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)
-
repo owner -
repo owner Quite a bit more info here, both the demo video and the linked release notes in the video description text for the various phases of improvement in this area (strongly-typed dev in JS/ES6/TS):
-
repo owner - changed status to resolved
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.
-
reporter Thankyou Scott!
-
reporter - changed status to closed
- Log in to comment
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?