This project is read-only.

The relative importance of JavaScript autocomplete

May 18, 2014 at 4:31 PM
Hi, guys,

I thought I'd post something that's been bothering me a bit.

In recent weeks, quite a lot of activity and discussion has been around the JavaScript language service. It appears that it has been necessary to rewrite this component. That, obviously, is going to take up a lot of your resources at the expense of neglecting other pending features and bug fixes.

My question is: Is the JavaScript autocomplete even necessary?

Why not encourage people to use TypeScript?

With TypeScript one would get everything the JavaScript language service has to offer, plus static type checking, which incidentally is wholly optional.

With that out of the way, we would get more attention to the excellent value added by NTVS, such as
  • The unit testing framework.
  • The NPM UI.
  • Debugging.
  • Azure deployment.
Any thoughts on the matter?
May 30, 2014 at 11:15 PM
hi nabog,

the short answer is that as much as we love TS, we can't just force everyone to use it. JSLS, which NTVS relied on, was designed for much smaller chunks of code from pre node.js days. architecturally it's a lot of work for that team for make it scale (esp in the short term). this is why we bit the bullet & decided to write a "new" (it's based on PTVS's infrastructure) one.

that said, it's almost ready for unveiling and is looking pretty decent. we had to prioritize it over most other issues because once your system becomes unusable due to memory/crash issues, it doesnt matter whether the debugger or npm UI has this or that feature. we promise to get back to the rest of the list once the dust around isense settles!

thx for your patience,

Jun 1, 2014 at 8:36 PM
Edited Jun 1, 2014 at 8:39 PM

Thanks for the response. It's good to know that the work on the new JSLS is almost complete.

I hope the following points will be taken into account when deciding on the strategy going forward:
  • The new JSLS would still need to be maintained. So although the work on it is coming to an end there will be new features and bug fixes that will inevitably have to be carried out.
  • For those using TypeScript, the JSLS is of exactly zero importance. For the TS environment, one may as well switch off JavaScript autocomplete, because it's no longer necessary to edit plain .js files.
  • (I assume) The JSLS will only ever provide completion for a small set of use cases (native JavaScript, core NodeJS etc.). The TypeScript language service, on the other hand, is extensible by the user; the user only need include a declarations file from DefinitelyTyped, which at present has definitions for some 450 plus libraries. Custom declarations can simply be crafted by the user.
In any case keep up the excellent work!
Jun 1, 2014 at 9:53 PM
The new language service does not use hardcoded information about modules; rather, it analyses the source code of those modules using type inference - basically, the same model that PTVS uses (the code itself is shared/forked in many places, in fact). The hardcoded stuff only pertains to JS builtins and core node.js modules that cannot be analyzed in such a way. So it doesn't really have to be extended by the user in the sense of .d.ts files (though, of course, the quality of analysis and the resulting completions on any given module may vary significantly, and further tweaks may be necessary to get good quality from more modules).
Jun 4, 2014 at 9:39 AM

Hello Ptools,

Do you have an approximate date of when the new language service is going to be pushed to the master branch?

Kind regards,
Jun 4, 2014 at 7:07 PM
It's there already - this was the initial changeset, and there have been numerous fixes since then. The latest dev build has it if you want to try it, though it's somewhat outdated with respect to the fixes.
Jun 5, 2014 at 2:54 PM
I see what you are talking about. However, after cloning the repository (after May 15th 2014). I happened to notice that the completion list doesn't work as it used to after starting typing (it is not shown but if you press ctrl + space it does the completion also after typing (.) after an object ...etc) as well that the indentation size isn't fetched from the Nodejs texteditor options but rather from the JavaScript texteditor options. I assumed that there are changes that haven't been pushed yet.

Great work by the way ... :)