I use PHPStorm (same as WebStorm) for SS2. How can...
# sdf
c
I use PHPStorm (same as WebStorm) for SS2. How can I get code completion and code highlighting to be accurate? For example, I want code completion to work only for functions that are actually available (based on what is globally available and what I have made available in my define statement).
a
Unfortunately we don't have a good solution yet. We are aware of it and working on improving code completion capabilities
s
I recommend using NFT for better completion and strong-types for NS record and search access. If not that, at least try
npm install  @hitc/netsuite-types
c
I think NFT requires me to use TypeScript and I haven't got round to that yet, plus (if I understand NFT correctly) I am reluctant to use the SS API via a layer of abstraction because that layer is likely to be documented far less well than SS itself.
Perhaps I'm misunderstanding NFT. It does appeal to me
Regarding the npm command: I don't use Node.js, since it isn't supported by NS. Please tell me if I'm missing the point
I really do want to use TypeScript and only free time between projects is preventing me from learning how to use it
s
The layer is quite thin really - it's really no different from any other code you've probably already written, perhaps many times in different ways that work with NS. It's just something that makes working with NS easier and (importantly) more consistent looking code between scripts or devs. You don't have to use TS to use NFT but I strongly encourage it (due to the benefits of the strong typing). the 'strong typing' is more useful for NS development than other systems because of the more tedious dev/debug cylce where we have to upload code to actually test it.
npm
is just a package manager. It's how most web devs (on any platform) manage shared libraries. using
npm
doesn't imply writing NodeJS code or anything like that. It's just a way to get your libraries (e.g. NFT, lodash, etc.)
c
Thanks for such detailed explanations. I've used JS since 2001 but never for any more than the odd script until meeting NS and I'm new to the JS ecosystem. I come mainly from Delphi and then C# so TypeScript is attractive to me
s
fortunately, JS has come a long way since 2001!
I used to point and laugh at JS, but the ecosystem has matured significantly since then (TS included)
c
First impressions are long lasting and only in the last few years have I realised that JS is now more than just for fancy website functionality
a
If you are coming to SuiteWorld, don't miss this session https://events.rainfocus.com/widget/oracle/sw19/catalogsw19?leadsource=undefined&search=SDF%20and%20Dev%20Tools%20Unite You may see some stuff related to TypeScript 😎
c
I went five years ago but I've got too much work to do now!
s
I wish NS would just adopt NFT, or at least TypeScript as their official language - I've said for years it would give them some competitive advantage over SFDC Apex, since TS is strongly typed and an open-source language (not to mention vastly more popular than Apex)
I won't be attending SuiteWorld but would love to hear that NS is adopting TS tomorrow!
@cja agreed! I come from a long (decades) history of C-like languages and thought all JS was good for was irritating blinky text on a web page. Things have come a long way since those days.
the ironic thing is with TypeScript, we have a somewhat Scala-like combination of strong typing and support for a hybrid OO/Functional programming capability. I oft refer to TypeScript as my 'poor man's' Scala
c
I tried Node.js years ago when it came out and thought "what's the point in a single-threaded server" but it is apparent that mine was a minority view :)
Compared to what I could do in Delphi, Node.js seemed like a toy, but perhaps that's why it's now so popular
s
I have an old friend that was (is?) a Pascal fan
I went the C++ route so my Delphi was C++ Builder 🙂
c
There are some things you can do in Borland Pascal from 2001 that you still can't do in C#, but overall I'm glad I escaped Delphi for the modern world
And so, to conclude, I will try TS and NFT at my earliest opportunity
👍 1